Skip to content

Instantly share code, notes, and snippets.

@begin29
Last active August 25, 2017 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save begin29/fd5a7fded1732629e1e761ba8c00c431 to your computer and use it in GitHub Desktop.
Save begin29/fd5a7fded1732629e1e761ba8c00c431 to your computer and use it in GitHub Desktop.
Linux commands and articles
#create link
ln -s /path/to/file /path/to/symlink
#see all available memory
df -h
#returns the number of lines, words, and bytes in a file. Can use -l, -w, -c to get just one of these.
wc
# change user password
sudo passwd USERNAME
#see mysql version
dpkg -l 'mysql-server*'
# see ubuntu version
lsb_release -a
# make custom script run on boot system
https://debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian
# Schedule Tasks on Linux Using Crontab
http://kvz.io/blog/2007/07/29/schedule-tasks-on-linux-using-crontab/
#how to execute script on click
http://askubuntu.com/questions/138908/how-to-execute-a-script-just-by-double-clicking-like-exe-files-in-windows
# suspend after 5 sec via sudo user with password
sleep 5 && echo 'user password' | sudo -S pm-suspend
# increase brightness in a bit
xrandr --output LVDS1 --brightness 1.05
#make bootable iso disk
sudo dd if=/home/path/to/iso of=/dev/sdb* bs=1M
# disable display
xrandr --output LVDS1 --off
# enable
xrandr --output LVDS1 --on
# set primary
xrandr --output HDMI3 --primary
# choose output side
xrandr --output LVDS1 -o left
# set input order for mouse with id 12
# check input ids:
# $ xinput list
xinput set-button-map 12 3 2 1
# restart network manager. when can't find wifi network
sudo service network-manager restart
#see all usb devices
sudo fdisk -l
sudo parted -l
lsblk
# formt to fat32 flash drive sdb
# -I override all partitions on usb drive
sudo mkfs.vfat -I /dev/sdb
mkdosfs -F 32 -I /dev/sdc1
#mount usb drive to /media/usb/
sudo mount /dev/sdb /media/usb
#mount with permition
sudo mount /dev/sdb /mnt/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment