Skip to content

Instantly share code, notes, and snippets.

@Telematica
Last active October 17, 2017 22:39
Show Gist options
  • Save Telematica/71e0cd2fd66310531626 to your computer and use it in GitHub Desktop.
Save Telematica/71e0cd2fd66310531626 to your computer and use it in GitHub Desktop.
Handy Commands and Utilities for Linux
# ===========================================
#tested on Ubuntu 14.04
sudo dmidecode | grep Maximum
#Output:
# Maximum Size: 32 kB
# Maximum Size: 1024 kB
# Maximum Size: 8192 kB
# Maximum Capacity: 16 GB
# ===========================================
sudo dmidecode --type 17
# Speed: 1334 MHz
#Personal Gateway Laptop
#Model : ID59C02m
#RAM : 4 GB DDR3 Memory
#Webcam : 1.3 MP webcam
#Core : Intel Core i7-640M
#Video : Intel HD Graphics
#Storage : 640 GB HDD
#Screen : 15.6" 16:9 HD LED LCD
#DVD-Super Multi DL drive
#Maximum Capacity: 16 GB
#RAM Speed: 1334 MHz
# ===========================================
# Search a string or pattern within files on a directory
#http://stackoverflow.com/questions/16956810/finding-all-files-containing-a-text-string-on-linux
grep -rnw '/path/to/somewhere/' -e "pattern"
# ===========================================
# Open a new Google Chrome Window
google-chrome --new-window www.google.com
google-chrome --new-tab www.google.com
# ===========================================
#Add alias to ~/.bashrc file to make alias permanent
alias diffx='svn diff --diff-cmd="meld"'
# ===========================================
#sudo apt-get install xbacklight
#http://askubuntu.com/questions/149054/how-to-change-lcd-brightness-from-command-line-or-via-script#answer-149265
xbacklight -set 50
xbacklight -inc 10
xbacklight -dec 10
# ===========================================
#????
sudo -s
dhclient -r
dhclient
ifconfig
# ===========================================
#Manually turn off monitor
#http://askubuntu.com/questions/253818/manually-turn-off-monitor
xset dpms force off
xset dpms force on
# ===========================================
#http://stackoverflow.com/questions/16449473/linux-mysql-writing-mysql-table-output-to-a-file-and-keeping-mysql-formatting#answer-33043077
mysql database_name -t -e "SELECT * FROM table_name" > ~/tablename.txt
# ===========================================
#E: dpkg was interrupted, you must manually run
#'sudo dpkg --configure -a' to correct the problem.
sudo dpkg-reconfigure mysql-server-5.1
#Add this instead of putting the aliases directly in .bashrc.
if [ -f ~/.bash_aliases ]
then
. ~/.bash_aliases
fi
# ===========================================
#https://stackoverflow.com/questions/32358966/grunt-message-fatal-error-port-35729-is-already-in-use-by-another-process
#Dont stop a process with Ctrl+C in the terminal.
#Ctrl+Z will keep it running.
#Find the process id by
sudo lsof -i :35729
#Then kill the process by
sudo kill -9 PID
#Rerun the
grunt watch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment