mount -t auto -o loop the.iso /mnt/iso
My NAT list to create when they disappear (wtf?!)
:nat create protocol=tcp inside_addr=10.0.0.101:6881 outside_addr=0.0.0.0:6881
:nat create protocol=tcp inside_addr=10.0.0.101:80 outside_addr=0.0.0.0:80
:nat create protocol=tcp inside_addr=10.0.0.101:113 outside_addr=0.0.0.0:113
:nat create protocol=tcp inside_addr=10.0.0.101:22 outside_addr=0.0.0.0:22
:nat create protocol=udp inside_addr=10.0.0.101:4672 outside_addr=0.0.0.0:4672
:nat create protocol=tcp inside_addr=10.0.0.101:4662 outside_addr=0.0.0.0:4662
:nat save
Example telnet script. This one telnets my modem and displays the list of open ports (including dynamic ones)
- #!/bin/sh
- host=10.0.0.138
- port=23
- cmd="nat list"
- ( echo open ${host} ${port}
- sleep 1
- echo -e "\r"
- sleep 1
- echo ${cmd}
- sleep 1
- echo -e "\r"
- sleep 1
- echo exit ) | telnet
My usual .bashrc aliases.
- alias pico='nano -w'
- alias +x='chmod +x'
- alias psg='echo "USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND"; ps aux | grep -v grep | grep'
- alias lsd='ls -l | grep ^d'
- alias lsf='ls -l | grep -v ^d'
- alias cls='clear'
- alias du='du -ch'
- alias who='who --lookup'
- alias lynx='lynx -accept_all_cookies'
- alias epoch='date +%s'
- alias detar='tar zxvf'
- alias debz='tar jxvf'
This script checks if a remote host is up (or at least answering to ping)
- #!/bin/bash
- ping -c 1 $1 >/dev/null 2>&1
- if [ "$?" = "0" ]; then
- echo -n "up"
- else
- echo -n "down"
- fi
1. create a script file :
- open ftp.domain.com
- user mylogin mypasswd
- lcd /my/local/dir
- put myfile
- bye
- quit
2. call the script :
ftp -inv < script &[/code] 3. that's all.
A slighly better way to update your file name database than just issue a updatedb :
- #!/bin/bash
- # Better than updatedb
- #
- echo -n "Updating locatedb..."
- updatedb --prunepaths="/tmp /proc /var/tmp"
- date > /var/log/updatedb.log
- chmod +r /var/log/updatedb.log
- echo " done."
This bash script extracts a random line from a given (text) file. This is a cheap "fortune" replacement.
- #!/bin/bash
- # randomline : extracts a random line from a text file
- if [ -z $1 ] ; then
- echo "Usage : $0 <file>"
- exit 0
- fi
- NB_LINES=$(expr $(wc -l $1 | sed -e 's/ *//' | cut -f1 -d " "))
- NB_RAND=0
- while [ "$NB_RAND" -eq 0 ]
- do
- NB_RAND=$(expr $RANDOM \% $NB_LINES)
- done
- sed -n "${NB_RAND}p;${NB_RAND}q" $1
This is my (wannabe) Geek Code.
- -----BEGIN GEEK CODE BLOCK-----
- Version: 3.1
- GO d- s: a C++(++++) L(++) P++ L++>+++ E---- W+++
- N- !o K? w++(+) O- M-- V? !PS PE Y+ PGP- t- 5 X-@
- R tv- b++ DI++>+++ D+++>++++ G e+++ h---- r+++ y+++
- ------END GEEK CODE BLOCK------
En gros, la loi de Maâme Fontaine touche à tout en matière d'internet : compétences des collectivités territoriales pour les télécoms, commerce en ligne, spam, cybercrime, cryptographie, etc… Seul la question du warp, pourtant cruciale, semble avoir été oubliée
Read More

