Skip to content

Instantly share code, notes, and snippets.

@sitaramc
sitaramc / randomise.sh
Last active February 18, 2017 07:27
randomise filenames / reverse the randomisation
#!/bin/bash
# Usage:
# $0 # renames all mp3 files in $PWD by prefixing a random sequence number and a hyphen
# $0 clean # renames all mp3 files in $PWD by removing any leading digits and a hyphen
ext=mp3
# making this a parameter is left as an exercise for the reader
if [ "$1" = "clean" ]
@sitaramc
sitaramc / gist:4535340
Created January 15, 2013 01:48
using a normal update hook as a VREF
This is a brand new id; nothing in it yet. We first install gitolite. I get
gitolite from a local copy for speed; you might use github.
$ ls -al
total 20
drwx------ 2 sam sam 4096 Jan 15 06:57 .
drwxr-xr-x. 14 root root 4096 Nov 29 12:30 ..
-rw-r--r-- 1 sam sam 18 Jan 15 06:57 .bash_logout
-rw-r--r-- 1 sam sam 193 Jan 15 06:57 .bash_profile