Tuesday, April 16, 2013

Generate some files in folders for testing using bash.

I wanted a small test data set consisting of some files in folders, heres a quick shell snippet to generate some:

for dir in {1..100}; do
for dir2 in {a..f}; do
folder=dir-${dir}/dir-${dir2}; mkdir -p ${folder}
echo "A file with some text" > $folder/`pwgen -A10`.txt

Every time you run it you get more files, but the folders remain the same. It needs bash 3 or greater to run and creates folder like:


Tuesday, April 02, 2013

Kerberos Tickets and VNC utilities on a Mac

A Mac ships with two useful utilities which are hidden away by default. The first it Ticket View which allows you to see the kerberos tickets you currently have and the second is Screen Sharing, which is a VNC client. I find it useful to create an alias to these two programs in the Applications/Utilities folder so that spotlight will index them and make them easy to launch. By default the applications are installed in:


In finder you can go here in Finder by pressing ⇧⌘G and pasting in the path. The drag the programs to:


Not you can easily find these programs and open them from spotlight.