Skip to content

Instantly share code, notes, and snippets.

@pocheptsov
Last active November 3, 2016 21:01
Show Gist options
  • Select an option

  • Save pocheptsov/29ca1d5d7b5d1fda322e86052a7f846c to your computer and use it in GitHub Desktop.

Select an option

Save pocheptsov/29ca1d5d7b5d1fda322e86052a7f846c to your computer and use it in GitHub Desktop.
Different DevOps commands
# find apache config file location
apache2 -V | grep 'HTTPD_ROOT\|SERVER_CONFIG_FILE'
# list top level global npm packages
npm -g ls --depth=0
# remove long path folder
rmdir node_modules /s /q
# windows: switch cmdline to run as Admin
runas /user:Administrator cmd
# attach to running docker instance and allow to disconnect by CTRL+C without interrupting
docker attach --sig-proxy=false [image-id]
# collect branch from different commits
git checkout feature-branch
git log --oneline --author="slava pocheptsov" --format='pick %h %s' --reverse from..to > commits.txt
git checkout master
git checkout master -b clean-feature-branch
git rebase --interactive HEAD
# Simple static http server
python -m SimpleHTTPServer
# type text in active program
xdotool type --window '$(xdotool getactivewindow)' --clearmodifiers -delay 0 some_text
# find local gem and reverse dependency
gem dep 'gemname' -R -l
# list top 10 directory by space
sudo du -Sh / | sort -hr | head -n10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment