$ su # aceess to root
$ apt-get install sudo
$ adduser <username> sudo
$ reboot # or logout
Ref:
$ sudo vi /etc/apt/sources.list
# edit all 'squeeze' that's version codename
# to 'sid' that's unstable codename
# ex. deb http://ftp.us.debian.org/debian squeeze main
# to deb http://ftp.us.debian.org/debian sid main
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo reboot
$ sudo vim /etc/apt/sources.list
# add "deb http://http.debian.net/debian testing main"
$ sudo apt-get update
$ sudo apt-get install <your package>
# don't call sudo apt-get upgrade if your don't want to upgrade your all system to lastest packages
$ lsb_release -a #check debian version
$ uname -a #check linux version
$ su - <user>
# choose set your region to your local frist
$ sudo apt-get install netselect-apt
$ sudo netselect-apt
# install
$ sudo apt-get update
$ sudo apt-get install openssh-server
# control ssh-server
$ sudo service ssh stop
$ sudo service ssh start
$ sudo service ssh restart
$ sudo service ssh status
# In your ssh server
$ echo "source your .bashrc" >> .bash_profile
# or you can try this [[ -f ~/.bashrc ]] && . ~/.bashrc
$ xrandr --output VGA-1 --auto --primary --output DVI-I-1 --auto --left-of VGA-1
# debian
$ sudo apt-get install locales
$ sudo dpkg-reconfigure locales
$ sudo apt-get remove --purge <packagename> # --purge delete all data and config
$ sudo apt-get autoremove --purge
$ sudo apt-get clean
$ locate <packagename> # manual delete
Ctrl + H
Ctrl+Shift+V
- paste
Ctrl+Shift+C
- copy
$ sudo apt-get install exfat-fuse exfat-utils
Vagrant is a tool for managing virtual machines.
Docker is a tool for building and deploying applications by packaging them into lightweight containers.
bypass.conf
server {
listen 80;
location / {
proxy_pass http://127.0.0.1:8000;
}
}
# debian
$ sudo apt-get install nginx
$ sudo vim /etc/nginx/sites-available/<your>.conf
$ sudo rm /etc/ngin/sites-enabled/default.conf
$ suo ln -f /etc/nginx/sites-available/<your>.conf /etc/sites-enabled/
$ sudo services nginx reload
# debain
$ cd /usr/share/nginx/html
$ ln -s <path> <link_name>
edit your nginx.conf
location /<url> {
alias /usr/share/nginx/html/<link_name>
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
auth_basic "Restricted"; #For Basic Auth
auth_basic_user_file <your .htpasswd>; #For Basic Auth
}
Michael Crichton said, “Great books aren’t written– they’re rewritten.”
Because there is differenced end of line in dos and unix.
# open file that error in vim
:set noendofline binary
:wq
# set where is global gitignore file
$ git config --global core.excludesfile ~/.gitignore_global
# write some ignore file in global gitignore
$ echo "tags" >> ~/.gitignore_global
git stash
git stash pop
git revert
git config --global alias.tree "log --graph --decorate --oneline --abbrev-commit"
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
$ git tag -a <tag name> <commit id> -m “desc"
$ git push origin —tags
$ git pull --tags
Should keep database.php.example and config.php.example in the repo. Then add config.php and database.php to the .gitignore file.
git pull
: A better workflowThe intended workflow is:
Create a private branch off a public branch.
Regularly commit your work to this private branch.
Once your code is perfect, clean up its history.
Merge the cleaned-up branch back into the public branch.