Thursday, June 5, 2014

Making a pdf from an IPython notebook

With the latest ipython one can run ipython nbconvert latex mynotebook.ipynb. The latest ipython can currently be installed from https://github.com/ipython/ipython, at the time of this writing this is the 1.0 development stream.


ipython nbconvert latex mynotebook.ipynb will result in a latex file. texi2pdf should then be able to convert this tex file into a viewable pdf - in my case I had to manually copy all the files and images out of the associated mynotebook_files directory to the same directory as the .tex file, both of which were generated by ipython nbconvert. If you encounter latex errors, see http://www.tug.org/texlive/acquire-netinstall.html for installation instructions for the latest latex. The default Ubuntu texlive package (as of 13.04 at least) is not recent enough to perform the conversion!

Copy files over ssh

dd if=input | ssh login@remotehost "dd of=output"

Wednesday, June 4, 2014

Inspect disk statistics with smartctl

smartctl -a -d megaraid,0 /dev/sdx

Compile Ubuntu packages from source

apt-get source <package> (NOTE: no sudo!)

sudo apt-get build-dep <package>


http://askubuntu.com/questions/28372/how-do-i-get-the-source-code-of-packages-installed-through-apt-get

Update firmware for older Dell servers

Download the CentOS LiveDVD from here: http://linux.dell.com/files/openmanage-contributions/om-firmware-live/

next, copy it to a usb drive with dd:

sudo dd if=<path to CentOS iso> of=/dev/<my usb drive> bs=4096

This image should have all the latest firmware built into it. I used this to update BMC firmware for the Dell R900.

There is a blog by Dell about this procedure as well, shown here:

http://en.community.dell.com/techcenter/b/techcenter/archive/2011/08/17/centos-based-livedvd-to-update-firmware-on-dell-servers.aspx

OpenWRT on DIR 601 Rev B1

Have to use the NA file, because the other file won't get recognized as firmware.

Once that is done, telnet into 192.168.1.1 to set up OpenWRT

uci del wireless.@wifi-device[0].disabled

uci del wireless.@wifi-iface[0].network

uci set wireless.@wifi-iface[0].mode=sta

uci commit wireless

wifi

iw wlan0 scan


then follow the steps here

http://wiki.openwrt.org/doc/recipes/routedclient#using.masquerade

Make sure to change the LAN settings to a subnet not shared by the "mothership" router! And also encryption type is PSK2 for WPA/WPA2 mixed mode - iw wlan0 scan did not show the same output as the steps on the page.

To change the default LAN IP of the D-Link network, simply edit /etc/config/network

http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-dir-601-b1-squashfs-factory-NA.bin

http://wiki.openwrt.org/doc/howto/clientmode

http://gradengineering.blogspot.com/2013/09/basic-setup-of-openwrt-on-dir-601-b1.html

Get full structure of website

wget \
     --recursive \
     --no-clobber \
     --page-requisites \
     --html-extension \
     --convert-links \
     --restrict-file-names=windows \
     --domains reddit.com\
     --no-parent \
         www.reddit.com