FANDOM


check ubuntu version Edit

root@cory:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04 LTS
Release:	14.04
Codename:	trusty

add appdev user Edit

root@cory:~# useradd -m appdev
root@cory:~# useradd -m -d /home/appdev appdev
root@cory:~# passwd appdev
su appdev
  • sudo with no passwd
shell> su 
shell> chmod +w /etc/sudoers
shell> echo '${username} ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
shell> chmod -w /etc/sudoers
shell> exit

stop default apache2 Edit

 root@cory:~# /etc/init.d/apache2 stop  
 * Stopping web server apache2

fix /etc/sudoers error Edit

  • I change /etc/sudoers file cause some error like:
 >>> /etc/sudoers: syntax error near line 30 <<<
  • for fix , run as root , then fix the /etc/sudoers file
>pkexec su
>vi /etc/sudoers file

add alias for root Edit

  • check current user alias
 yufei@yufeidesktop:~$ alias
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\)"'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'
  • pkexec su - change to root
pkexec su
vi /root/.bashrc

you can find follow line

if [ -f ~/.bash_aliases ]; then
   . ~/.bash_aliases
fi
  • create .bash_aliases , add the alias content to it.

install .deb package Edit

  • To install a downloaded Debian (Ubuntu) package
sudo dpkg -i packagename.deb
  • To remove a Debian (Ubuntu) package (.deb)
sudo dpkg -r packagename
  • To Reconfigure/Repair an installed Debian (Ubuntu) package
sudo dpkg-reconfigure packagename

apt-get Edit

sudo apt-get install -f libavahi-compat-libdnssd1
sudo dpkg -i synergy-v1.7.4-stable-c734bab-Linux-x86_64.deb