linux
Docker - Update Portainer
sudo docker stop portainersudo docker rm portainerRemove the portainer-ce image using the docker UI
sudo docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /volume1/docker/portainer:/data portainer/portainer-ceCopy file out of container
docker cp docker_web_1:/etc/apache2/sites-enabled/apache2.conf .(correct the file)
docker cp apache.conf docker_web_1:/etc/apache2/sites-enabled/apache2.confPostfix commands
List all emails - you can list all mail of queue, using one of the following commands:
<strong>postqueue -p</strong>
Flush all emails - To delete or flush all emails from Postfix mail queue using the following command:
<strong>postsuper -d ALL </strong>
Flush deferred mails only - use the following command to delete deferred emails from the queue.
<strong>postsuper -d ALL deferred </strong>
vi editor - A quick cheat sheet
:x Exit, saving changes.
:w Save file.
:q Exit if no changes have been made.
:q! Exit and undo any changes made.
r Replace one character.
x Delete character to the right of cursor.
i Insert before cursor.
o Open a new line below current line.
dd Delete current line.
With Esc we can swap from command mode to input mode and viceversa.
Recude PDF size
convert -density 100x100 -quality 60 -compress jpeg input.pdf output.pdfKade - Find with Regex
(?=cow).*(?=milk)
Check URLs status and save in a CSV file the result
This is a bash command.
xargs -n1 -P 10 curl -o /dev/null --silent --head --write-out '%{url_effective};%{http_code};%{time_total};%{time_namelookup};%{time_connect};%{size_download};%{speed_download}\n' < url.lst | tee results.csv- url.lst: url list
- results.csv: csv file
Restart network services
sudo service network-manager restartWake up by usb device
echo enabled > /sys/bus/usb/devices/3-11/power/wakeupHow can I reduce the file size of a PDF file?
ps2pdf input.pdf output.pdf