dereenigne.org

reverse engineered

Batch Image Conversion

If you have a batch image conversion to do, ImageMagick is your friend. It provides commandline tools for manipulating images. I recently had to convert about 200 .svg images to .png images, while maintaining the alpha channel. Rather than doing this by hand, it can be done in a single command, using mogrify, one of the ImageMagick utilities. mogrify -background none -format png *.svg Have a look here for a list of the other arguments that can be passed to mogrify. Read more →

iptables Port Redirection

On a Unix system, TCP and UDP between 1 and 1023 require root privileges. This means that any program wishing to bind to these ports must be run as root. While this is fine for trusted programs such as Apache and OpenSSH, I’d be weary of letting other programs run as root. This obviously means that you cannot use the standard ports, such as 80 for HTTP, 21 for FTP etc. Read more →

SSH Avoid Host Key Verification

SSH is great for providing security over unprotected networks, but sometimes the security measures can just get in the way. When dealing with embedded devices or virtual machines, rolling out a new firmware/disk image will result in the SSH host key changing, resulting in the warning below. user@host:~$ ssh remotehost @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! Read more →

Axis 207 Enable Telnet

The Axis 207 IP camera that I had been using for the snowcam is actually a fully featured Linux system. To enable console access, you need to use the webinterface to edit the system init table. http://192.168.1.10/admin-bin/editcgi.cgi?file=/etc/inittab Replace 192.168.1.10 with the IP address of the camera. Edit: # Uncomment the following line to start the telnet server. # tnet:35:once:/usr/sbin/telnetd So that it reads: # Uncomment the following line to start the telnet server. Read more →

AppleTV Linux Broadcom BCM4328 Wireless

I have an AppleTV 1.0 running Ubuntu 8.04 Server with an XBMC front end as a HTPC/media streamer. The Broadcom BCM4328 wireless card in the AppleTV is not supported according to the supported devices list of the Broadcom propriety driver, but I’ve managed to get it to work. SSH to your AppleTV and download the 32-bit driver from Broadcom: wget http://www.broadcom.com/docs/linux_sta/hybrid-portsrc_x86_32-v5_100_82_38.tar.gz Extract that tarball to the current directory: tar -xvzf hybrid-portsrc*. Read more →

VLC CACA ASCII Output

If you are logged into a remote terminal and wish to quickly view the contents of video files, you can use the CACA output module of VLC to view an ASCII version of the video through the terminal. This is handy if you haven’t set up X forwarding, or if X isn’t available. vlc -V caca fileToOpen I’d even recommend doing it just for fun on your local machine. The results are surprisingly good! Read more →

/dev/mem grep

Often it is useful to be able to search the contents of system memory, for example to check if a program you are running stores your password unencrypted in memory. The following command combines dd, strings and grep to search the system memory for character strings, and searches those results for those matching SearchString. Because /dev/mem does not have public read permissions, you must run the command from a root terminal. Read more →

SSH Bouncing

SSH bouncing is a method of getting end to end encrypted access to hosts behind restrictive firewalls. ssh hostA ‘ssh hostB’ isn’t much good, because it doesn’t provide end to end encryption. All it really does is login to the second host automatically. SSH bouncing tunnels one SSH connection inside the other to create a full connection to the firewalled host. It could also be done with local SSH port forwards, but this method is simpler, and doesn’t require two terminals - one to set up the forward, and the other to SSH to the firewalled host. Read more →

sudo !!

sudo is a method of executing programs on a Linux/Unix machine with the permissions of a different user (usually root). sudo enabled systems generally have the root account disabled, which means it is easy to forget to elevate the privileges of root programs. sudo !! solves this by executing the previous command with root privileges. This doesn’t make much difference for short commands such as shutdown, but for longer commands, this can save a few seconds. Read more →

SSH SOCKS Proxy

SSH is a method of connecting two computers securely. The protocol also supports tunneling of traffic inside the SSH connection. This enables us to setup a secure mini VPN in seconds. I run a SSH server on my router at home, which I use when I’m using internet connections I do not trust, or when I want to access devices behind my firewall. user@client:~$ ssh server-D 1080 Now set your SOCKS proxy to localhost:1080 in your browser: Read more →