Ubuntu settings

I don’t pretend to publish anything new or fundamental here. I have only started working with Linux, so this post is just my way of keeping notes, in order not to search the web again. If it turns out to be useful for somebody else, I will only be glad. These settings were tested on Ubuntu 16.04.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

#========================== Make Linux use 'Local' time ==========================
timedatectl set-local-rtc 1

#================ Set the grub timeout and the grub default boot entry ===========

sudo gedit /etc/default/grub
sudo update-grub

====================================== Mount NTFS partition in fstab =======================

sudo mkdir /media/d1
sudo mkdir /media/d2
sudo blkid
sudo gedit /etc/fstab
UUID=7020AE1B20ADE874 /media/d1 ntfs-3g permissions,windows_names,locale=en_US.utf8 0 0
UUID=00C0C2ECC0C2E6CE /media/d2 ntfs-3g permissions,windows_names,locale=en_US.utf8 0 0

sudo mount -a

#=================== Simple GUI adjustments ==========================
- Desktop backround solid color
- remove unneccessary icons from the launcher
- keyboard repeat delay
- Nautilus -- Edit -> Preferences -> Views (tab) -> View new folders using = List View
- Nautilus Bookmarks
- Language Support + Regional Formats
- Text Entry Settings
- Shortcuts on desktop
- connect Google calendar
- Time & Date settings -- 24 H
- setup Thunderbird (Dash -- Startup Applications, )
- login to Firefox
- install Gimp
- System settings -- Appearance -- Radiance

============== Minimize Thunderbird on close ==============



============ Laptop goes to sleep with lid closed before login and after logout ===============
sudo gedit /etc/systemd/logind.conf

Search for these lines and make them look like this (possibly by removing # in front or replacing suspend with ignore):


#============================= Disable password prompt in sudo (convenient but not secure -- do not forget to change it back!) ==============================
sudo visudo


sudo nano /etc/polkit-1/localauthority/50-local.d/99-nopassword.pkla

[No password prompt]

#==================== Install Notepadqq ==================

sudo add-apt-repository ppa:notepadqq-team/notepadqq && sudo apt-get update && sudo apt-get install notepadqq

#=================== Disable Unity animation =========================

0. Install Unity Tweak Tool using Ubuntu Software

1. Unity -- Launcher tab:
set Urgent animation to No animation
set Launch animation to No animation

2. Unity > Search > General > Background blur: OFF,

3. Window Manager -- General:
 Desktop magnification = OFF
 Windows animation = OFF

sudo apt-get install compiz compizconfig-settings-manager
Effects -- Animations -- Fading Windows
Accessibility -- untick all of the boxes.
Ubuntu Unity Plugin:
- General -- Backround color = dark not transparent
- Launcher -- Hide Animation -- Slide only.

gsettings set org.gnome.desktop.interface enable-animations false

==================================== Cyrylic in Gedit =============================

gsettings set org.gnome.gedit.preferences.encodings candidate-encodings "['UTF-8', 'WINDOWS-1251', 'KOI8-R', 'CURRENT', 'ISO-8859-15', 'UTF-16']"

====================================== Disable avahi notification =========================
sudo gedit /etc/default/avahi-daemon

=========================================== User groups ==================================
sudo addgroup GROUP

sudo adduser USERNAME GROUP


================================= Share folder for Windows ===============================
sudo apt-get install samba

sudo useradd user2
sudo smbpasswd -a user2

sudo gedit /etc/hostname

sudo gedit /etc/samba/smb.conf
usershare owner only = false

workgroup = ATE

and add to the end of the file:
path = /media/d1
available = yes
valid users = user1
read only = no
browsable = yes
public = yes
writable = yes

path = /media/d2
available = yes
valid users = user1
read only = no
browsable = yes
public = yes
writable = yes

path = /media/d1/User2
available = yes
valid users = user2
read only = no
browsable = yes
public = yes
writable = yes

path = /media/d1/Pics
available = yes
valid users = user2
read only = no
browsable = yes
public = yes
writable = yes

path = /media/d2/video
available = yes
valid users = user2
read only = no
browsable = yes
public = yes
writable = yes

sudo gedit /etc/security/limits.conf
add to the end:
* - nofile 16384
root - nofile 16384

sudo service smbd restart

================================ Mount Windows Share =======================


sudo apt-get install cifs-utils

sudo mkdir /media/user1/user1-pc-d
sudo mkdir /media/user1/user1-pc-e

sudo gedit ~/.smbcredentials

sudo chmod 600 ~/.smbcredentials

sudo gedit /etc/fstab

//user1-pc/d /media/user1/user1-pc-d cifs credentials=/home/user1/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
//user1-pc/e /media/user1/user1-pc-e cifs credentials=/home/user1/.smbcredentials,iocharset=utf8,sec=ntlm 0 0

sudo mount -a

=================== Install Skype =================================================
1. Install from Ubunti software

2. In Tools > Settings: Uncheck "Automatically start Skype" and "Launch Skype in the background" 

3. In Startup Apllications add "/snap/bin/skype %U"

=================== Install Viber =================================================

cd ~/Downloads && wget http://download.cdn.viber.com/cdn/desktop/Linux/viber.deb && sudo dpkg -i ~/Downloads/viber.deb
Dash -- Startup Applications

================ Install 7zip and rar ===========================================
sudo apt-get update
sudo apt-get install rar unrar
sudo apt-get install p7zip-rar p7zip-full

================ Start Chrome with a certain profile ================

google-chrome --profile-directory=Default
google-chrome --profile-directory="Profile 1"

========================== Install Canon Lide 120 scanner driver ==========================

sudo add-apt-repository ppa:rolfbensch/sane-git
sudo apt-get install simple-scan sane-utils libsane libsane-common libsane-extras
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get -f install

sudo gedit /lib/udev/rules.d/40-libsane.rules

Add to the end:
# Canon CanoScan Lide 120
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="190e", ENV{libsane_matched}="yes"

Save, reboot, and run:
sudo sane-find-scanner -v -v

========================== Install Canon LBP printer driver ==========================


========================== Install Java JRE or JDK ==========================

sudo apt-get install default-jre
sudo apt-get install default-jdk

========================== Java enabled browser ==========================


========================== Install Pulse Secure Client ===================

cd ~/Downloads
wget http://trial.pulsesecure.net/clients/ps-pulse-linux-5.3r3.0-b1021-ubuntu-debian-64-bit-installer.deb
sudo dpkg -i ~/Downloads/ps-pulse-linux-5.3r3.0-b1021-ubuntu-debian-64-bit-installer.deb
/usr/local/pulse/PulseClient_x86_64.sh install_dependency_packages

============ Disable Pidgin notifications ===============

Ctrl-U -- Libnotify Popups -- Configure plugin

========================== Install Virtualbox 5.2.6 ===================

sudo apt-get remove virtualbox virtualbox-4.*
sudo apt-get remove virtualbox virtualbox-5.*
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list.d/virtualbox.list'
cd ~/Downloads
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-5.2
sudo apt-get install dkms
wget https://download.virtualbox.org/virtualbox/5.2.8/Oracle_VM_VirtualBox_Extension_Pack-5.2.8.vbox-extpack
sudo virtualbox Oracle_VM_VirtualBox_Extension_Pack-5.2.8.vbox-extpack
sudo usermod -G vboxusers -a $USER

In BIOS chage secure boot settings from “Windows UEFI” to “Other OS” and execute:
modprobe vboxdrv

=================== Install Teamviewer =============================

sudo apt-get install libqt5x11extras5 qtdeclarative5-controls-plugin qtdeclarative5-dialogs-plugin
sudo apt-get -f install

cd ~/Downloads && wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb && sudo dpkg -i ~/Downloads/teamviewer_amd64.deb

============= Install Gnome panel (taskbar) also used for creating Desktop shortcuts (Launchers) through GUI ============
sudo apt update
sudo apt install gnome-panel
gnome-desktop-item-edit --create-new ~/Desktop

============== Sync folders -- Unison ==============
Install from Ubuntu Software

Run via launcher:
/snap/unison-jz/13/bin/unison-2.51 -dontchmod -perms 0

Profiles stored at /home/user1/snap/unison-jz/13/.unison/*.prf

# Helps out a lot on Windows
fastcheck = true

# place new files at the top of the list
sortnewfirst = true

# turn on ssh compression
rshargs = -C

# Do not sync permissions
dontchmod = true
perms = 0

ignore = Name Thumbs.db
ignore = Name *~
ignore = Name *.tmp
ignore = Name _SYNCAPP
ignore = Name metadata.xml

unison profilename -batch

================== Windows software ================

 - Dropbox -- Ubuntu Software
 - Draftsight (http://dl-ak.solidworks.com/nonsecure/draftsight/2018SP1/draftSight.deb)
 - text editor: notepadqq (regular expressions not working), Geany, SciTE
 - File manager -- Double Commander
 - FTP server -- OpenSSH
 - video player -- VLC, KM Player?
 - ultraISO -- UNetbootin
 - photo manager -- digikam (alternatives: gThumb, KPhotoAlbum, Darktable, F-Spot, GTKRawGallery, Picty, Fotoxx)
 - ebook converter -- Calibre
 - audio capture -- Audio Recorder
 - audio editor -- Audacity
 - video capture (Screen recorder) -- Open Broadcaster Software (OBS)  
 - video convert -- ?
 - Video Editor  -- Kdenlive 
 - PDF Reader -- Evince 

=============== Install DraftSight ======================
cd ~/Downloads
wget http://dl-ak.solidworks.com/nonsecure/draftsight/2018SP2/draftSight.deb
sudo dpkg -i ~/Downloads/draftSight.deb

================ Install Audacity ================

Install from Ubuntu Software

============== Install Calibre ====================

sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"

====================== Install Audio Recorder ===============

sudo add-apt-repository ppa:audio-recorder/ppa
sudo apt-get -y update
sudo apt-get install --reinstall audio-recorder

========== Install digikam ===============

sudo mkdir /opt/digikam
sudo chown user1 /opt/digikam
cd /opt/digikam
wget https://download.kde.org/stable/digikam/digikam-5.9.0-01-x86-64.appimage
sudo chmod 775 digikam-5.9.0-01-x86-64.appimage

OR  (not latest)

sudo add-apt-repository ppa:philip5/extra
sudo apt update
sudo apt install digikam5

================== Install RDP ================


sudo apt-get update
sudo apt-get install xrdp
sudo apt-get install xfce4

echo xfce4-session >~/.xsession

sudo gedit /etc/xrdp/startwm.sh

The content should look like this (pay attention to the last line and ignore . /etc/X11/Xsession):

if [ -r /etc/default/locale ]; then
  . /etc/default/locale


sudo service xrdp restart

==================================== Mount shares inside vbox ==============================

mkdir ~temp-shared
sudo mount -t vboxsf temp temp-shared
sudo nano /etc/rc.local
sudo mount -t vboxsf temp /home/user1/temp-shared

====================== Install WCM Commander (Double Commander recommended) =====================================
1. http://wcm.linderdaum.com/downloads/

#OR the latest version using GIT source:
2.1 Goto https://github.com/corporateshark/WCMCommander/
2.2 Download ZIP
2.3 Unpack
2.4 Install "Synaptic Package Manager" using "Ubuntu Software"
2.5 Using Synaptic, install packages :
2.6 Run in WCMCommander-master
make all -B
sudo make install -d /usr/bin

================ Remote desktop via VNC ===============

gsettings set org.gnome.Vino require-encryption false
#and forward port 5900 on the router

=============== Double Commander======================

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/Alexx2000/xUbuntu_16.04/ /' > /etc/apt/sources.list.d/doublecmd-gtk.list"
sudo apt-get update
sudo apt-get install doublecmd-gtk

Configuration > Options -- "File views"->"Sorting directories"="sort like files and show first"
Configuration > Options-Colors-File types 
Configuration > Options-Fonts-Main font
Configuration > Options-Icons -- 16x16
Configuration > File views -- Show system and hidden files
Configuration > Options > Behaviors > Drive black list:

============= Update to LibreOffice 5.4 ===========
sudo apt-get remove --purge libreoffice-core && sudo apt-get autoremove
sudo add-apt-repository ppa:libreoffice/libreoffice-5-4
#sudo add-apt-repository ppa:libreoffice/ppa
sudo apt update
sudo apt install libreoffice

=========== Static Alt-Tab switcher (if you like it) ============

1. Open compizconfig-settings-manager (type ccsm)

2. Open "Ubuntu Unity Plugin". Choose the tab "Switcher". Disable the alt-tab and shift-alt-tab key bindings.

3. Return and open "Window management" section. Enable the "Static Application Switcher", resolve any potential conflicts (set all).

================== Configure cron scheduled tasks ===========
touch ~/cronjobs.txt
gedit ~/cronjobs.txt
0 20 * * * /snap/unison-jz/13/bin/unison-2.51 Work-Backup -batch -dontchmod -perms 0
30 20 * * 5 sh ~/archive-work.sh

touch ~/archive-work.sh
gedit ~/archive-work.sh
7z a -pPASSWORD /media/d2/Inbox-d2/Backup/Work-$(date +%Y-%m-%d).7z /media/d1/Work > archive-work.log

Make it hidden and executable:
cmod 700 ~/archive-work.sh

crontab -u user1 ~/cronjobs.txt
crontab -l

grep CRON /var/log/syslog

============== Install Telegram =============
sudo add-apt-repository ppa:atareao/telegram && sudo apt update
sudo apt install telegram
/opt/telegram/telegram -noupdate $@

================= Install OpenVPN ===============
sudo apt-get update
sudo apt-get install openvpn
sudo openvpn --config /media/d1/configfile.ovpn

============ Install OpenSSH =================

sudo apt install openssh-server

sudo mkdir -p /home/ssh-grp
sudo chown user1:grp /home/ssh-grp
sudo chgrp grp /home/ssh-grp

sudo mkdir -p /home/ssh-grp/ftp-dir1
sudo mkdir -p /home/ssh-grp/ftp-dir2

sudo chown root /home/ssh-grp

sudo gedit /etc/fstab
/media/d1/FTP/dir1 /home/ssh-grp/ftp-dir1 none bind
/media/d1/FTP/dir2 /home/ssh-grp/ftp-dir2 none bind

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults
sudo gedit /etc/ssh/sshd_config

Port NNN
PermitRootLogin no
Subsystem sftp internal-sftp

#add to the end:

Match user user1
ChrootDirectory /media
ForceCommand internal-sftp
PasswordAuthentication yes
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

Match Group grp
ChrootDirectory /home/ssh-grp
ForceCommand internal-sftp
PasswordAuthentication yes
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no

tail -f /var/log/auth.log

sudo systemctl restart ssh

================= Hide users ===============

printf "[User]\nSystemAccount=true" | sudo tee /var/lib/AccountsService/users/user1 > /dev/null

=========== Firewall =============

sudo apt-get install ufw
sudo ufw status
sudo ufw app list
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 11111/tcp
sudo ufw deny OpenSSH
sudo ufw allow Samba
sudo ufw allow CUPS
sudo ufw enable
sudo ufw status

=========== File permissions =======
Ownership and Permissions
sudo chown -R user1:user1 /media/d1 sudo chmod -R u+rwX,g+rX,go-w,o-rX /media/d1 sudo chown -R user1:user1 /media/d2 sudo chmod -R u+rwX,g+rX,go-w,o-rX /media/d2 sudo chgrp -R ate /media/d1/dir1 sudo chgrp -R ate /media/d1/dir2 sudo chown -R user2:home /media/d1/dir3 sudo chmod -R g+w /media/d1/dir3 sudo chmod -R o+X /media/d1/dir3 sudo chmod -R g+w /media/d1/FTP/inbox ================ Download an offline website mirror, make and mount ISO image =============== sudo apt-get install webhttrack bash process_after_httrack.sh sudo mkdir /media/user1/iso sudo mount -o loop /media/d1/Stasia/offline-websites/doctorberezovska_com_2018-02-25.iso /media/user1/iso sudo umount /media/user1/iso -----------process_after_httrack.sh--------- #!/bin/bash source_path=/media/d2/Temp/HTTrack project_name=doctorberezovska_com temp_path=/media/d1/Temp iso_path=/media/d1/Stasia/offline-websites url_prefix=http:/ pagename=index.html basepath=$temp_path/$project_name cp -r $source_path/$project_name $temp_path rm -rf $basepath/hts-cache #delete all folders "feed" find $basepath -type d -name feed -exec rm -r {} \; #delete all files index????.html find $basepath -type f -name index????.html -exec rm -r {} \; find $basepath -type f -name index.html -size 0c > empty_indexes.txt #download empty index.html files while read -ru 3 LINE; do #replace basepath with http prefix in each line urlpath=${LINE/$basepath/$url_prefix} #delete index.html in each line urlpath=${urlpath/$pagename} wget -k --output-document="$LINE" $urlpath done 3< empty_indexes.txt find $basepath -type f -name *.html > all_html.txt while read -ru 3 LINE; do #Replace http://doctorberezovska.com/ with ../ #Some links are not replaced by HTTrack. This replacement will only work for level 1 pages, but they are the majority. A universal replacement is too complicated. #Also delete trash after sed -i 's_http://doctorberezovska.com/_../_g;/<\/html>/q' $LINE done 3< all_html.txt grep Error: $basepath/hts-log.txt >errors.txt rm -rf $basepath/hts-log.txt mkisofs -r -iso-level 4 -o $iso_path/$project_name"_"$(date +%Y-%m-%d).iso $basepath rm -rf $basepath ---------------------------------------------- ========================== Burn ISO e.g. ================ sudo fdisk -l sudo umount /dev/sdd sudo dd bs=4M if=/media/d1/Dist/Util/Hdd-tools/WinPE10_8_Sergei_Strelec_x86_x64_2018.01.05_English/Lite/WinPE10_Sergei_Strelec_x64_2018.01.05_English.iso of=/dev/sdd status=progress oflag=sync OR if bootable USB flash sudo add-apt-repository ppa:gezakovacs/ppa sudo apt-get update sudo apt-get install unetbootin unetbootin ====================== SVN and Git GUI client ================= sudo add-apt-repository ppa:rabbitvcs/ppa sudo apt-get update sudo apt-get install rabbitvcs-cli rabbitvcs-core rabbitvcs-gedit rabbitvcs-nautilus rabbitvcs-nautilus3 sudo apt-get remove rabbitvcs* OR RapidSVN in UbuntuSoftware rep =========== Check existing application =============== /usr/share/applications ============= Call Unity settings ================== unity-control-center display ========== Download Youtube video ======== sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl sudo chmod a+rx /usr/local/bin/youtube-dl ============= Separate output audio devices for each app ============================ sudo apt-get install pavucontrol pavucontrol ================================ Clean up ========== sudo apt autoremove sudo apt-get autoremove sudo apt-get clean dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge


  1. Pingback: Скачивание оффлайн копии сайта — AT Engineering Co.

  2. Pingback: Опыт перехода с Windows на Linux — AT Engineering Co.

  3. Pingback: Switching from Windows to Linux – AT Engineering Co.

Leave a Reply

Your email address will not be published. Required fields are marked *