Here are some commands that will be useful after you start a fresh install of Debian
Time/date
$ timedatectl list-timezones | grep Moscow
Europe/Moscow
$ timedatectl set-timezone Europe/Moscow
Russian keyboard
dpkg-reconfigure keyboard-configuration
service keyboard-setup restart
Fonts
To make default fonts more pretty, like in Ubuntu:
mkdir -p $HOME/.config/fontconfig/
gedit $HOME/.config/fontconfig/fonts.conf
And save the file with the following contents:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hintstyle">
<const>hintslight</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="lcdfilter">
<const>lcddefault</const>
</edit>
</match>
</fontconfig>
Now log out and in again.
sudo
su
apt-get update
apt-get install sudo
usermod -a -G sudo <user_name>
# here you may need a logoff-login
curl
sudo apt install -y curl
Proxy
Add to .bashrc:
export http_proxy=http://192.168.2.102:3128
export https_proxy=http://192.168.2.102:3128
Chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i google-chrome-stable_current_amd64.deb
Keepass2
sudo apt install -y keepass2
```shell
# Dropbox
Use your favourite text editor and edit /etc/apt/sources.list by adding non-free after main on each line. For example:
FROM: deb http://ftp.au.debian.org/debian/ stretch main TO: deb http://ftp.au.debian.org/debian/ stretch main non-free
Once ready, run:
```shell
apt update
apt install nautilus-dropbox
dropbox start -i
dropbox proxy manual 192.168.2.102 3128
git
sudo apt install -y git
git config --global http.proxy http://192.168.2.102:3128
git config --global user.name yuriy.timofeev
git config --global user.email yuriy.timofeev@vocord.ru
git config --global url."https://".insteadOf git://
Add SSH keys to git
ssh-keygen -t rsa -C "your.email@example.com" -b 4096
sudo apt install -y xclip
xclip -sel clip < ~/.ssh/id_rsa.pub
zsh
sudo apt install -y zsh
chsh -s $(which zsh)
# log out, log in
Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
If you are behind a corporate proxy, use:
sh -c "$(curl --proxy http://192.168.2.102:3128 -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sudo apt-get install -y fonts-powerline
tmux
sudo apt install -y tmux
VS Code
wget https://vscode-update.azurewebsites.net/latest/linux-deb-x64/stable -O /tmp/code_latest_amd64.deb && sudo dpkg -i /tmp/code_latest_amd64.deb
Docker
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce
Proxy
Next we may need to set the proxy.
First, create a systemd drop-in directory for the docker service:
mkdir /etc/systemd/system/docker.service.d
Now create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"
Flush changes and restart docker:
systemctl daemon-reload
systemctl restart docker
Give sudo rights to docker
sudo groupadd docker
sudo usermod -aG docker $USER
# then you may have to completely restart your system
Add custom corporate registry
sudo cat > /etc/docker/daemon.json
{ "insecure-registries":["gitlab.factory.vocord.ru:5000"] }
sudo service docker restart
Docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Sublime text
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
Autojump
git clone git://github.com/wting/autojump.git
cd autojump
./install.py
Desktop shortcuts
If you want to add a shortcut for e.g. Telegram, create ~/Desktop/Telegram.desktop
with the following contents:
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/usr/bin/telegram
Name=Telegram
Comment=Telegram
Fira Code
sudo vi /etc/apt/sources.list
Change lines ending with main
to ending with main contrib non-free
.
Example content:
deb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main contrib non-free
deb http://deb.debian.org/debian-security/ stretch/updates main contrib non-free
deb-src http://deb.debian.org/debian-security/ stretch/updates main contrib non-free
deb http://deb.debian.org/debian stretch-updates main contrib non-free
deb-src http://deb.debian.org/debian stretch-updates main contrib non-free
After that you can install Fira Code:
sudo apt update
sudo apt install -y fonts-firacode
Setup Vs Code
Press Ctrl+`, change following properties:
"editor.fontFamily": "'Fira Code'",
"editor.fontLigatures": true,
Restart VS Code.
sudo apt install -y mailutils ssmtp
sudo vi /etc/ssmtp/ssmtp.conf
ssmt.conf contents example:
mailhub=smtp-relay.gmail.com:587
AuthUser=yuriy.timofeev@mail.ru
AuthPass=YOUR_PASSWORD
UseTLS=YES
UseSTARTTLS=YES
FromLineOverride=YES
After that you can send email like this:
echo "LETTER_BODY" | mail -s "LETTER_SUBJ" -a "From: Юрий Тимофеев<yuriy.timofeev@mail.ru>" some.recipient@mail.ru