Used the method given here to convert, using
puttygen mykeyfile.ppk -o ~/.ssh/id_rsa.pub -O public-openssh
andputtygen mykeyfile.ppk -o ~/.ssh/id_rsa.pub -O public-openssh
puttygen mykeyfile.ppk -o ~/.ssh/id_rsa -O private-openssh
fixing dual-boot time differences
With earlier versions of Linux, the method was to choose UTC = yes in /etc/default/rc5 and so on. With Ubuntu 16.04 and above which use systemd, the method is to enter
timedatectl set-local-rtc 1Monday, June 20, 2016
behaviour of virtualdub frame processing
If we choose Process every other frame (decimate by 2) - the resulting avi would have a framerate half that of the source.
For example, a 30fps source, with this decimate by 2 results in an output at 15 fps. If that 15 fps output is re-saved using direct stream copy choosing 30 fps as output frame rate, then we get a 2x speeded up video. A two-step process.
Tuesday, June 14, 2016
cloning laptop hard disk
My laptop hard disk started showing SMART errors with Crystal Disk Info. Got a new Seagate 1 TB SSHD for replacement. Macrium Reflect Free could not clone - the bad sectors made it abort. Clonezilla did the job in around 4 hours for the 160 GB hard disk with three partitions, using an external USB dock for the new hard disk.
But the cloned hard disk did not boot. Booted with Windows XP install DVD, went into recovery console and did fixmbr. Then XP booted, but showed only C and D drives. Since in any case I would need to copy files from E:, might as well increase the size of C: by deleting D:. Used Partition Wizard for increasing C: size, created D: and E: as fresh partitions, and left free space for Linux. RichCopy copied over the D: and E: contents, ignoring errors, in just about 90 minutes. Now most apps work as expected, except some which complain about path not found - maybe they look for My Documents in C:. Tuesday, June 07, 2016
checksums on Windows
As mentioned on this page, installed and tried out WinMD5Sum and Checksums calculator. Found that one of my iso downloads had a checksum error.
Wednesday, June 01, 2016
WHM + CPanel setting up ssh access
To set up shell access via ssh to a server for which I have Web Host Manager (WHM) and CPanel access:
1. Import my existing ssh public key to the server via the CPanel of the relevant user - by clicking Manage SSH keys - for this, as this post mentions, the key should be prefaced with ssh-rsa and should not have line breaks within the key.
2. The key should be authorized - from the Manage SSH keys interface, by clicking on the Manage authorization link. Now ssh login via key exchange using that key would be possible, for that user.
3. In order to get to a root shell, that user has to be added to the wheel group, after making sure that user is in a full shell and not a jailed shell - via WHM in Home >> Account Functions >> Manage Shell Access and Home >> Security Center >> Manage Wheel Group Users respectively.
1. Import my existing ssh public key to the server via the CPanel of the relevant user - by clicking Manage SSH keys - for this, as this post mentions, the key should be prefaced with ssh-rsa and should not have line breaks within the key.
2. The key should be authorized - from the Manage SSH keys interface, by clicking on the Manage authorization link. Now ssh login via key exchange using that key would be possible, for that user.
3. In order to get to a root shell, that user has to be added to the wheel group, after making sure that user is in a full shell and not a jailed shell - via WHM in Home >> Account Functions >> Manage Shell Access and Home >> Security Center >> Manage Wheel Group Users respectively.
Sunday, May 08, 2016
problems with X crashes on newer Ubuntu
My Ubuntu install has had problems with random freezes after an upgrade to 12.04. Finally, when starting to do some serious simulation work, I decided to do something about it.
The first thought was that firefox was causing the crashes, since the freezes would start most often while starting firefox. But then, found the crashes happening when starting other apps as well. Suspected X, or the display driver, and wanted to use vesa instead. Many of the methods listed, like blacklisting nouveau, did not work with 16.04 - even after reboots, nouveau driver was being listed as used by lsmod.
Final solution was to create a /etc/X11/xorg.conf - which does not exist by default. As mentioned at many places, the procedure to do this was:
Switch to a console. Ctrl+Shift+F2, for example.
Kill the display manager with sudo service lightdm stop (or whichever dm is running)
Generate a new xorg.conf with sudo X -configure
Edit the xorg.conf.new created in current directory, replacing all instances of nouveau with vesa
Move it with a rename to /etc/X11 with sudo mv xorg.conf.new /etc/X11/xorg.conf
Restart X with sudo service lightdm start
Unfortunately with Vesa, the screen refreshes are very laggy, even with Lubuntu. But no crashes.
The first thought was that firefox was causing the crashes, since the freezes would start most often while starting firefox. But then, found the crashes happening when starting other apps as well. Suspected X, or the display driver, and wanted to use vesa instead. Many of the methods listed, like blacklisting nouveau, did not work with 16.04 - even after reboots, nouveau driver was being listed as used by lsmod.
Final solution was to create a /etc/X11/xorg.conf - which does not exist by default. As mentioned at many places, the procedure to do this was:
Switch to a console. Ctrl+Shift+F2, for example.
Kill the display manager with sudo service lightdm stop (or whichever dm is running)
Generate a new xorg.conf with sudo X -configure
Edit the xorg.conf.new created in current directory, replacing all instances of nouveau with vesa
Move it with a rename to /etc/X11 with sudo mv xorg.conf.new /etc/X11/xorg.conf
Restart X with sudo service lightdm start
Unfortunately with Vesa, the screen refreshes are very laggy, even with Lubuntu. But no crashes.
Saturday, May 07, 2016
Thursday, May 05, 2016
python using a single core for numpy
A point which came up when using pynlo:
A longish reply for the question why python uses only one core for numpy -
http://stackoverflow.com/questions/15639779/why-does-multiprocessing-use-only-a-single-core-after-i-import-numpy
In short, core affinity can be reset using
os.system("taskset -p 0xff %d" % os.getpid())
after the module imports. But this would be useful only for multi-threaded programs, of course.
A longish reply for the question why python uses only one core for numpy -
http://stackoverflow.com/questions/15639779/why-does-multiprocessing-use-only-a-single-core-after-i-import-numpy
In short, core affinity can be reset using
os.system("taskset -p 0xff %d" % os.getpid())
after the module imports. But this would be useful only for multi-threaded programs, of course.
Wednesday, May 04, 2016
mounting a samba share with read-write permissions
Mounting a shared network drive on our internal server running Ubuntu - to make it read and write enabled, PB reports the command to be:
sudo mount –t cifs //ip-address/Share_name /local/mount/path –o username=correct_uname,uid=local_uid,gid=local_uid
Then, the local_uid user has read + write permissions.
Edit: 11 July 2016
This post about listing hostname with ip address is useful.
Also, PB adds one more tip - for mounting shares with spaces, use single quotes
sudo mount -t cifs '//192.168.1.1/SHARE WITH SPACES' tempmount -o username=guest,password='',nounix,sec=ntlmssp
sudo mount –t cifs //ip-address/Share_name /local/mount/path –o username=correct_uname,uid=local_uid,gid=local_uid
Then, the local_uid user has read + write permissions.
Edit: 11 July 2016
This post about listing hostname with ip address is useful.
Also, PB adds one more tip - for mounting shares with spaces, use single quotes
sudo mount -t cifs '//192.168.1.1/SHARE WITH SPACES' tempmount -o username=guest,password='',nounix,sec=ntlmssp
Tuesday, May 03, 2016
installing and using pynlo
Looking around for supercontinuum generation literature, came across PyNLO's documentation. Tried to install and use it. Was a bit of a struggle at first, but finally it all came together.
Issues:
Issues:
- Anaconda3 version 4.0 installation on Windows XP failed - reported that it failed to change path variable etc, but more importantly, the exes were not running - "this is not a valid Windows executable".
- On Ubuntu 14.04, tried a direct pip install. Some dependency issues. Thought upgrading to 16.04 would help - ran out of hard disk space - 13 GB. Formatted and installed Lubuntu instead. With many hiccups on the way - like while doing a manual partitioning, we must not touch the swap space - because that is where the installer stores the installation files!
- With Anaconda3 and pynlo, errors like Missing parenthesis in call to print - so had to install Anaconda2 instead.
- Trying installation with pip install pynlo - installation of the required pyfftw failed with the error fftw3.h: No such file or directory - it needed libfftw2-dev as mentioned in the comments at this post.
- After pynlo installed also, running the example script gave errors IOError: [Errno 2] No such file or directory: .../pynlo/media/fibers/nist_fibers.txt and on copy-pasting general_fibers.txt to nist_fibers.txt, an assertion error - pynlo/interactions/FourWaveMixing/SSFM.py, line 662, in conditional_fftshift assert chksum == np.sum(abs(x)) AssertionError
Solutions:
- Currently pynlo needs Python 2.7 to run, won't run on Python3. So, install Anaconda2 and not Anaconda3.
- On Windows, this page says that Windows XP is supported only for Anaconda versions 2.2 and below, so downloaded 2.2 instead of the latest.
- Installing libfftw2-dev on Linux with apt-get install libfftw2-dev solved the pyfftw install issues. Similarly, on Windows, the way to install it is given at https://pypi.python.org/pypi/
pyFFTW#downloads - ie. download the fftw dlls and put them in the same folder as the pyfftw wheel folder before install. The pyfftw whl file was installed as pip install wheelfile.whl without any issues. - Using the latest git code solved all the pynlo issues, using
pip install git+https://github.com/pyNLO/PyNLO.git like this post. - Git for windows was installed from https://git-scm.com/download/win
- On Windows XP, everything was 32 bit, and the example took 55 seconds to run. On 64-bit Lubuntu, it ran in almost the same time. Lubuntu's desktop CPU meter indicates that it was using only one core of my dual-core Athlon, ie. 50% cpu.
freeing up space on ubuntu
This post has lots of useful information in the answers. I removed libre-office and old kernels to get 1.5 GB. For the removing the old kernels, I followed
1. uname -r to know current kernel
2. sudo apt-get remove kernelname1 kernelname2 etc after doing
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove
sudo apt-get install localpurge
and
rm -Rf /tmp
etc.
The listing of all packages with sizes with
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less
is also a nice trick to use.
1. uname -r to know current kernel
2. sudo apt-get remove kernelname1 kernelname2 etc after doing
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove
sudo apt-get install localpurge
and
rm -Rf /tmp
etc.
The listing of all packages with sizes with
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less
is also a nice trick to use.
Monday, April 25, 2016
too many files bug and php error reporting
Our audio search page had a bug where if too many files were selected, the results would not be displayed. With the help of S & B, constructed a workaround. The form was submitting all fields of the large table, instead of only submitting the hidden variables which had the fileids. So, made the main form submit to a dummy destination, and made another form with the hidden variable, submitting to the actual destination. That solved the issue, which was that there were too many fields being submitted. We did not have to change max_input_vars.
While troubleshooting, we wished to see detailed error reports. The way to do that was
ini_set('display_errors',1);
error_reporting(E_ALL);
for each php page.
While troubleshooting, we wished to see detailed error reports. The way to do that was
ini_set('display_errors',1);
error_reporting(E_ALL);
for each php page.
Wednesday, April 06, 2016
cyberoam fail-over issue
PB had a problem where the 2nd gateway was not being automatically used as failover when the main gateway failed. Apparently it was due to the way in which Cyberoam had been configured. Tech support explained it, and PB fixed it.
Tuesday, March 29, 2016
Xmms alternative
P reports that Xmms is no longer available on Ubuntu 14.04, and some of the ubuntu forum posts have broken links. His solution was to recompile and use Audacious instead.
dns limitations on our mail server
We were doing some explorations of the feasibility of remote hosting our mail server which sends out daily emails to around 50,000+ subscribers. Seeing some posts about rate limits to Google public DNS servers etc, and our own experiences with DNS failures, we should perhaps run our own DNS server as well as mail server if we plan to shift the email server.
Sunday, March 27, 2016
Firefox problems with HTML5, Vimeo and Youtube
One issue seen with Firefox - Vimeo embedded player not appearing on screen - seems to have been sorted out at some time - the current version 45.0.1 does not seem to have this issue. Or is it that it still has issues with embeds like iframe src="//player.vimeo.com/video/xxxx instead of src="https://player.vimeo.com/video etc ? There are lots of people with issues with Firefox and Vimeo.
http://techawakening.org/vimeo-videos-not-working-in-firefox-solution/2490/
Then there is the persistent stutter - for audio as well as video using html5 playback from Firefox on Windows. The only solution for that seems to be to force Flash player playback. This can be done for youtube as in my earlier post.
http://techawakening.org/vimeo-videos-not-working-in-firefox-solution/2490/
Then there is the persistent stutter - for audio as well as video using html5 playback from Firefox on Windows. The only solution for that seems to be to force Flash player playback. This can be done for youtube as in my earlier post.
problem reading memo field
After a PHP upgrade from 5.3 to 5.5, one of our php applications reading data from an Access .mdb file had an issue - other fields were displaying fine, but the data from the memo field was showing blank.
After poking around for a couple of days, PB finally found the solution to be the one suggested in the comments at
https://bugs.php.net/bug.php?id=52658
That is, he had to add the optional cursor_type parameter SQL_CUR_USE_ODBC like
After poking around for a couple of days, PB finally found the solution to be the one suggested in the comments at
https://bugs.php.net/bug.php?id=52658
That is, he had to add the optional cursor_type parameter SQL_CUR_USE_ODBC like
$cnx = odbc_connect('$databaseName', 'user', 'pass', SQL_CUR_USE_ODBC);
Then it works.
Tuesday, March 22, 2016
Airdroid vs ES File Explorer
One more post about my Xiaomi Mi3 phone. Though this is probably applicable to all Android phones.
I'd earlier used ES File Explorer to transfer files to and from Windows shares to the phone over Wifi. But when transferring to shares with a large number of files, or while transferring large files, ES File Explorer would keep popping up a 'Failed' dialog box, and would need repeated 'Retry' attempts to transfer multi-MB files. Finally looked for alternatives, and found Airdroid's features include file transfer. I use it in 'local network' mode, by typing in the ip address, so extra charges, no need of external network etc. ES is still useful for local file browsing etc.
I'd earlier used ES File Explorer to transfer files to and from Windows shares to the phone over Wifi. But when transferring to shares with a large number of files, or while transferring large files, ES File Explorer would keep popping up a 'Failed' dialog box, and would need repeated 'Retry' attempts to transfer multi-MB files. Finally looked for alternatives, and found Airdroid's features include file transfer. I use it in 'local network' mode, by typing in the ip address, so extra charges, no need of external network etc. ES is still useful for local file browsing etc.
Xiaomi Mi3 with Android 4.4.4 - soft home and back buttons
After my last post about my phone, there were some more developments. Now the headphone socket does not work at all. But thankfully the earpiece works fine. Then, after frequent falls onto hard cement floors, the left corner of the screen cracked slightly, and the home, back and recent apps buttons on the bottom bezel of the phone stopped working.
Since I had heard of apps with 'soft home button', I installed several of them. None of them seemed to work with Xiaomi's MIUI. Then I installed MyHomeButton which creates a notification in the notification pull-down screen. This worked, but with the drawbacks that:
Since I had heard of apps with 'soft home button', I installed several of them. None of them seemed to work with Xiaomi's MIUI. Then I installed MyHomeButton which creates a notification in the notification pull-down screen. This worked, but with the drawbacks that:
- It would not start on rebooting the phone - I have to remember to open the app settings, turn off and turn on the check-boxes for Home and Recent Apps, then the notifications would appear.
- No back button.
- Use requires a swipe from the top to bring down the notification bar, a swipe sideways to view the notifications, and then a tap to activate the home button. A bit cumbersome.
- Settings -> Installed Apps -> Downloaded -> Back button -> Permission Manager -> Display pop-up window, Enable.
- Settings -> Additional Settings -> Accessibility -> Back button -> Accessibility, Enable.
Subscribe to:
Posts (Atom)
