Check These Out
Delete a range of line
Query Wikipedia by issuing a DNS query for a TXT record. The TXT record will also include a short URL to the complete corresponding Wikipedia entry.You can also write a little shell script like:
$ $ cat wikisole.sh
$ #!/bin/sh
$ dig +short txt ${1}.wp.dg.cx
and run it like
$ ./wikisole.sh unix
were your first option ($1) will be used as search term.
Command is properly working on HP-UX 11.31
the 'set -x' mode can be exited by typing
$ set +x
This is probably overkill, but I have some issues when the directories have spaces in their names.
The
$ find . -type d -print0 | while read -d $'\0' dir; do xxx; done
loops over all the subdirectories in this place, ignoring the white spaces (to some extend).
$ cd "$dir"; echo " process $dir"; cd -;
goes to the directory and back. It also prints some info to check the progress.
$ find . -maxdepth 1 -name "*.ogg.mp3" -exec rename 's/.ogg.mp3/.mp3/' {} \;
renames the file within the current directory.
The whole should work with directories and file names that include white spaces.
Intended for dynamic ip OpenDNS users, this command will update your OpenDNS network IP.
For getting your IP, you can use one of the many one-liners here on commandlinefu.
Example:
I use this in a script which is run by kppp after it has successfully connected to my ISP:
---
#!/bin/bash
IP="`curl -s http://checkip.dyndns.org/ | grep -o '[[:digit:].]\+'`"
PW="hex-obfuscated-pw-here"
if [ "$IP" == "" ] ; then echo 'Not online.' ; exit 1
else
wget -q --user=topsecret --password="`echo $PW | xxd -ps -r`" 'https://updates.opendns.com/nic/update?hostname=myhostname&myip='"$IP" -O -
/etc/init.d/ntp-client restart &
fi
---
PS: DynDNS should use a similar method, if you know the URL, please post a comment. (Something with members.dyndns.org, if I recall correctly)
usage examples
ls largedir |rd
lynx -dump largewebsite.com |rd
rd < largelogfile
Command binds a set of commands to the F12 key.
Feel free to alter the dashboard according to your own needs.
How to find the key codes?
Type
$ read
Then press the desired key (example: F5)
$ ^[[15~
Try
$ bind '"\e[15~"':"\"ssh su@ip-address\C-m"""
or
$ bind '"\e[16~"':"\"apachectl -k restart\C-m"""