Displaying posts tagged: linux

Redirect local traffic to a web cache with iptables

No Comments
Very occasionally I come across an Linux application that does not respect the http_proxy variable. This stops me from using the application at university as they forbid traffic on port 80 unless it goes via their webcache. So today I came up with a hack of a solution that involves iptables: # IP address and port ...

Installing packages into your user directory

No Comments
Today I had the need to install some FreeBSD and Ubuntu packages inside my home directory because I did not have root permissions to install them. It was quite simple to install the packages on FreeBSD pkg_add -rRP /home/bramp nano Where nano is the name of the package I wanted. I should point out you don't ...

Updating.../-\|/-|

2 Comments
Do people other than me find updating their servers to be relaxing? At every opportunity I run "apt-get update". Today I'm updating 7 different machines simultaneously. My Debian machines I simply issue the following commands: apt-get update apt-get upgrade My FreeBSD machines: portsnap fetch update portmanager -u I think the Debian process is easier (and clearly ...

Useful scripts/configurations

No Comments
Make git colourful git config --global color.diff auto git config --global color.status auto git config --global color.branch auto Make nano colourful cp /usr/local/share/examples/nano/nanorc.sample ~/.nanorc or zcat /usr/share/doc/nano/examples/nanorc.sample.gz >~/.nanorc then nano ~/.nanorc To trim trailing whitespace from *.cc on Linux (taken from this blog): find . -name '*.cc' -exec sed -i {} -e 's/[ \t]*$//' ';' and ...

The 7 month fork bomb

No Comments
Today I was helping a student with some C programming, and the remote machine he was compiling and running his code on was running very slowly. It was a shared machine so I assumed some other students were using it. Therefore I had a quick look at "who" and found that only one other user was ...