Skip to content

Instantly share code, notes, and snippets.

@r-pufky
r-pufky / gist:7e91540f141ece88f6505b15416d4445
Created July 13, 2018 19:32
Convert all audio files found into 320k CBS 48k stereo mp3's
find . -type f -exec ffmpeg -i {} -y -vn -ab 320k -ac 2 -ar 48000 {}.mp3 \;
@r-pufky
r-pufky / gist:dd15f6a4db2ec1443ae634d1e27493d3
Created June 23, 2018 19:25
Get directory paths from a file listing (e.g. from find or file containing a list of paths)
sed 's|\(.*\)/.*|\1|'
@r-pufky
r-pufky / gist:22a19979764d21940fa2b86adf350fe1
Created June 16, 2018 23:51
find directories with more than one file in them.
find . -type f -printf '%h\n' | sort | uniq -d
@r-pufky
r-pufky / gist:6c1ea3c2c83294c73f0e7bd62a433340
Created June 16, 2018 21:13
Move files in directory to <filename>/file
find . -type f -prune -exec sh -c 'mkdir -p "${0%.*}" && mv "$0" "${0%.*}"' {} \;
@r-pufky
r-pufky / gist:fd6024cda7822310a403f50007089d06
Created June 16, 2018 18:37
Finding files with no current user/group
find / -nouser
find / -nogroup
@r-pufky
r-pufky / gist:d9598f976ea806f050f1bc0fae0665ff
Created June 14, 2018 22:45
Bash history usage for last command
!$ - last word of the previous command that was entered (bash)
!!:$ - equivalent to !$
$_ - last argument of the previously executed command
Example:
$ { echo foo; }
foo
$ echo "$_"
foo
@r-pufky
r-pufky / gist:6eba4ebc06eb0a57166dd8dcf10a0ced
Created June 14, 2018 22:41
Show human-readable and octal permissions for files.
stat '%H %a %n' *
@r-pufky
r-pufky / keybase.md
Last active December 29, 2018 08:10

Keybase proof

I hereby claim:

  • I am r-pufky on github.
  • I am rpufky (https://keybase.io/rpufky) on keybase.
  • I have a public key whose fingerprint is 466E EC2B 6751 6C71 17C8 5CE3 A0BC 35D1 6698 BAB9

To claim this, I am signing this object: