Ubuntu settings

This article contains mainly the useful stuff I found in the Internet, but there are some things which I developed myself. This is my cheat-sheet, 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 made for Ubuntu 18.04 LTS.

Here’s the previous version for Ubuntu 16.04 LTS: Ubuntu16_settings.txt

((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
======================================== Initial setup ===============================


#=================== Simple GUI adjustments ==========================
- Desktop backround solid color
- remove unneccessary icons from the launcher
- keyboard repeat delay: Settings > Universal Access > Typing > Repeat keys -- Speed setting works in inverse
- Nautilus Bookmarks: drag and drop
- Language Support + Regional Formats
- Shortcuts on desktop
- Time & Date settings -- 24 H
- Install LibreOffice and adjust settings (name, units)
- setup Thunderbird: Startup Applications 
- login to Firefox
- Link colors in LibreOffice Calc: Tools > Options > LibreOffice > Application Colors > Text Document > Field Shading 

========================== Fix "Failed to activate service 'org.bluez': timed out" error ==============

sudo systemctl enable bluetooth.service

OR

sudo apt-get remove pavucontrol


========================== Fix "Cannot access vdagent virtio channel /dev/virtio-ports/com.redhat.spice.0" error ==============
sudo apt purge spice-vdagent


============================= Fix "Couldn't get size: 0x800000000000000e" error ======================================
In BIOS : Security -> Secure Boot -> Secure Boot Mode -> [Standard]



#========================== 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=1185b49e-0551-42c5-8510-3149f2964b8a none            swap    sw              0       0
UUID=6f5d0096-211f-4e9b-8a32-ba242fa86017 /media/cloud auto nosuid,nodev,nofail,x-gvfs-show 0 0
tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,mode=1777,size=16384M 0 0
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


============================ /tmp directory in RAM ===================
sudo gedit /etc/fstab

tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,mode=1777,size=8192M 0 0


================== Google calendar to accept invitations in Thunderbird 60 ===================

- In Preferences > Advanced (Tab) > General (stealthy subtab) > Config Editor (Button)
- Search for "calendar.google.enableEmailInvitations" and ensure the property is set to true
- Go to the calendar you want to use with your email, right click it and select "Properties"
- Change the "Email" field to the account you want to process invites for
- Click "OK"
- Go to an email invitation and you should now see the accept and decline buttons.


============== Cyrillic characters in Windows archives ================
sudo apt-add-repository ppa:hanipouspilot/file-roller
sudo apt-get update
sudo apt-get install file-roller


============= Separate output audio devices for each app ============================

sudo apt-get install pavucontrol

pavucontrol


===================== Enable Edit As Administrator =====================

sudo apt install nautilus-admin
sudo nautilus -q


=========== Install LibreOffice via PPA (snap version is slow) =======================

sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice

sudo apt-get install ppa-purge && sudo ppa-purge ppa:libreoffice/ppa


============== Install Thunderbird from PPA (snap version is old) ==============

sudo add-apt-repository ppa:mozillateam/ppa
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt install thunderbird
sudo apt install xul-ext-lightning

To uninstall -- sudo apt-get install ppa-purge && sudo ppa-purge ppa:mozillateam/ppa

=====================================================


============ 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):

HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore


=============== Double Commander (snap version is old) ======================

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/Alexx2000/xUbuntu_18.04/ /' > /etc/apt/sources.list.d/home:Alexx2000.list"
wget -nv https://download.opensuse.org/repositories/home:Alexx2000/xUbuntu_18.04/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo apt update
sudo apt install doublecmd-gtk

Configuration > Options -- "File views"->"Sorting directories"="sort like files and show first"
Configuration > Options-Fonts-Main font, Path font
Configuration > Options-Icons -- 16x16
Configuration > Options > Behaviors > Drive black list:
/home/ssh-ate/ATE;/home/ssh-ate/Dist;/home/ssh-ate/Dist-Work;/home/ssh-ate/Docs;/home/ssh-ate/ArchiveProjects;/home/ssh-ate/SupplierInfo;/home/ssh-ate/Lang;/home/ssh-ate/Music;/home/ssh-ate/Storage;/home/ssh-ate/video;/home/ssh-ate/inbox;/run/user/1000/gvfs;/media/drew/Win;*telegram-desktop.mnt;/run/snapd/ns*;/home/guests/Inbox-d2;/home/guests/video;/home/drew/.cache/doc;/run/user/1000/doc
Configuration > Options > Keys > Hot keys > cm_LeftOpenDrives = Alt-1 and cm_RightOpenDrives = Alt-2 (because Alt-F1 and Alt-F2 are taken by Gnome)


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

sudo snap install --classic notepadqq
Then allow access to removable storage devices in Ubuntu software > notepadqq > Permissions


#=================== Disable Gnome animation =========================

0. Install Gnome Tweak Tool using Ubuntu Software

1. Appearance > Animations = Off


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

sudo adduser USERNAME GROUP

groups USERNAME


================================= 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
[global]
usershare owner only = false

workgroup = ATE

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

[d2]
path = /media/d2
available = yes
valid users = drew
read only = no
browsable = yes
public = yes
writable = yes

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

[Pics]
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 =======================

https://ubuntuforums.org/showthread.php?t=2078120

sudo apt-get install cifs-utils

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

sudo gedit ~/.smbcredentials
username=msusername
password=mspassword

sudo chmod 600 ~/.smbcredentials

sudo gedit /etc/fstab

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

sudo mount -a


=================== Install Skype (snap version is old) =================================================
cd ~/Downloads
wget https://go.skype.com/skypeforlinux-64.deb
sudo dpkg -i skypeforlinux-64.deb
rm skypeforlinux-64.deb

If Skype doesn't save the password:
    In the Ubuntu launch menu, type password to find the utility Passwords and Keys. Open this utility.
    In the panel on the left you should see an entry Login in the section Passwords. Right click on Login, and select Change Password from the pop-up menu.
    You'll need to enter your current password first, then it asks for a new password
    Just leave the fields blank and press Continue.


=================== Install Viber -- not needed in latest version: replace libcurl3 with libcurl4 to avoid conficts with virtualbox =================================================

cd ~/Downloads
wget http://download.cdn.viber.com/cdn/desktop/Linux/viber.deb
sudo dpkg -i viber.deb
rm viber.deb


============== Install Telegram =============
Install from Ubuntu Software
OR
sudo snap install telegram-desktop


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


===================== Reset keyring password ====================
sudo rm ~/.local/share/keyrings/login.keyring


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

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


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


cd ~/Downloads
wget http://trial.pulsesecure.net/clients/ps-pulse-linux-9.0r2.0-b819-ubuntu-debian-64-bit-installer.deb
sudo dpkg -i ps-pulse-linux-9.0r2.0-b819-ubuntu-debian-64-bit-installer.deb
sudo /usr/local/pulse/PulseClient_x86_64.sh install_dependency_packages
sudo apt-get install libproxy1-plugin-webkit libgnome-keyring0
sudo apt install libwebkitgtk-1.0-0 libdconf1 dconf-gsettings-backend
sudo apt install net-tools
echo "/usr/local/pulse" | sudo tee /etc/ld.so.conf.d/pulse.conf
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pulse

More details at https://medium.com/@yildirimabdrhm/pulse-secure-client-installation-on-linux-8bc524088793


wget https://as.exeter.ac.uk/media/level1/academicserviceswebsite/it/documents/networks/vpn/ps-pulse-linux-9.0r3.0-b923-ubuntu-debian-64-bit-installer.deb
sudo dpkg -i ps-pulse-linux-9.0r3.0-b923-ubuntu-debian-64-bit-installer.deb

wget https://wiki.univ-nantes.fr/_media/nomade:pulse_clients:ps-pulse-linux-9.1r1.0-b21-ubuntu-debian-64-bit-installer.deb
ps-pulse-linux-9.1r2.0-b69-ubuntu-debian-64-bit-installer.deb


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

Ctrl-U -- Libnotify Popups -- Configure plugin


========================== Install Virtualbox 6.0.10 ===================

sudo apt-get update
sudo apt-get install build-essential gcc make perl dkms libcurl4 libqt5opengl5 libqt5printsupport5 libqt5x11extras5 libsdl1.2debian
reboot

cd ~/Downloads
wget https://download.virtualbox.org/virtualbox/6.0.10/virtualbox-6.0_6.0.10-132072~Ubuntu~bionic_amd64.deb
sudo dpkg -i virtualbox-6.0_6.0.10-132072~Ubuntu~bionic_amd64.deb
rm virtualbox-6.0_6.0.10-132072~Ubuntu~bionic_amd64.deb

wget https://download.virtualbox.org/virtualbox/6.0.10/Oracle_VM_VirtualBox_Extension_Pack-6.0.10.vbox-extpack
sudo virtualbox Oracle_VM_VirtualBox_Extension_Pack-6.0.10.vbox-extpack


If virtual machines don't start, try this:
sudo adduser $USER vboxusers
sudo /sbin/vboxconfig
modprobe vboxdrv

In BIOS disable UEFI secure boot 


=================== 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

https://download.teamviewer.com/download/linux/teamviewer_amd64.deb


--------Login screen locked ----------------
sudo gedit /etc/gdm3/custom.conf
	WaylandEnable=false


============= Desktop shortcuts ============

gedit ~/Desktop/Chrome-home.desktop

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/usr/bin/google-chrome --profile-directory=Default
Name=Chrome home
Comment=Chrome home
Icon=/opt/google/chrome/product_logo_256.png


gedit ~/Desktop/Chrome-work.desktop

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/usr/bin/google-chrome --profile-directory="Profile 1"
Name=Chrome work
Comment=Chrome work
Icon=/opt/google/chrome/product_logo_256.png


Then allow execution in properties.


=============== Change display resolution ==============
xrandr --output HDMI-1 --mode 1920x1200
xrandr --output HDMI-1 --mode 1920x1080
xrandr --output HDMI-1 --mode 1280x960


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

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

Profiles stored at /home/drew/.unison/*.prf

common.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 (Ubuntu software or sudo snap install vlc)
 - ultraISO -- UNetbootin + sudo apt-get install isomaster
 - 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 -- Handbrake (Selene?)
 - Video Editor  -- Kdenlive 
 - PDF Reader -- Evince 


================== Configure cron scheduled tasks ===========
touch ~/cronjobs.txt
gedit ~/cronjobs.txt
0 20 * * * /snap/unison-jz/19/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
#!/bin/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:
chmod 700 ~/archive-work.sh

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

grep CRON /var/log/syslog



============ Install OpenSSH =================
https://www.digitalocean.com/community/tutorials/how-to-enable-sftp-without-shell-access-on-ubuntu-16-04
https://en.wikibooks.org/wiki/OpenSSH/Cookbook/File_Transfer_with_SFTP#SFTP-only_Accounts

sudo apt install openssh-server

sudo mkdir -p /home/ssh-grp
sudo chown drew: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 drew
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/drew > /dev/null



=========== Firewall =============
https://www.digitalocean.com/community/tutorials/how-to-setup-a-firewall-with-ufw-on-an-ubuntu-and-debian-cloud-server

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 =======
http://manpages.ubuntu.com/manpages/xenial/en/man8/ntfs-3g.8.html
Ownership and Permissions
sudo chown -R drew:drew /media/cloud sudo chmod -R u=rwX,g=,o= /media/cloud sudo chown -R drew:ate /media/d1 sudo chown -R drew:ate /media/d2 sudo chmod -R u=rwX,g=rX,o= /media/d1 sudo chmod -R u-s,g-s /media/d1 sudo chmod -R u=rwX,g=rX,o= /media/d2 sudo chmod -R u-s,g-s /media/d2 sudo chmod u=rwX,go=rX /media/d1 sudo chmod u=rwX,go=rX /media/d2 sudo chmod -R u=rwX,g=,o= /media/d1/2del sudo chmod -R u=rwX,g=,o= /media/d1/Backup sudo chmod -R u=rwX,g=,o= /media/d1/Temp sudo chmod -R u=rwX,g=,o= /media/d1/Work sudo chmod -R u=rwX,g=,o= /media/d2/2del sudo chmod -R u=rwX,g=,o= /media/d2/Backup sudo chmod -R u=rwX,g=,o= /media/d2/Temp ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ========================= Make clonezilla live USB ===================== Format a USB flash stick into FAT32 and label it CZILLA-USB cd ~/Downloads wget https://dotsrc.dl.osdn.net/osdn/clonezilla/71320/clonezilla-live-20190707-disco-amd64.zip unzip ~/Downloads/clonezilla-live-20190707-disco-amd64.zip -d /media/drew/CZILLA-USB rm ~/Downloads/clonezilla-live-20190707-disco-amd64.zip cd /media/drew/CZILLA-USB/utils/linux sudo bash makeboot.sh /dev/sdd4 ============================ Clonezilla -- make and restore partition image in batch/unattended mode ===================== For EIF boot mode: add the following text to grub.cfg file, which is located in /boot/grub directory on your live USB or CD. The text should be added before this line: menuentry "Clonezilla live (Default settings, VGA 800x600)"{ ((((((((((( Example for host OS -- one partition only menuentry "Make partition image unattended from sda3 to /dev/sdb1/Backup/HDD-Images/drew-pc/Ubuntu18/01-basic"{ search --set -f /live/vmlinuz linux /live/vmlinuz boot=live config noswap nolocales edd=on nomodeset noprompt ocs_prerun="mount /dev/sdb1 /mnt" ocs_prerun1="mount --bind /mnt/Backup/HDD-Images/drew-pc/Ubuntu18 /home/partimag/" ocs_live_run="ocs-sr -q2 -c -j2 -z1p -i 4096 -sfsck -scs -senc --batch -p reboot saveparts 01-basic sda3" ocs_live_extra_param="" ocs_live_keymap="NONE" keyboard-layouts=NONE ocs_live_batch="yes" ocs_lang="en_US.UTF-8" vga=788 ip=frommedia nosplash ocs_numlk=on initrd /live/initrd.img } menuentry "Restore partition image unattended from /dev/sdb1/Backup/HDD-Images/drew-pc/Ubuntu18/01-basic to sda3"{ search --set -f /live/vmlinuz linux /live/vmlinuz boot=live config noswap nolocales edd=on nomodeset noprompt ocs_prerun="mount /dev/sdb1 /mnt" ocs_prerun1="mount --bind /mnt/Backup/HDD-Images/drew-pc/Ubuntu18 /home/partimag/" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -j2 -k --batch -p reboot restoreparts 01-basic sda3" ocs_live_extra_param="" ocs_live_keymap="NONE" keyboard-layouts=NONE keyboard-layouts=NONE ocs_live_batch="yes" ocs_lang="en_US.UTF-8" vga=788 ip=frommedia nosplash ocs_numlk=on initrd /live/initrd.img } )))))))))))) For legacy boot mode: add the following text to grub.cfg file, which is located in /boot/grub directory on your live USB or CD. The text should be added after this line: MENU TITLE clonezilla.org, clonezilla.nchc.org.tw ((((((((((( Example for VirtualBox (shrinking VDI file size) -- whole disk label Clonezilla sda to sdb1-DiskImage MENU LABEL Make disk image unattended from sda to /dev/sdb1/DiskImage kernel /live/vmlinuz append initrd=/live/initrd.img boot=live config noswap nolocales edd=on nomodeset noprompt ocs_prerun="mount /dev/sdb1 /mnt" ocs_prerun1="mount --bind /mnt /home/partimag/" ocs_live_run="ocs-sr -q2 -j2 -z1p -i 4096 -sfsck -scs -senc --batch -p reboot savedisk DiskImage sda" ocs_live_extra_param="" ocs_live_keymap="NONE" keyboard-layouts=NONE ocs_live_batch="yes" ocs_lang="en_US.UTF-8" vga=788 ip=frommedia nosplash ocs_numlk=on TEXT HELP * Please check your params beforehand -- no more confirmations! ENDTEXT label Clonezilla sdb1-DiskImage to sda MENU LABEL Restore disk image unattended from /dev/sdb1/DiskImage to sda kernel /live/vmlinuz append initrd=/live/initrd.img boot=live config noswap nolocales edd=on nomodeset noprompt ocs_prerun="mount /dev/sdb1 /mnt" ocs_prerun1="mount --bind /mnt /home/partimag/" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -j2 --batch -p reboot restoredisk DiskImage sda" ocs_live_extra_param="" ocs_live_keymap="NONE" keyboard-layouts=NONE keyboard-layouts=NONE ocs_live_batch="yes" ocs_lang="en_US.UTF-8" vga=788 ip=frommedia nosplash ocs_numlk=on TEXT HELP * Please check your params beforehand -- no more confirmations! ENDTEXT )))))))))))) Then replace the following parameters with your values in al places: sda3 -- imaged partition 03-all -- image name /dev/sdb1 -- drive that will store the image Backup/HDD-Images/drew-pc -- path on the drive that will store the image sda -- imaged drive When restoring the image with just one partition, first copy these files from the complete image: sda1.vfat-ptcl-img.gz.aa swappt-sda4.info ==================================== Edit ISO including bootable ones ============================== sudo apt-get install isomaster OR https://poweriso.com/download-poweriso-for-linux.htm ======================= Create ramdisk and start Digikam with its DB on ramdisk -- but better make /tmp in RAM ==================== sudo mkdir /mnt/ramdisk /opt/digikam/start_with_ramdisk.sh : pkexec mount -t tmpfs -o rw,size=512M tmpfs /mnt/ramdisk cp -r -f /home/drew/Documents/digikam_db /mnt/ramdisk sh /opt/digikam/AppRun cp -r -f /mnt/ramdisk/digikam_db /home/drew/Documents #pkexec umount /mnt/ramdisk #the ramdisk will be unmounted after the next reboot ==================== Export OpenWRT router config =============== ssh root@192.168.1.1 "uci export" > router.conf ======================== Enable Shell in Gnome tweaks =============
Enable ‘Shell theme’ in Gnome Tweak Tool in Ubuntu
#============================= Disable password prompt in sudo (convenient but not secure -- do not forget to change it back!) ============================== #1. sudo visudo #Change: %sudo ALL=(ALL:ALL) ALL #to %sudo ALL=(ALL) NOPASSWD:ALL #2. sudo nano /etc/polkit-1/localauthority/50-local.d/99-nopassword.pkla [No password prompt] Identity=unix-group:sudo Action=* ResultActive=yes ========================== 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 ========================== http://help.ubuntu.ru/wiki/canon_capt ========================== Install JDK8 ========================== sudo apt remove openjdk* sudo apt remove openjfx sudo apt install openjdk-8-jdk sudo apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2 sudo apt-mark hold openjfx libopenjfx-java libopenjfx-jni Then add /usr/share/java as global library in Project Structure ========================== Java enabled browser ========================== palemoon ===================== Install Handbrake ============= sudo add-apt-repository ppa:stebbins/handbrake-releases sudo apt-get update sudo apt-get install handbrake-gtk sudo apt-get install handbrake-cli ==================== Install Selene =========== sudo apt-add-repository -y ppa:teejee2008/ppa sudo apt-get update sudo apt-get install selene =============== Install DraftSight ====================== cd ~/Downloads wget http://dl-ak.solidworks.com/nonsecure/draftsight/2019SP1/draftSight.deb sudo dpkg -i ~/Downloads/draftSight.deb ================ Install Audacity ================ Use Ubuntu Software OR: sudo add-apt-repository ppa:ubuntuhandbook1/audacity sudo apt-get update sudo apt-get install audacity ============== 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 -- /tmp should be in RAM =============== mkdir ~/digikam cd ~/digikam wget https://download.kde.org/stable/digikam/6.1.0/digikam-6.1.0-x86-64.appimage #!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Type=Application Terminal=false Icon[en_US]=gnome-panel-launcher Name[en_US]=Digikam Exec=sh /home/drew/digikam/start_with_ramdisk.sh Name=Digikam Icon=/home/drew/digikam/digikam.png #!/bin/bash cp -r -f ~/digikam/digikam_db /tmp ~/digikam/digikam-6.1.0-x86-64.appimage cp -r -f /tmp/digikam_db ~/digikam rm -r -f /tmp/digikam_db ================== Install RDP ================ https://askubuntu.com/questions/592537/can-i-access-ubuntu-from-windows-remotely 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): " #!/bin/sh if [ -r /etc/default/locale ]; then . /etc/default/locale export LANG LANGUAGE fi startxfce4 " sudo service xrdp restart ==================================== Mount shares inside vbox ============================== https://gist.github.com/estorgio/1d679f962e8209f8a9232f7593683265 Install Guest Additions CD image... sudo apt-get update sudo apt-get install build-essential linux-headers-`uname -r` sudo /media/cdrom/./VBoxLinuxAdditions.run sudo shutdown -r now mkdir /home/andrew/vboxshare sudo mount -t vboxsf shared /home/drew/vboxshare sudo nano /etc/fstab shared /home/drew/vboxshare vboxsf defaults 0 0 sudo nano /etc/modules Add the following line to /etc/modules and save vboxsf shutdown -r now ================ Remote desktop via VNC =============== sudo apt update && sudo apt install -y vino vino-preferences gsettings set org.gnome.Vino require-encryption false #and forward port 5900 on the router ================= Install OpenVPN =============== sudo apt-get update sudo apt-get install openvpn sudo openvpn --config /media/d1/configfile.ovpn ========================== Make ISO image ================= mkisofs -allow-lowercase -allow-multidot -J -joliet-long -jcharset utf-8 -o /media/d1/Pics/My_photo/Archive/2017.iso /media/d1/Pics/My_photo/2017/08-July ================ Download an offline website mirror, make and mount ISO image =============== sudo apt-get install webhttrack bash process_after_httrack.sh sudo mkdir /media/drew/iso sudo mount -o loop /media/d1/Stasia/offline-websites/doctorberezovska_com_2018-02-25.iso /media/drew/iso sudo umount /media/drew/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/WinPE10_Sergei_Strelec_x64_2018.01.05_English_lite.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 sudo QT_X11_NO_MITSHM=1 /usr/bin/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 ========== 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 ========== Access Google Drive ========== GUI - https://www.omgubuntu.co.uk/2016/08/use-google-drive-ubuntu-16-04-linux-desktops Mount - https://www.techrepublic.com/article/how-to-mount-your-google-drive-on-linux-with-google-drive-ocamlfuse/ Mount - http://xmodulo.com/mount-google-drive-linux.html =============== On input source change the scroll lock toggles ======================= sudo gedit /etc/default/keyboard XKBOPTIONS="grp:alt_shift_toggle,grp_led:scroll" #XKBOPTIONS="grp:alt_shift_toggle" gsettings reset org.gnome.desktop.input-sources xkb-options ========================= Batch resize images recursively ================================= sudo apt-get update sudo apt-get install imagemagick -y OR (compile if needed) sudo apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y cd ~/Downloads wget https://www.imagemagick.org/download/ImageMagick.tar.gz tar xf ImageMagick.tar.gz cd ImageMagick-7* ./configure make sudo make install sudo ldconfig /usr/local/lib find . -name '*.jpg' -execdir mogrify -resize 1920x1440 {} \; find . -name '*.JPG' -execdir mogrify -resize 1920x1440 {} \; find . -name "*.jpg" | xargs mogrify -resize 50% find . -name "*.JPG" | xargs mogrify -resize 50% find . -name '*.png' -execdir mogrify -format jpg {} \; find . -name '*.PNG' -execdir mogrify -format jpg {} \; ========== Disable MySQL from startup ========= sudo /etc/init.d/mysql stop sudo systemctl disable mysql sudo systemctl enable mysql sudo /etc/init.d/mysql start =============== Rename all .MP3 to .mp3 files =========== sudo apt install rename rename 's/.MP3$/.xxx/' *.MP3 rename 's/.xxx$/.mp3/' *.xxx ============ Randomize (shuffle) all .mp3 files ================= for f in *.mp3 *.MP3; do mv "$f" $RANDOM.mp3; done ==================== Batch rename files in text editor ================= sudo apt install renameutils qmv ================================ Clean up ========== sudo apt autoremove sudo apt clean sudo journalctl --vacuum-time=30m 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 sudo rm -rfv /var/lib/snapd/cache/* sudo sh delete_old_snaps.sh #!/bin/bash # Removes old revisions of snaps # CLOSE ALL SNAPS BEFORE RUNNING THIS set -eu snap list --all | awk '/disabled/{print $1, $3}' | while read snapname revision; do snap remove "$snapname" --revision="$revision" done

3 Comments

  1. Pingback: Switching from Windows to Linux – Blog

Leave a Reply

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