Find Uplink
#!/bin/bash
#simple uplink finder. Returns the first device to be able to ping 8.8.8.8
for i in $(ifconfig |grep encap |cut -f 1 -d ' '|grep -v lo); do
if ping -I $i -c 1 -w 20 8.8.8.8 > /dev/null; then echo $i; exit 1; fi
done
#!/bin/bash
#simple uplink finder. Returns the first device to be able to ping 8.8.8.8
for i in $(ifconfig |grep encap |cut -f 1 -d ' '|grep -v lo); do
if ping -I $i -c 1 -w 20 8.8.8.8 > /dev/null; then echo $i; exit 1; fi
done
Needless to say: “yet another chroot bootstrapper”
moo is built to help you develop .deb based distributions, and deploy them i.e. via netboot to the target machine.
currently moo only consists of the moo script and /etc/moo.d/. The latter one holds configuration and available packages.
The script will bootstrap a development environment for you, as well as pull updates from the package repository on hakt0r.de.
Just grab moo and execute it like:
usage:
moo [options] verb arguments
examples:
moo init
moo init /home/anx/moo/
moo install /chroot /media/ubuntu-cd karmic
moo install /chroot http://blah/ubuntu jaunty #todo
moo mount /chroot
moo enter /chroot
verbs:
init [prefix=/]
install target source dist
remove target
mount target
unmount target
enter target [command=/bin/bash]
help
options:
-v - be verbose
credits:
anx, feuerziege, amm0n @hakt0r.de
I have been using synergy for a long time now. The only ugly thing about it: it doesn’t encrypt. That’s where ssh comes in. I wrote this handy script a while ago to start ssh tunneled synergy on a client machine:
#!/bin/sh port=24800 host=$1 echo -n killing existing synergyc... killall -9 synergyc echo done echo -n killig existing ssh tunnels... pids=$(ps x |grep ssh|grep $port|grep $host|cut -d' ' -f1) for i in $pids do echo -n "killing $i..." kill -9 $i; echo done done echo -n "Trying to ping $host" if ping -c1 $1>/dev/null; then echo done echo -n starting ssh tunnel... ssh -f -N -L 127.0.0.1:$port:$1:$port $host echo done
echo -n starting synergyc...
sleep 1 synergyc 127.0.0.1 echo done else echo "failed." fi echo done
If you want an ls to be issued each time you cd somewhere:
function mychdir(){chdir $@;ls;}
alias cd='mychdir'
Just add these two lines to your shells .rc file and you are good to go.
Just need the sound of a downloaded tube movie (featuring mplayer and lame)?
#!/bin/bash
mplayer -ao pcm -vo audiodump.wav $1 lame audiodump.wav -q $2 -b $3 $1".mp3" rm audiodump.wav
Powered by WordPress