How to check if package is installed
To check if ca-certificates package is installed run this command:
dpkg -s ca-certificates
To check if ca-certificates package is installed run this command:
dpkg -s ca-certificates
To print exit code of the last command type:
echo $?
If you want to inspect what queries exactly Django ORM sends to the PostgreSQL, you can do it with postgres logging. The first step is to enable logging. Add
log_statement = 'all'
to the file:
sudo vim /etc/postgresql/9.4/main/postgresql.conf
Then you are able to see raw SQL queries with command:
sudo tail -f /var/log/postgresql/postgresql-9.4-main.log
Sometimes I’m unable to create a database in UTF8 encoding because the template database is in the ASCII encoding. To fix it we need to recreate template database in UTF8. Start psql console:
psql -U postgres
Run the following commands:
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
DROP DATABASE template1;
CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
\c template1
VACUUM FREEZE;
Open configuration file:
sudo vim /etc/sysctl.d/90-override.conf
Add the following line to the end of the file to increase watches limit:
fs.inotify.max_user_watches = 524288
First step is to find the name of the USB stick in the system:
sudo fdisk -l
In my case the name of the device is /dev/sdc If the USB stick is mounted, unmount it with command:
sudo umount /dev/sdc
Finally, run the command to format USB stick:
mkdosfs -F 32 -I /dev/sdc
Remove all *.pyc files from the current directory (and subdirectories):
find . -name \*.pyc -delete
Remove
text/plain=komodo-edit-9.desktop
from file
~/.local/share/applications/defaults.list
To start an application automatically in fedora, you need to create a *.desktop file in the directory ~/.config/autostart, for example:
gedit ~/.config/autostart/flux.desktop
The content of the file can be something like:
[Desktop Entry]
Type=Application
Name=flux
Comment=xflux
Exec=/home/jsn/app/xflux -l 52.3837151 -g 4.8806328
Terminal=false
If you need to find out, for example, which package in fedora provides htpasswd command, you may do it with the command:
yum provides \*bin/htpasswd