- Published:
- February 23, 2010 – 5:41 pm
- Author:
- By Dave
My professor sent us this little one liner (ok, I had to format it to 2 lines to fit in this blog. You know what I mean) which prints out the current directory tree:
ls -R | grep “:$” | sed -e ’s/:$//’ -e ’s/[^-][^\/]*\//–/g’ \
-e ’s/^/ /’ -e ’s/-/|/’
What’s going on here?
Categories: Code Samples, Shell
Tagged: bash, sed
- Published:
- February 13, 2010 – 1:12 pm
- Author:
- By Dave
The Bash command environment, which is the namesake of this blog, is very flexible in that it allows you to manipulate the filesystem in many ways. Awk and sed are very powerful tools that allow you to do this rename with a simple one line command. This post will walk you through doing this with [...]
Categories: Code Samples, Linux, Shell, System Administration
Tagged: awk, bash, csv
- Published:
- January 31, 2010 – 9:53 pm
- Author:
- By Dave
It is very easy to create a random file using the linux command line. Much like the command to fill a file with all zeros, for example a 1 Meg file:
dd if=/dev/zero of=zero.filename bs=1024 count=1000
You do the same using /dev/urandom:
dd if=/dev/urandom of=random.filename bs=1024 count=1000
Resulting in a 1MB file:
1000+0 records in
1000+0 records out
1024000 bytes (1.0 MB) [...]
Categories: Code Samples, Linux, Security, Shell
Tagged: command line, Linux, tips
- Published:
- September 29, 2009 – 5:00 pm
- Author:
- By Dave
I was recently tasked with copying speaker’s presentations, files and handouts onto 100s of USB Drives (key drives) for a conference that work is hosting down in Washington, D.C. My first thought was that it was going to be a pain to have to copy/paste the files to each drive. I thought about creating a [...]
Categories: Hardware, Other Code, Programs
Tagged: conference, key drive, tips, tricks, usb drive, usb key drive
- Published:
- August 5, 2009 – 9:16 pm
- Author:
- By Dave
You’ve flashed your old WRT54G or other vanilla router with the Tomato firmware. This itself turns your router into a lean, mean routing machine with QOS, SSH and more, but let’s say we want to take it a bit further. What it we want to get some more stats out of it?
In order to do [...]
Categories: Code Samples, Configurations, Hardware, Linux, Other Code, Programs, Shell, Software, System Administration, Tech
Tagged: cacti, firmware, network, router, SNMP, sysadmin