How to force resync between PBIS and AD on Linux

In case you made a change on your AD, such as modifying groups or changing attributes of a user, it sometimes take a little while to reflect that on the Linux server that authenticates against AD via PBIS.

The best solution in that case is to clear the pbis cache and force pbis to sync immediately via this command:

sudo /opt/pbis/bin/ad-cache --delete-all


Posted in Linux | Tagged , , , , | Leave a comment

How to change max open files for nginx server on Ubuntu

The following error occurred a lot in /var/log/nginx/error.log:

Too many open files

This means that the nginx master process reached the maximum number of open files which was set to the default of 4096. (To check it, simply cat /proc/pid/limits, where pid is the process id)

To resolve, this, edit /lib/systemd/system/nginx.service and add the following line:

LimitNOFILE=30000 #change it according to your needs

Then reload the systemctl daemon:

sudo systemctl daemon-reload

and finally restart the nginx service:

sudo service nginx restart

That’s it, the error is gone!

Tested on Ubuntu 16.04 with nginx 1.17, should work with any other OS using systemd.



Posted in Linux, Ubuntu | Tagged , , , , , | Leave a comment

Add a new HDD to a VM without rebooting on Ubuntu server

Firstly, install scsitools package:

sudo apt install scsitools

Then run the command rescan-scsi-bus:

sudo rescan-scsi-bus

That’s it, your new virtual HDD has now been detected.

Another way would be to do it with a loop and without the need for that package:

for host in ls /sys/class/scsi_host/; do
echo "- - -" > /sys/class/scsi_host/${host}/scan;



Posted in Linux | Tagged , , , | Leave a comment

A cute little screenshot and annotation tool on Linux

A very handy screenshot tool that works very well on my KDE plasma desktop on Ubuntu 19.10 is ksnip, which you can get from here:

Just download and install the deb file and that’s it!


Posted in Linux | Tagged , , , | Leave a comment

Restart network manager indicator in KDE Plasma Desktop

sudo service NetworkManager restart

Note: This is specifically for the network icon in the system tray and is different from the network-manager service which controls the whole Linux network manager:

Tested on Ubuntu 19.10 with KDE Plasma 5.16.5


Posted in Linux | Tagged , , | Leave a comment

Copy with rsync over ssh

From remote server to local one:

rsync -avzhe ssh remote_user@REMOTE_IP:/remote_folder_or_file /local_destination_folder_or_file

From local server to remote one:

rsync -avzhe ssh local_folder_or_file remote_user@REMOTE_IP:/remote_destination_folder_or_file

That’s it, Enjoy!


Rsync (Remote Sync): 10 Practical Examples of Rsync Command in Linux

Posted in Linux | Tagged , , | Leave a comment

Build Synergy in Ubuntu 19.04

Synergy software, which shares your keyboard and mouse to multiple computers through the network, is no longer available in the Ubuntu 19.04 repos, so the only remaining option is to build it from source:

sudo apt install qtcreator qtbase5-dev cmake make g++ xorg-dev libssl-dev libx11-dev libsodium-dev libgl1-mesa-glx libegl1-mesa libcurl4-openssl-dev libavahi-compat-libdnssd-dev qtdeclarative5-dev libqt5svg5-dev libsystemd-dev git build-essential
git clone
cd synergy
mkdir build
cd build
cmake ..
sudo make install

That’s it, Enjoy!

Note: After starting Synergy, you don’t have to enter the serial to get basic functionality, just cancel and you are good to go.


Posted in Linux, Ubuntu | Tagged , | Leave a comment