Desktop Settings - andreydiveev/wiki GitHub Wiki
Screenshot:
sudo apt install deepin-screenshot
Drivers:
sudo ubuntu-drivers devices
Remove ppa:
# sudo add-apt-repository --remove ppa:whatever/ppa
Sudo:
su - www-data -s /bin/bash -c "echo test > /var/www/current/runtime/logs/app.log"
Include file to rc.local:
# add to /etc/rc.local before `exit 0`
. /path/to/custom/rc.local
Show incoming connections:
# pktstat -n
Show dd progress (e.g. 2GB file):
# dd if=source.img | pv -s 2G | dd of=target.img
Show Debain version:
# cat /etc/debian_version
Copy disk data to another host
# nc -l 1234 | dd of=/dev/<vgname>/<lvname>
# dd if=/dev/<vgname>/<lvname> | nc <targetip> 1234
Reset (MAC)
# rm /etc/udev/rules.d/70-persistent-net.rules
Show services on port:
$ grep 110 /etc/services
Logout other user from terminal:
$ who
$ sudo pkill -KILL -u <username>
Autostart. List of services
$ ls /etc/rc*.d
Autostart. Disable service (e.g. mysql)
$ sudo update-rc.d mysql disable
Autostart. Enable service (e.g. mysql)
$ sudo update-rc.d mysql enable
Show brige interfaces
$ brctl show
Download file from browser console
var links='';links=123;uriContent = "data:application/octet-stream;filename=filename.txt," + encodeURIComponent(links);newWindow=window.open(uriContent, 'filename.txt');
Include jQuery in browser console
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type (or see below for non wait option)
jQuery.noConflict();
Fuse
$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
$ sudo apt-get install -y nodejs
$ npm install -g bower
$ npm install -g gulp-cli
$ npm install -g gulp
$ cd Fuse-1.4.4-demo
$ npm install
$ bower install
$ gulp build
$ gulp serve
Composer (one command install)
$ curl https://gist.githubusercontent.com/kotchuprik/42e6115b2d1a0e584bbbc4d5ff3124bf/raw/01777a1b152c76d3acac5a26ca420b3c527de21f/install-composer.sh | bash
Bower
$ npm install -g bower
Node.js
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt-get install -y nodejs
GeoIP
# apt-get install geoip-bin
# geoiplookup 27.145.177.75
Set timezone
# dpkg-reconfigure tzdata
Show all services
# service --status-all
Dig. IP shortcut
# dig ya.ru +short
List block devices
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
vda 254:0 0 20G 0 disk
├─vda1 254:1 0 19.1G 0 part /
├─vda2 254:2 0 1K 0 part
└─vda5 254:5 0 880M 0 part [SWAP]
Partitioning
# parted /dev/mmcblk0
(parted) unit MiB
(parted) mkpart primary ext4 794 14803
(parted) print
Model: SD SD16G (sd/mmc)
Disk /dev/mmcblk0: 14804MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 0.01MiB 61.1MiB 61.1MiB primary fat16
2 61.1MiB 794MiB 733MiB primary ext4
3 794MiB 14803MiB 14009MiB primary
(parted) rm 3
/etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 100.100.100.101/29
gateway 100.100.100.100
dns-nameservers 100.100.100.102 100.100.100.103 100.100.100.104
iptables list all:
# iptables -vnL
Create archive:
# tar -zcvf dirname.tar.gz dirname/
Extract archive:
# tar -zxvf dirname.tar.gz
Print all evn vars:
# printenv
Locales:
# dpkg-reconfigure -plow locales
# locales-gen
Java
# sudo apt-get install default-jre
# sudo apt-get install default-jdk
If necessary
# sudo apt-get install openjdk-7-jre
# sudo apt-get install openjdk-7-jre
Numlock
sudo apt-get install numlockx
sudo gedit /etc/lightdm/lightdm.conf
Paste to bottom
greeter-setup-script=/usr/bin/numlockx on
VMware EasyInstaller
http://stackoverflow.com/questions/10740243/ubuntu-intallation-is-stuck-at-vmware-tools-installation
sudo mv /etc/issue.backup /etc/issue
sudo mv /etc/rc.local.backup /etc/rc.local
sudo mv /opt/vmware-tools-installer/lightdm.conf /etc/init
VMware 1920x1080 Resolution
xrandr --newmode "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 1920x1080
xrandr --output Virtual1 --mode 1920x1080
Allow SSH
sudo apt-get install openssh-server
sudo ufw allow 22
Bulk Rename
GPRename