Following the default installation of wireshark it is only possible to capture packets as root, which is clearly less than ideal. It is much better to run wireshark as a non-root user:Continue reading Wireshark installation and use as non root
pyUSB is an excellent Python package that can significantly simplify USB programming. For most Linux distributions there are packages only for older versions of pyUSB, but since it is actively developed you probably want to have the latest version on your system.Continue reading Install pyUSB 1.x latest version
After having installed Ubuntu Linux 14.04 on an Apple Mac I found that the keyboard layout was not quite correct, e.g. function keys were not easily accesible and some characters were missing. The changes below will turn the keyboard into a keyboard with standard PC layout.Continue reading Apple keyboard with Linux
The Microchip MPLabX IDE, IPE and XC8 packages need additional 32-bit libraries and so their installation is slightly more involved than just running the installer scripts.Continue reading Microchip MPLabX installation on 64-bit Ubuntu system
After a recent kernel update I found that the stock CentOS kernel was less than optimal for the CPU I am using, and so I decided to create a kernel optimised for my VIA C7 CPU.Continue reading CentOS 6.5 kernel compile for VIA C7 CPU
Update 12/1/2015: It appears that the Nexus 7 is now automatically recognised and made available in xubuntu 14.04.1 Trusty; however, if you are still having trouble, read on.Continue reading Linux and Nexus 7 USB connection
Following an upgrade to Ubuntu 12.04 I wanted to install gpsim again. I was pleased to see that it was included in the standard repositories and so I duly installed the stock packages. However, as soon as tried to use it the problems started. After a bit of fiddling around it became obvious that gpsim was compiled for the stock package with the GUI disabled and so a recompile was in order.Continue reading gpsim, Ubuntu and the case of the missing GUI
I have recently had to make a backup of the ‘My Documents’ directory of a Windows XP user to a CentOS server.Continue reading Temporary rsync server installation
If you ever get an ssh session that seems to be stuck, try closing the connection using one of the ssh built-in escape sequences.Continue reading Escape from ssh
If you are getting an error message similar to
/usr/bin/xauth: timeout in locking authority file /home/username/.Xauthority
you are probably facing one of the following scenarios.Continue reading xauth and .Xauthority
I like to display keyboard entries, code examples and sample outputs with distinctive formatting using the <pre>, <kbd>, <code>, and <samp> tags. I also like this formatting to appear uniform across the whole web siteContinue reading Don’t like your WordPress theme? Modify it.
I really hate it when an application automatically rewrites the code I provide without asking me first.Continue reading WordPress html code rewriting and the frustration it causes
The 16 commands you need for a fully functional WordPress installation.Continue reading WordPress installation – 16 commands from start to finish
On occasion you may find that the stock kernel just does not cut the mustard and decide to change some of the configuration parameters and re-compile. Below is a list of the steps involved.Continue reading CentOS 6.4 kernel compile
My old Ubuntu 12.04 server had serious performance problems with NFS exported home directories and the decision has been taken to use CentOS as the next server distro.Continue reading CentOS 6.4 installation
If you have ever tried correcting the MP3 tags for many tracks in your music library, you probably have grown tired of the manual process very quickly, just like me.Continue reading MusicBrainz
Purpose: start/maintain/stop a reverse ssh tunnel to an always-on ssh accessible server
middleman is the ssh server that will be used to access the client machine
middleman has IP address mm.ip.addr
cuid and mmuid are users with access rights to ssh on client and middleman respectively
On client have nmap, autossh, openssh installed
On server have openssh-server installed and runnig
On client log in as cuid:
ssh-keygen # press enter twice for empty password
cat .ssh/id_rsa.pub | ssh -l mmuid mm.ip.addr sh -c "cat – >> ~/.ssh/authorized_keys"
#echo Checking for autossh…
[ -x /usr/bin/autossh ] || exit 0
#echo Checking for ssh…
[ -x /usr/bin/ssh ] || exit 0
#echo Checking for nc…
[ -x /bin/nc ] || exit 0
#echo Checking for server…
[ ! `/bin/nc -z -w 1 188.8.131.52 22` ] || exit 0
#echo Stopping any already running autossh instances.
killall -q -TERM autossh
#echo Starting reverse ssh tunnel.
su -l -c "/usr/bin/autossh -4 -M29002 -f -N -R 1411:localhost:22 email@example.com -oLogLevel=error -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no" zjl || exit 0
#echo All done.
#echo Stopping any running autossh instances.
killall -q -TERM autossh
#echo All done.
chmod +x /etc/network/if-up.d/stop_autossh_rev_tunnel /etc/network/if-up.d/start_autossh_rev_tunnel
setting up ssh keys
reverse ssh tunnel
autossh script to start reverse tunnel
Ubuntu man page(s)