Monthly Archives: November 2013

Get email upon change of IP address

Sometimes we just don’t have a fixed IP on a PC. Here is how to setup a cron script to email upon change (checked each hour). It uses the sendmail program to setup an email server on your PC. sudo apt-get install sendmail then type > ~/.current_ip then type nano ~/scripts/checkIP and cut and paste […]

7zipping and moving recursively by top-level directory

The following script takes the top-level directories and makes a 7zip archive from each top-level directory, containing all its subdirectories. This function has a primitive “no-clobber” that won’t overwrite existing files. Note that you can use up all HDD space if you have a lot of huge files — watch the progress of the program. […]

Convert series of images to PDF

say I have a bunch of sequentially numbered PNG files (say from a scanner) and I want to make a PDF. Let’s say they’re named: page01.png page02.png page03.png … In Terminal, type: convert -page letter -adjoin page*.png out.pdf and in a few seconds a PDF out.pdf will be created. This uses ImageMagick.

Printing PDF from Matlab on Ubuntu

Sometimes you don’t have a color printer handy, and/or just want to print a color PDF for later reference — say a hand-annotated Matlab figure. You need the CUPS PDF program, which saves printed PDFs to the ~/PDF directory. sudo apt-get install cups-pdf The output directory can be configured by editing the “Out” directory in: […]

vncviewer 1.3.9-6.4 isn’t working with -user option

For some reason, the version of TightVNCviewer currently shipping with Ubuntu 13.10 isn’t working for me with the -user option (usually needed, since remote machine login doesn’t match local machine). To work around this, I use ssvncviewer version 1.0.29-2build1 with the same options.

Disable Beaglebone Black flashing heartbeat LED

To disable the annoying heartbeat LED: sudo -s echo none > /sys/class/leds/beaglebone\:green\:usr0/trigger exit Note, this might reset at reboot. You can search the web for how to make this permanent via the device tree (requires extraction and recompilation). Might also be able to do something with rc.local — didn’t try this. Reference:

RTL2832 ADS-B decoder

the dump1090 program can be obtained by: sudo apt-get install git libusb-1.0-0-dev cmake git clone git:// mkdir ~/rtl-sdr/build cd ~/rtl-sdr/build cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON make sudo make install sudo ldconfig git clone cd ~/dump1090 make Then, do: lsusb and look for the RTL2832 id codes similar to those below, and insert them in ATTRS(idvendor) […]

WGET: download an HTTP or FTP directory recursively

Many science data sites are an Apache server with a HTTP index.html file listing, perhaps recursively, a lot of files and directories. You can download them recursively to your PC as follows (use this responsibly, you can consume gigabytes of data at cost to science host or yourself!) wget -r -np -nc -nH –cut-dirs=4 –random-wait […]

Matlab missing libstdc++ error

if you get an error like: /usr/local/MATLAB/R2013a/sys/os/glnxa64/ version `GLIBCXX_3.4.15′ not found (required by /usr/lib/ try doing: cd /usr/local/MATLAB/R2013a_Student/sys/os/glnxa64 sudo mv sudo ln -s /usr/lib/x86_64-linux-gnu/

Install Debian 7 to eMMC (internal flash drive) of Beaglebone Black

Note there’s now a semi-automated script to do this. 1) on your laptop PC, goto and download the Debian 7 image (e.g. debian-wheezy-7.0.0-armhf-3.8.13-bone20.img.xz ) 2) [optional] check that md5 sum is correct by typing in Terminal: md5sum ~/Downloads/debian-wheezy-7.0.0-armhf-3.8.13-bone20.img.xz this should match the md5 given at the download page 3) type lsblk, note which drives […]