Skip to content

Instantly share code, notes, and snippets.

@jawardell
jawardell / useful_cmds.sh
Created January 24, 2019 23:38
bash commands
#recursively format print all files using awk
ls -R | awk ' /:$/&&f{s=$0;f=0} /:$/&&!f{sub(/:$/,"");s=$0;f=1;next} NF&&f{ print s"/"$0 }'
#recursively show the size of files in MegaBytes
ls -Rl --block-size=M
#list files recursively along with their size in bytes
find . -type f -exec du -ab {} + | sort -n -r | less
@jawardell
jawardell / .bash_profile
Last active January 29, 2019 03:33
rc files
source ~/.rvm/scripts/rvm
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
alias ls="ls -Flarp | more"
fortune
@jawardell
jawardell / Driver3.java
Last active August 27, 2017 22:31
Threading Exercises
/*
*Write code to implement a
*Producer-Consumer model which
*utilizes the Guarded Block
*paradigm.
*/
import java.util.concurrent.*;
public class Driver3 {
public static DropBox dropbox = new DropBox();
public static void main(String[] args) {