Troubleshooting
No. | problem | solution |
---|---|---|
1 | missing tray icon when closing skype | sudo apt-get install sni-qt:i386 |
2 | fix dependencies | sudo apt-get install -f |
3 | lookup all files | grep -r “regular expression” * |
4 | CANNOT change pwd [recovery mode] | mount -rw -o remount / |
5 | Create boot USB in linux | sudo apt-get install unetbootin |
6 | Mount read-only dev | mount -t ntfs-3g /dev/sda2 /mnt/ -ro force |
7 | Cannot resolve DNS | cat /etc/resolv.conf |
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) | ||
# DO NOT EDIT THIS FILE BY HAND – YOUR CHANGES WILL BE OVERWRIT | ||
solution 1 | /etc/network/interfaces | |
solution 1 | # Add Google DNS && reboot && the servername appears in /etc/resolv.conf | |
solution 1 | dns-nameservers 8.8.8.8 | |
solution 2 | /etc/resolvconf/resolv.conf.d/base | |
solution 2 | # Add DNS | |
solution 2 | nameserver 8.8.8.8 | |
solution 2 | nameserver 8.8.4.4 | |
solution 2 | resolvconf -u | |
CentOS | /etc/resolv.conf | |
CentOS | nameserver 8.8.8.8 & nameserver 8.8.4.4 & nameserver 114.114.114.114 | |
8 | Docker: FATA[0000] | sudo service docker restart |
9 | set up ~/bin | vim /etc/environment |
10 | update core with cmd | sudo apt-get dist-upgrade |
11 | check system info | uname -a && cat /etc/lsb-release |
12 | ubuntu mp3 plugin | sudo apt-get install ubuntu-restricted-extras |
13 | Step 1: format USB | sudo umount /media/[name]/dev |
Step 2: format USB | lsblk && sudo fdisk -l | |
Step 3: format USB erase | sudo dd if=/dev/zero of=/dev/sdb bs=4k && sync | |
Step 4: format USB | sudo mkfs.ext4 /dev/sd[x] | |
Step 4: format USB | sudo eject /dev/sd[x] | |
14 | Ubuntu nameserver 1 | sudo vim /etc/resolvconf/resolv.conf.d/base |
Ubuntu nameserver 2 | nameserver 114.114.114.114 | |
Ubuntu nameserver 3 | sudo service resolvconf restart |
Problem 9: Docker: FATA[0000] Get http:///var/run/docker.sock/v1.18/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
Command
sudo command without pwd
sudo cat /etc/sudoers
# add lines in the end of the file
ray ALL=(ALL) NOPASSWD: ALL
%sudo ALL=(ALL) NOPASSWD: ALL
# ray is a user
# %sudo refers to a group
check system status
# memory
svmon -G
# cpu
topas
# ip route
traceroute xxxxx.cn.dst.com
adduser
sudo adduser ray
sudo groupadd -g 1002 www-owner
sudo usermod -g www-owner ray
chgrp -R www-owner *
Update sources
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
sudo gedit /etc/apt/sources.list
Hash Sum mismatch
sudo rm -fr /var/lib/apt/lists/*
sudo mkdir /var/lib/apt/lists/partial
sudo apt-get clean
sudo apt-get update --fix-missing
grep -NUM => print NUM lines of leading and tailling context
grep -5 -r "xdebug.remote_port" /etc/php5/
fallback theme
sudo apt-get install gnome-session-flashback
proxy
hkce01.hk.ibm.com 80
SSH
Download ssh client
sudo apt-get install openssh-client
ssh-keygen -t rsa
Docker
Install docker
apt-get install docker.io
启动服务和守护进程
service docker.io status
service docker.io start
创建软连接
ln -sf /usr/bin/docker.io /usr/local/bin/docker
import docker
cat ubuntu14.tar | sudo docker import - ray/ubuntu14
sudo docker images
run docker container
docker run -d --dns 8.8.8.8 --dns 8.8.4.4 -p 80:80 -p 9200:9200 -p 50000:50000 -v /home/ray/www:/home/ray/www --name=ibmsc -h SC ray/ubuntu14 /bin/bash -c "while true;do sleep 1000; done"
start a docker container
sudo docker start ibmsc
login-docker.sh ibmsc
export docker image
sudo docker ps -a
sudo docker export 7691a814370e > ubuntu14.tar
remove docker images
docker stop $(docker ps -a -q)
sudo docker rmi -f 87bce9b2c54c
reomve all container
docker rm $(docker ps -a -q)
remove a image
docker rmi <image id>
remove all images
docker rmi $(docker images -q)
setup Docker ubuntu apache2
# 1. DocumentRoot
cd /etc/apache2/sites-enabled/
vim 000-default
--1. DocumentRoot /home/ray/www
--2. <Directory /home/ray/www>
# 2. setup localhost & port
vim /etc/apache2/ports.conf
--1. ServerName 127.0.0.1
--2. Listen 80
Change apache runner
/etc/apache2/envvars
envvars:export APACHE_RUN_GROUP=www-data
php
install php
apt-get install php5
check an attribute. grep -NUM => print NUM lines of leading and tailling context
grep -5 -r "xdebug.remote_port" /etc/php5/
file: /etc/php5/mods-available/xdebug.ini
/etc/php5/mods-available/xdebug.ini-zend_extension=xdebug.so
/etc/php5/mods-available/xdebug.ini-[Xdebug]
/etc/php5/mods-available/xdebug.ini-xdebug.remote_enable = On
/etc/php5/mods-available/xdebug.ini-xdebug.idekey = "phpstorm-key"
/etc/php5/mods-available/xdebug.ini-xdebug.remote_autostart = 1
/etc/php5/mods-available/xdebug.ini-xdebug.remote_connect_back = 1
/etc/php5/mods-available/xdebug.ini-xdebug.remote_handler=dbgp
/etc/php5/mods-available/xdebug.ini:xdebug.remote_port=9001
/etc/php5/mods-available/xdebug.ini-xdebug.var_display_max_children=128
/etc/php5/mods-available/xdebug.ini-xdebug.var_display_max_data=512
/etc/php5/mods-available/xdebug.ini-xdebug.var_display_max_depth=5