Jan 15, 2015 Tag: Ubuntu
Ongoing attempt to collect clever stuff about Ubuntu. Will be updated as needed.
Updated on Nov 21, 2018
See also
Overview
What to do
Promising
2018-09–09, Abhishek Prakash, nice post, good screen shots: Customize Ubuntu 18.04 GNOME With These Simple Tips
Brief: Some basic and some interesting GNOME customization tips to get more out of your Ubuntu 18.04 desktop
YouTube: 30 Things to do After Installing Ubuntu 18.04 LTS (all-in-one video) - has links in the description
YouTube: 21 Things to do After Installing Ubuntu 18.04 [Must for beginners]
YouTube: Top 14 Things To Do After Installing Ubuntu 18.04 - has links in the description
YouTube: UBUNTU 18.04 LTS - TOP 8 Things to do After Installing Ubuntu Bionic Beaver - First Steps w/ Ubuntu
YouTube: Must-Have Linux Apps for 2018
Reading, 10 July 2018-07-10, Lubos Rendek: How to take a screenshot on Ubuntu 18.04 Bionic Beaver Linux
YouTube: The 7 Best Gnome Shell Extensions - has links in the description
YouTube: Flatpak vs Snap - Which Linux package format is Better?
For example:
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias dco=docker-compose
alias grepalias="alias | ag"
alias mm=./mainmenu.sh
alias myhelp="cat ~/.myhelp"
alias myhelpedit="gedit ~/.myhelp &"
alias myopen="gnome-open"
alias pass="export EDITOR=joe && pass"
# use sublime and make it wait until the file has been close by sublime
alias pass='export EDITOR="subl -w" && pass'
alias ssh-hosts='cat ~/.ssh/config | grep -e "^Host" | sort'
Read (de): https://dr-luthardt.de/linux.htm?tip=anacron
Add to /etc/anacrontab:
# added by marble
@daily 0 create-etc-list-of-installed-packages dpkg -l | grep ^ii | awk '{print $2;}' >/etc/list-of-installed-packages.anacron.txt
https://kofler.info/desktop-konfiguration-fuer-ubuntu-18-04/
CapsLock deaktivieren
Die überflüssigste Taste jeder Tastatur ist CapsLock. Immer wieder führt ein unbeabsichtigtes Drücken zur eINGABE FEHLERHAFTEN tEXTS. Abhilfe: Im Programm Optimierungen (also Gnome Tweaks) gibt es im Dialogblatt Tastatur und Maus den merkwürdig beschrifteten Button Zusätzliche Belegungsoptionen. Er führt in einen Dialog, in dem Sie die Funktionen diverse Spezialtasten (Strg, Alt, Windows, CapsLock) verändern können. Dort gibt es auch die Möglichkeit, CapsLock ganz zu deaktivieren
Database management tool
Commandline tool, needed for Sphinx and mblessblog:
sudo apt install libimage-exiftool-perl
Install via Ubuntu software.
sudo apt install etckeeper ghex git joe ncdu qrencode silversearcher-ag sshfs xclip zsh
For .password-store, pass: qrencode, xclip
https://linuxconfig.org/list-installed-packages-on-ubuntu-18-04-bionic-beaver-linux
Use ① Ubuntu software center or ② apt list --installed
or ③ dpkg -l
apt list --installed
dpkg -l | grep ^ii
dpkg -l | grep ^ii | awk '{print $2;}' # cool
dpkg -l | grep ^ii | wc -l # count
dpkg -l | grep ^ii | grep -i SEARCHSTR
Add the following to ~/.zshrc:
if ((0)) && [[ -e ~/.docker-shell-commands.sh ]]; then true
rm ~/.docker-shell-commands.sh
fi
if ((1)) && [[ ! -e ~/.docker-shell-commands.sh ]]; then true
echo docker pull t3docs/render-documentation
docker pull t3docs/render-documentation
fi
if ((1)) && [[ ! -e ~/.docker-shell-commands.sh ]]; then true
echo GENERATE docker run --rm t3docs/render-documentation → ~/.docker-shell-commands.sh
docker run --rm t3docs/render-documentation show-shell-commands >~/.docker-shell-commands.sh
fi
if [[ -e ~/.docker-shell-commands.sh ]]; then true
source ~/.docker-shell-commands.sh
fi
See what you can get: https://flathub.org/home
Fedora flatpak support:
sudo apt install gnome-software-plugin-flatpak
sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt update
sudo apt install flatpak
Use flatpak:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub cc.arduino.arduinoide
sudo apt install git
Import the global settings from http://mbless.de/blog/2015/01/15/looking-for-wisdom-about-git.html#git-config-global
| https://kofler.info/desktop-konfiguration-fuer-ubuntu-18-04/ | system-monitor - display system informations in gnome shell status bar, such as memory usage, cpu usage, network rates… |
Required:
sudo apt install gir1.2-gtop-2.0 gir1.2-networkmanager-1.0 gir1.2-clutter-1.0
➜ ~ cat /home/marble/.gnupg/gpg-agent.conf
###+++--- GPGConf ---+++###
default-cache-ttl 28800
max-cache-ttl 288000
###+++--- GPGConf ---+++### Mi 27 Mai 2015 08:35:06 CEST
# GPGConf edited this configuration file.
# It will disable options before this marked block, but it will
# never change anything below these lines.
➜ ~
Usually you should not do this. But since we changed the config, let’s kill a running instance and wait until gpg-agents restarts automatically when needed with the new configuration:
gpgconf --kill gpg-agent
Add Tool: Settings → Tools → External Tools
/usr/bin/subl
$FilePath$
$ProjectFileDir$
Add Keyboard shortcut:
Settings → Keymap → External Tools → External Editors → Sublime:
Add: Strg+Alt+X
apt install graphicsmagick
apt install imagemagick
# create new group htdocs
sudo groupadd htdocs
# add group 'htdocs' to user 'marble'
sudo usermod -a -G htdocs marble
# add group 'htdocs' to user 'www-data'
sudo usermod -a -G htdocs marble www-data
# logout and login again for memberships to take effect
# set user and group everywhere in 'htdocs'
sudo chown -R marble:htdocs /home/marble/htdocs
# make everything group writable
chmod -R g+w /home/marble/htdocs
# set group s bit for directories
find /home/marble/htdocs -type d -exec chmod g+s {} \;
# set umask for user
umask 002
echo "umask 002" >> ~/.zshrc
With etckeeper you may want to do:
sudo etckeeper vcs status
sudo etckeeper vcs commit "..."
Make Apache2 run with umask 002: https://serverfault.com/questions/383734/how-do-i-set-default-umask-in-apache-on-debian
To have the new umask running, check if the file /etc/apache2/envvars will be used within your Apache start file /etc/init.d/apache2:
… PIDFILE=$(. /etc/apache2/envvars && echo $APACHE_PID_FILE) …Set your umask in
/etc/apache2/envvars
:# umask 002 to create files with 0664 and folders with 0775 umask 002Restart Apache2:
# pick on line of these: sudo systemctl restart apache2 sudo systemctl restart apache2.service sudo /etc/init.d/apache2 restart sudo /usr/sbin/apachectl restart # earlier sudo service apache2 restartRun a simple test PHP script:
<?php if ($fp = fopen(time() . '.txt', 'w')) { fwrite($fp, 'This is a simple test.'); fclose($fp); echo "done"; } else { echo "error - cannot create file"; } ?>Check the difference:
ls -l *.txt -rw-r--r-- 1 www-data htdocs 22 Nov 9 13:24 1541766246.txt -rw-rw-r-- 1 www-data htdocs 22 Nov 9 13:24 1541766276.txt
When starting sublimetext there was an endless list of
Failed to load module "canberra-gtk-module"
errors on the console. To fix
this:
sudo apt install libcanberra-gtk-module
php-mode
settings the local copy of the installation
throws errors, mainly due to zero dates in the table configurations, for example datetime
values with default ‘0000-00-00 00:00:00’.Find MySQL configuration file /etc/mysql/mysql.conf.d/mysqld.cnf
Add:
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
# default for 5.7.24 and >=5.7.8 is:
# sql-mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
# https://www.sitepoint.com/quick-tip-how-to-permanently-change-sql-mode-in-mysql/
# TYPO3 for example complains:
# #1247602160: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
# 'database.tx_extkey_domain_model_sample.uid' which is not functionally dependent on columns in
# GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (More information)
sql-mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
# then continue with the regular:
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
# and so on …
Restart MySQL:
sudo systemctl restart mysql
Inotify Watches Limit: Read https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
For an intelligent IDE, it is essential to be in the know about any external changes in files it is working with - e.g. changes made by VCS, or build tools, or code generators etc. For that reason, IntelliJ platform spins background process to monitor such changes. The method it uses is platform-specific, and on Linux, it is the Inotify facility.
Inotify requires a “watch handle” to be set for each directory in the project. Unfortunately, the default limit of watch handles may not be enough for reasonably sized projects, and reaching the limit will force IntelliJ platform to fall back to recursive scans of directory trees.
To prevent this situation it is recommended to increase the watches limit (to, say, 512K):
Add the following line to either /etc/sysctl.conf file or a new *.conf file (e.g. idea.conf) under /etc/sysctl.d/ directory:
fs.inotify.max_user_watches = 524288Then run this command to apply the change:
sudo sysctl -p --systemAnd don’t forget to restart your IDE.
Note: the watches limit is per-account setting. If there are other programs running under the same account which also uses Inotify the limit should be raised high enough to suit needs of all of them.
Same as Not enough file watches.
Failed to add /run/systemd/ask-password to directory watch: No space left on device
“To see what’s consuming inotify watches, use lsof:”
sudo lsof -K | grep inotify | (less||more||pg)
“The immediate fix is to run:”
sudo -i
echo 1048576 > /proc/sys/fs/inotify/max_user_watches
exit
“The long-term fix is to edit the file /etc/sysctl.conf to include the line:”
fs.inotify.max_user_watches=1048576
Recommended by: https://youtu.be/0MuFrBr0LYE?t=316
https://pinta-project.com/pintaproject/pinta/
Pinta: Painting Made Simple. Pinta is a free, open source program for drawing and image editing. Its goal is to provide users with a simple yet powerful way to draw and manipulate images on Linux, Mac, Windows, and *BSD.
Old ‘brutal’ php.ini settings for a local dev purpose:
[Date]
date.timezone = 'Europe/Berlin'
[PHP]
display_errors = 'On'
display_startup_errors = 'On'
expose_php = 'On'
max_execution_time = '86400'
max_file_uploads = '20'
max_input_time = '600'
max_input_vars = '1500'
memory_limit = '2560M'
post_max_size = '50M'
upload_max_filesize = '50M'
[Pcre]
pcre.backtrack_limit = '1000000'
pcre.recursion_limit = '1000000'
[SQL]
sql.safe_mode = 'Off'
[mail function]
mail.add_x_header = 'On'
[xdebug]
xdebug.max_nesting_level=400
xdebug.remote_enable=1
Install shutter
The standard functionality for the ‘print’ key can’t be disabled. So change the key combintation to ‘super+print’.
Add own key combination ‘print’ for command shutter -s -c -e
Edit function does not work:
It’s not working.
snap list
snap df
snap interfaces
snap search arduino
# snap remove arduino-mhall119
# ! use '--classic', otherwise the app has no rights to access /dev/ttyUSB0
snap install arduino-mhall119 --classic
snap refresh
https://www.sublimetext.com/ A sophisticated text editor for code, markup and prose
Follow the ‘apt’ method for Ubuntu/Debian: https://www.sublimetext.com/docs/3/linux_repositories.html
Choose the ‘dev’ sources.
# Install the GPG key:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | \
sudo apt-key add -
## Ensure apt is set up to work with https sources:
## ((was not necessary for 18.04))
## sudo apt-get install apt-transport-https
## Stable
# echo "deb https://download.sublimetext.com/ apt/stable/" | \
sudo tee /etc/apt/sources.list.d/sublime-text.list
# Dev
echo "deb https://download.sublimetext.com/ apt/dev/" | \
sudo tee /etc/apt/sources.list.d/sublime-text.list
# Update apt sources and install Sublime Text
sudo apt update
sudo apt install sublime-text
Search the internet for “sublime copy settings”. Answer:
Sync folder /home/marble/.config/sublime-text-3/Packages/User
.
https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
Ubuntu, Debian, *.deb package v13.2.26559, x86 64bit
Right click, run Ubuntu deb installer. Will request admin privileges.
# Ubuntu Bionic Beaver 18.04
sudo apt update
sudo apt install sshfs
sudo /mnt/t203
# mount
sudo sshfs -o allow_other,IdentityFile=/home/marble/.ssh/id_rsa marble@192.168.1.203:/home/marble /mnt/t203
# unmount
sudo umount /mnt/t203
Install zsh: sudo apt install zsh
Run non-sudo:
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
Edit ~/.zshrc
. Make sure at least ‘git’ and ‘pass’ are in the list of plugins:
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git history jump pass z)
Internal Lenovo T570 webcam
https://help.ubuntu.com/community/Webcam
Test:
vlc v4l2:///dev/video0 # ir camera
vlc v4l2:///dev/video1 # normal camera
cheese # ir camera
cheese -d /dev/video1 # normal camera - but shows ir camera
https://askubuntu.com/questions/1062331/intergrated-webcam-not-working-after-upgrade-to-18-04
sudo apt install ffmpeg # installed. Do we need it?
sudo apt install mplayer
# do a test (this worked):
mplayer -cache 128 -tv driver=v4l2:width=640:height=480:device=/dev/video1 -vo xv tv://
dmesg | grep uvc
Conclusion:
Ubuntu 18.04 Bionic Beaver did recognize the cameras out of the box.
Nothing extra had to be done. /dev/video0
is the infrared camera,
/dev/video1
is the normal camera. Just make sure you select the correct
camera in an application like Slack.
Good!
http://ubuntuhandbook.org/index.php/2018/10/guvcview-2-0-6-released-install-ubuntu/
Install:
sudo apt install guvcview
Youtrack Jetbrains installation and upgrade
Prerequisites
To perform this installation, verify that the following prerequisites are met:
You have installed Oracle Java SE Runtime Environment 8 or later. The instructions here require that the JRE is available from the path
/usr/bin/java
. Any external hostname (proxy hostname) is resolvable from the actual host where YouTrack is installed.
https://linuxconfig.org/how-to-install-java-on-ubuntu-18-04-bionic-beaver-linux
Install Java v11:
# install java v11
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo synaptic
sudo apt install oracle-java11-installer
➜ ~ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
This installation of Java v11 works, but some Youtrack versions required an older Java. So let’s completely uninstall Java v11 and install Java v8 which does the job for Youtrack versions 6.5, 7, 2017.1, 2018.1, 2018.3 (= latest at the moment):
# Install Java v8
sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo synaptic
sudo apt install oracle-java11-installer
➜ ~ java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
New machine:
Install Java v8
We are using the ‘jar’-type installation and upgrading from 6.5
Download Youtrack JAR files for versions 7, 2017.1, 2018.1, 2018.3 (latest)
Create user ‘youtrack’
Copy
OLD MACHINE /home/youtrack/teamsysdata
to
NEW MACHINE /home/youtrack/teamsysdata
to
Upgrade step by step:
New machine:
java -jar /home/youtrack/youtrack-7.jar 0.0.0.0:8112
java -jar /home/youtrack/youtrack-2017-1.jar 0.0.0.0:8112
java -jar /home/youtrack/youtrack-2018-1.jar 0.0.0.0:8112
java -jar /home/youtrack/youtrack-2018-3.jar 0.0.0.0:8112
Install YouTrack JAR as service
Create a systemd service file in the following directory:
/etc/systemd/system/youtrack.service
.
Paste the following content into the youtrack.service file:
[Unit]
Description=Youtrack
Requires=network.target
After=syslog.target network.target
[Service]
Type=simple
WorkingDirectory=/home/youtrack
# ExecStart=/usr/bin/java -jar /home/youtrack/youtrack.jar --J-Xmx1G 8080
ExecStart=/usr/bin/java -jar /home/youtrack/youtrack.jar --J-Xmx1G 0.0.0.0:8112
User=youtrack
[Install]
WantedBy=default.target
Customize the content of the file as needed: If you want YouTrack to start on a different port number, edit the default port 8080. Add and modify other Java parameters as needed.
Use the following command to reload the systemd daemon and enable the YouTrack service on system start:
systemctl daemon-reload
systemctl enable youtrack.service
Enter the following command to run the YouTrack service:
service youtrack start
Open http://<your-host-name>:8112 in a web browser and wait for the application to become available. As it takes some time to start the application, the port may be unreachable for a short while.
We are running YouTrack on 0.0.0.0 and port 8112. This makes YouTrack available in our local network as youtrack.local.mbless.de:8112.
Important: In the firewall open port 8112 on the new machine for incoming requests.
Run netstat -tapn
to verify that YouTrack is available.
ssh-add -D # Delete all identities (from key keeper)
ssh-add -D # Delete identity (from key keeper)
ssh-add -l # List fingerprints of all identities
ssh-add --help
ssh-add -t 3600 # set lifetime for already stored keys to 1 hour
| search
| run: sudo killall unity-panel-service
|
Keywords: unicode, kbd, keyboard, compose, composekey
Look at the complete table:
less ~/XCompose
less /usr/share/X11/locale/en_US.UTF-8/Compose
About keys and keyboard layouts: