Skip to content

Instantly share code, notes, and snippets.

@keshavab
Last active August 29, 2015 14:01
Show Gist options
  • Save keshavab/9732278cfc22a424bd87 to your computer and use it in GitHub Desktop.
Save keshavab/9732278cfc22a424bd87 to your computer and use it in GitHub Desktop.
Cookbook
# delete given files and found files
find . -name '*.pyc' -print0 | xargs -0 rm
# List of files in a commit
git diff-tree --no-commit-id --name-only -r bd61ad98
# Mount a windows cifs mount on ubuntu
sudo apt-get install cifs-utils
sudo mount.cifs //10.1.192.14/lab/COS_Share lab-cosshare -o user=<username>
# If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=<remote>/<branch> <branch-name>
# get a file from a specific revision
git show <treeish>:<filename>
# find a pattern recursively in a directory
grep -Ril '<string/pattern>'
# create a loopback device
sudo mkdir /srv
sudo truncate -s 1GB /srv/swift-disk
sudo mkfs.xfs /srv/swift-disk
/srv/swift-disk /mnt/sdb1 xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment