Author Archives: bhuvan

Generate self-signed certificate with openssl

To generate self-signed certificate for a quick test or for development. If you are looking for getting certificate for production site then I strongly suggest to go for a proper certificate like LetsEncrypt. You can get it easily with certbot. To generate a self-signed SSL certificate using the OpenSSL, complete the following steps: Write down… Read More »

Extract data from postgres in docker and save it to csv

The case is simple postgres database is hosted in a docker image and to access the database use this command. docker image name can be found with this command docker ps -a. docker exec -it <docker-image> psql -U postgres docker exec -it <docker-image> psql -U postgres -a <dbname> -c “copy(select u.name user_name,p.name place_name, attempts,p.created fromplace… Read More »

Convert audio in bulk with GNU parallel

The below command will convert flac files in a folder to mp3. You can add multiple output formats in the end. Source link: https://unix.stackexchange.com/questions/487024/batch-convert-decode-audio-into-multiple-formats-with-ffmpeg

Moodle migration

Moodle migration from one server to another while upgrading to a new moodle version Enable maintenance mode before doing anything. This will make sure that there is no data lose and also inform users that the site will not be available. Plan the migration steps before starting the migration which will speed up the process… Read More »

Reset password in matrix synapse

To reset the password of matrix user in debian After login as root. Change the user to postgres At the postgres prompt connect to synapse database and update users table with new hash. generate the hash with hash_password command

encrypt and decrypt a file with password in debian

The simplest way to use gpg encrypt gpg -c filename This will ask for a password decrypt gpg filename enter the password To get extra protection use this command, But remember password is always the weakest element in symmetric encryption.

Setup a VPN tunnel with wireguard in debian

Updated on [09/10/2019] Wireguard is a new VPN (Rather than calling it a VPN its better to call it tunnel to a different system) and is experimental but much faster and very sleek. It is very straight forward and will not take more than 10 min to setup the whole thing. But if you want… Read More »