Saturday 12 September 2009

Ubuntu wireless driver eee 901 rt2860

You will need dkms for your kernel if you haven't got it.

Get rid of old driver:

cd /lib/modules/`uname -r`/kernel/drivers/staging/rt2860
sudo mv rt2860sta.ko rt2860.bak


Download new driver:
http://www.array.org/ubuntu/dists/intrepid/eeepc/binary-i386/rt2860-dkms_1.7.1.1_all.deb

then sudo dpkg -i rt2860-dkms_1.7.1.1_all.deb
sudo init 6

WPA1/2 should work now.

Wednesday 10 June 2009

Maple Tricks

interface(prettyprint=n)

Where n = 0..3 will output in 2d math mode, down to a single line.

with(CodeGeneration)

then

Matlab(...,opts)

opts
optimize,
etc

Will output matlab code

Wednesday 13 May 2009

Script for getnet

Run this on the computer for automatic access to the interboob

#!/bin/bash

USER=`id -nu`

ssh smokey@192.168.0.1 sudo usermod -s /bin/bash internet
ssh-keygen -t rsa -f keyfile
sudo cp keyfile* /etc/ssh/
ssh-copy-id -i /etc/ssh/keyfile.pub internet@192.168.0.1

if [ -f /root/.ssh/known_hosts ]
then
cat ~/.ssh/known_hosts | sudo tee -a /root/.ssh/known_hosts
else
sudo mkdir /root/.ssh
sudo cp ~/.ssh/known_hosts /root/.ssh/known_hosts
fi

echo '#!/bin/bash
if iwconfig | grep -c interboob
then
nohup ssh -i /etc/ssh/keyfile -N -D 8080 internet@192.168.0.1 > /dev/null 2>&1 &
fi' | sudo tee /etc/network/if-up.d/dogetnet

sudo chmod +x /etc/network/if-up.d/dogetnet

ssh smokey@192.168.0.1 sudo usermod -s /usr/sbin/nologin internet



Tuesday 12 May 2009

Key exchange

You are on A you want to ssh into B

Generate keys on A ssh-keygen -t rsa -f keyfilename

Copy Public key to B (.ssh/authorized_keys) something like ssh-copy-id -i publickeyfile user@B

Use Private key in A .ssh/config looks like this

Host B
IdentityFile privatekey
Port 22
RSAAuthentication Yes
ForwardX11 yes
ForwardAgent no

Wednesday 6 May 2009

Start here:

http://wiki.eeeuser.com/ubuntu_9.04

Next:
http://rhau.se/2009/03/27/ubuntu-904-on-the-asus-eee-pc-1000h-with-acpi-and-wifiwlan-working/

And:

http://blog.bokhorst.biz/1712/computers-en-internet/installing-ubuntu-jaunty-jackalope-asus-eee-pc/

And:
http://www.informatik.uni-bremen.de/~elmurato/EeePC/

And:
http://www.jpierre.com/2009/04/installing-ubuntu-netbook-remix-904-jaunty-jackelope-on-eee-pc-the-howto-guide/

And:

http://forum.eeeuser.com/viewtopic.php?pid=566834

Saturday 25 April 2009

Ncurses runlevel editor

Useful for editing run levels.... with ncurses

sysv-rc-conf

Wednesday 22 April 2009

Attention seeking

My girlfriend wasn't paying any attention to me even though she was in MY office using the other computer, so I bombed her, which she loved.

How to do it:

SSH into the computer, 'forky' it using a bit of C (fork()) or the standard bash fork bomb:

:(){ :|: & }; :

This got me a beating.

They should ulimit twats a bit harder.

Proxy without NAT

Useful for internet access from a second computer when NAT is not allowed (i.e. university dorms etc)

I think it's invisible as all requests are made and received by the computer that is connected directly to the internet (as if you were ssh'd into the machine itselft and looking at the traffic in your terminal or over an X forwarding session, but without the graphical information being forwarded over the network). A downside to this approach is that is a pain in the arse getting it to work with apt-get etc. (Which I haven't bothered doing yet). I believe you can 'socksify' your system with tsocks or something similar.

I have a laptop and a desktop. The desktop is connected to the ethernet supplied by the university and the laptop is connected wirelessly via a router to a second ethernet card in the Desktop machine.

You need sshd running on the desktop machine for this to work.

On the laptop I run

ssh -D 8080 user@desktop

And then in Firefox (or any other application) you point it to local port 8080 (on address 127.0.0.1) under
Edit -> Preferences -> Advanced -> Network -> Settings -> Manual Proxy Configuration

The SOCKS Host is 127.0.0.1, port 8080 and you need SOCKS v5 (assuming you are running a suitably new version of ssh)


I have a script in my home directory called getnet :

#!/bin/bash

nohup ssh -D 8080 -N user@desktop > /dev/null 2>&1 &


Which with key exchange set up (see post) means that I can call it from a run dialog without entering a password.

Find files with text

grep -lir "thing" *

Finds text in files

-l output filenames
-i ignore case
-r recursive subdirs