Skip to content

Instantly share code, notes, and snippets.

@azureru
Last active July 2, 2019 10:58
Show Gist options
  • Save azureru/7766603 to your computer and use it in GitHub Desktop.
Save azureru/7766603 to your computer and use it in GitHub Desktop.
Devops Cheat Sheet

Permission Cheat Sheet

You will use this one a lot in Wordpress :P

   chown -R www-data:www-data ./
   // set the proper owner
   find . -type f -exec chmod 644 {} \+
   // Recursively set FILE permissions.
   find . -type d -exec chmod 755 {} \+
   // Recursively set DIRECTORY permission

Some Devops Cheat Sheet

Change the $VAR sign with the appropriate variables

  ps auxww -H
  // to check running process and show hierarchies (child-parent)
  pgrep -fl php
  // PHP related processes
  strace -f -p $PID
  // What is the process doing
  lsof -p $PID
  // What files the process open?
  kill xxxx
  kill xxxx yyyy zzzz
  pkill <name of process>
  pkill -f <word in process name>
  // many ways to Kill
  watch 'ps aux | grep ruby'
  // Keep an eye of a process
  free -m
  cat /proc/meminfo
  // Check for Free memory
  vmstat 1
  // Are we swapping?
  ps aux --sort=-resident|head -11
  // Check for memory hoggers (one who leak?)
  lsof -nPi tcp
  // TCP in use
  ip addr
  ifconfig
  // IP
  host 192.1.1.1
  host myrouter
  // Host -> IP resolution
  curl -LI http://google.com
  // Curl header (and follow redirect)
  tcptraceroute google.com
  // Traceroute using TCP (install it if it's not exists)
  iptables -L
  // List all blocking rules
  netstat -tlnp 
  // Show all listeners (servers)
   wget cachefly.cachefly.net/100mb.test -O /dev/null
   // Speedtest (Do not run in production!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment