Archive for 'General' Category
LinuxCommand.org: Learn the Linux command line. Write shell scripts.
http://linuxcommand.org/index.php
Okean Sino-Korea and DShield Top 20 Blocklist for Rocky Arno’s IPtables blockhosts file
#!/bin/sh # script created from technese.com # Download Okean Sino-Korea Block IP list rm -f /tmp/cnkr_htaccess.txt rm -f /tmp/top10-2.txt wget http://www.okean.com/antispam/cnkr_htaccess.txt -P /tmp file=/tmp/cnkr_htaccess.txt file2=/tmp/top10-2.txt tempfile=/etc/arno-iptables-firewall/blocked-hosts # Remove first and last lines, and “deny from ” text echo ‘#Okean Sino-Korea Block IP list:’ `date`” > $tempfile sed -e ‘1d’ -e ‘s/deny from //’ -e ‘$d’ […]
Bash script to create a .m3u from a directory
#!/bin/bash dir=`echo ${PWD##*/}` echo “Create a .m3u playlist for $dir …” ls *.mp3 -1 >> “$dir.m3u” ls *.mp4 -1 >> “$dir.m3u” ls *.m4v -1 >> “$dir.m3u” echo “Found these media files:” cat “$dir.m3u”
iPhone, iPod, iPad and Firmware Download Links
http://www.felixbruns.de/iPod/firmware http://www.iclarified.com/entry/index.php?enid=750
Basename or extract of current working directory – Linux command output
Four examples: $ basename `pwd` $ pwd | awk -F/ ‘{print $NF}’ $ pwd | sed ‘s#.*/##’ $ echo “${PWD##*/}” Reference: http://stackoverflow.com/questions/1744595/extract-the-last-directory-of-a-pwd-output http://tldp.org/LDP/abs/html/parameter-substitution.html
html index page of tree view of directory
-H : turn on html baseHREF : gives the base ftp location when using HTML output. -o : output filename $ tree -H baseHREF -o index.htm create index.htm of current directory and output filename as index.htm $ tree -H . -o index.htm
wget download specific filetype from URL
-U , user-agent-r , recursive-l1 -one level-A , filetype $ wget -U Firefox -r -l1 -nd -e robots=off -A filetype http://domain.index.html e.g. $ wget -U Firefox -r -l1 -nd -e robots=off -A .txt http://technese.com/index.html multiple filetypes $ wget -U Firefox -r -l1 -nd -e robots=off -A filetype1,filetype2 http://domain.index.html] e.g. $ wget -U Firefox -r -l1 […]
FreeBSD – systat network statistics
using systat command with ifstat at 1 second intervals $ systat -ifstat 1
Hello world, this is technese.com!
All things technical!