Ubuntu tips & tweaks

fish + batman theme
sudo apt install fish
curl -L https://get.oh-my.fish > install
fish install --path=~/.local/share/omf --config=~/.config/omf
fish
omf install batman
WPS Office + rus lang
# get lastet deb here: http://wps-community.org/downloads
wget http://kdl.cc.ksosoft.com/wps-community/download/a20/wps-office_10.1.0.5503~a20p2_i386.deb
dpkg -i wps-office_10.1.0.5503~a20p2_i386.deb

# install rus lang:
git clone https://github.com/wps-community/wps_i18n.git
cd wps_i18n/ru_RU
make && sudo make install

# install dicts:
wget http://wps-community.org/download/dicts/ru_RU.zip
unzip ru_RU.zip -d /opt/kingsoft/wps-office/office6/dicts/

# install MS fonts:
sudo apt-get install ttf-mscorefonts-installer
cd /tmp
git clone https://github.com/wayne-hartmann/ttf-wps-fonts.git
sudo mkdir /usr/share/fonts/wps-fonts
sudo mv ttf-wps-fonts/* /usr/share/fonts/wps-fonts
sudo chmod 644 /usr/share/fonts/wps-fonts/*
sudo fc-cache -vfs
rm -rf /tmp/ttf-wps-fonts

# turn on antialiasing only for WPS Office:
cat /etc/fonts/conf.d/40-wps-office.conf

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
		<match target="pattern">
		<test name="prgname">
		    <string>wps</string>
		</test>
		<edit name="antialias" mode="assign"><bool>true</bool></edit>
		<edit name="rgba" mode="append"><const>rgb</const></edit>
		<edit name="hinting" mode="append"><bool>false</bool></edit>
        </match>
    </fontconfig>
Notepad++ for Linux
sudo add-apt-repository ppa:notepadqq-team/notepadqq
sudo apt-get update
sudo apt-get install notepadqq
Vim 8.0
sudo add-apt-repository ppa:jonathonf/vim
sudo apt update
sudo apt install vim
NVidia latest drivers ppa
sudo add-apt-repository ppa:graphics-drivers/ppa
Misc
# remove useless apps
sudo apt-get remove zeitgeist* -y
sudo apt-get remove evolution-data-server
sudo apt-get autoremove

sudo systemctl disable timidity
sudo systemctl mask timidity
sudo systemctl disable avahi-daemon
sudo systemctl mask avahi-daemon

# turning off Apport:
sudo sed -i 's/enabled=1/enabled=0/g' /etc/default/apport

# turning off guest session
sudo sh -c 'printf "[SeatDefaults]\nallow-guest=false\n" >/usr/share/lightdm/lightdm.conf.d/50-no-guest.conf'

# .icm color profile manager
sudo apt install gnome-color-manager

# classic menu
sudo apt install classicmenu-indicator


Fingerprint unlock
add-apt-repository ppa:fingerprint/fingerprint-gui
apt update
apt install libbsapi policykit-1-fingerprint-gui fingerprint-gui
reboot
Sublime Text disable Antialiasing
cat /etc/fonts/conf.d/41-sublime-text.conf
    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
		<match target="pattern">
		<test name="prgname">
		    <string>sublime_text</string>
		</test>
		<edit name="antialias" mode="assign"><bool>false</bool></edit>
		<edit name="rgba" mode="append"><const>rgb</const></edit>
		<edit name="hinting" mode="append"><bool>true</bool></edit>
        </match>
    </fontconfig>


# Add to sublime prefs:
#    "font_options": ["no_antialias"],
# should be something like this:
{
    "bold_folder_labels": true,
    "color_scheme": "Packages/User/SublimeLinter/OneDark (SL).tmTheme",
    "fallback_encoding": "Cyrillic (Windows 1251)",
    "font_face": "ubuntu mono",
    "font_size": 11,
    "font_options": ["no_antialias"],
    "highlight_modified_tabs": true,
    "ignored_packages":
    [
	"Package Control",
	"Vintage"
    ],
    "theme": "OneDarkMaterial.sublime-theme",
    "trim_trailing_white_space_on_save": true,
    "update_check": false
}

Remmina 1.2.x
sudo apt-add-repository ppa:remmina-ppa-team/remmina-next
sudo apt-get update
sudo apt-get install remmina remmina-plugin-rdp libfreerdp-plugins-standard
Thunar as default filemanager
sudo apt-get install thunar -y
gvfs-mime --set inode/directory Thunar.desktop
# and check here:
exo-preferred-applications
Flatabulous theme
# https://github.com/anmoljagetia/Flatabulous

# theme
sudo apt-get install unity-tweak-tool
sudo add-apt-repository ppa:noobslab/themes
sudo apt-get update
sudo apt-get install flatabulous-theme arc-flatabulous-theme 

# icons
sudo add-apt-repository ppa:noobslab/icons
sudo apt-get update
sudo apt-get install ultra-flat-icons

# Arch
yaourt -S gtk-arc-flatabulous-theme-git
# or
packer -S gtk-arc-flatabulous-theme-git

Pop theme
sudo add-apt-repository ppa:system76-dev/stable
sudo apt update
sudo apt install system76-pop-theme
Arc Theme
apt-get install dh-autoreconf -y
git clone https://github.com/horst3180/arc-theme --depth 1 && cd arc-theme
git fetch --tags
./autogen.sh --prefix=/usr
sudo make install
mkdir /usr/share/icons/vertex
cd /usr/share/icons/vertex
git clone https://github.com/horst3180/vertex-icons --depth 1
Adapta Theme (https://github.com/adapta-project/adapta-gtk-theme)
sudo add-apt-repository ppa:tista/adapta
sudo apt-get update
sudo apt-get install adapta-gtk-theme adapta-gtk-backgrounds
Papirus icons
sudo add-apt-repository ppa:papirus/papirus
sudo apt-get update
sudo apt-get install papirus-icon-theme

Shadows
sudo apt-get install compizconfig-settings-manager
# Run ccsm and click on "Ubuntu Unity Plugin"
# Click on "Decorations" tab and click on "Overrride Theme Settings".
# The shadow should disappear since the default "Active window shadow color" is transparent.
Unity animation speed
sudo apt-get install dconf-tools
dconf write /com/canonical/unity/minimize-speed-threshold 3
Latest Libreoffice
sudo add-apt-repository ppa:libreoffice/ppa
sudo add-apt-repository ppa:libreoffice/libreoffice-5-3
sudo apt-get update
sudo apt-get dist-upgrade
VMware Horizon View 3.5.0 Client in Ubuntu
sudo bash
wget https://download3.vmware.com/software/view/viewclients/CART15Q3/VMware-Horizon-Client-3.5.0-2999900.x64.bundle
env TERM=dumb VMWARE_EULAS_AGREED=yes VMWARE_KEEP_CONFIG=yes
sh ./VMware-Horizon-Client-3.5.0-2999900.x64.bundle --console --required

# create file /usr/share/applications/vmware-horizon-client.desktop
[Desktop Entry]
Name=VMware Horizon Client
Comment=Connect to VMware Horizon View virtual machines
GenericName=VMware Horizon Client
Exec=vmware-view
Icon=/usr/share/pixmap/vmware-view.png
Terminal=false
StartupNotify=true
Type=Application
Categories=Network
HP printers
aptitude install hplip-gui
hp-setup
iptables-persistent
aptitude install iptables-persistent ipset -y
ipset -N blacklist
ipset -A blacklist 1.2.3.4

cat /etc/iptables/rules.v4

*filter
:INPUT ACCEPT [0:0]
# -A INPUT -m set --match-set blacklist src -j DROP
# -A INPUT -m set --match-set blacklist dst -j DROP
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
# -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -j DROP
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [18:1305]
COMMIT
Remove antialiasing + ms fonts
apt install unity-tweak-tool ttf-mscorefonts-installer
# in unity-tweak-tool font control panel switch off antialiasing and turn hinting to full
# then remove antialiasing for all apps:
sudo rm /etc/fonts/conf.d/10-*
reboot
Remove tearing
# try the best for you:
nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceCompositionPipeline = On }"
nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

# For Ubuntu goto Nvidia X Server Settings -> X Server Display Configuration -> Save to X Configuration File

# the better one add here
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bkp
vi /etc/X11/xorg.conf

 Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
    # Option "metamodes" "VGA-0: 1152x864_60 +0+0, DVI-D-0: 1680x1050_60 +0+864 { ForceCompositionPipeline = On }"
    SubSection     "Display"
        Depth       24
    EndSubSection
 EndSection

Powersave on notebooks
sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp tlp-rdw acpi-call-tools
sudo tlp start
Backlight on notebooks
sudo mcedit /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
sudo update-grub

** Backlight applet
sudo add-apt-repository ppa:indicator-brightness/ppa
sudo apt-get update
sudo apt-get install indicator-brightness

Full backup
rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /path/to/backup/folder