Category Archives: Linux

How to Create Backups of MySQL via PHP

If you website is hosted on a web hosting like OVH, you should make sure to periodically backup your MySQL database as additional precaution, just in case the automated backup offered by the hosting provider fails. With OVH, for example, you can create cronjobs that execute PHP files located in your FTP home directory, here […]

Transfer files from a VPS to a FTP web hosting server

How to transfer files from a VPS to a FTP web hosting server? First login via SSH to your VPS. With “scp” you can transfer files from your VPS to the FTP server. Open the directory you want to copy to the other server, i.e: cd /home/user/wwwcd /home/user/www This command will copy files and folders […]

E: Sub-process /usr/bin/dpkg returned an error code (2)

If you get this error message while running apt-get install: dpkg: error: dpkg status database is locked by another process E: Sub-process /usr/bin/dpkg returned an error code (2)dpkg: error: dpkg status database is locked by another process E: Sub-process /usr/bin/dpkg returned an error code (2) Just type this to fix that error: dpkg –configure -adpkg […]

Linux -bash: Input/output error or -bash: Read-only file system

If suddenly your Linux server show these messages: -bash: /usr/bin/who: Input/output error -bash: .bash_history: Read-only file system -bash: /bin/df: Input/output error-bash: /usr/bin/who: Input/output error -bash: .bash_history: Read-only file system -bash: /bin/df: Input/output error Ask your hosting company to check your server for hardware issues. most probably the hard-disk is broken/damaged.

How to Correctly Backup and Restore /etc/letsencrypt

Simple steps to correctly backup and restore /etc/letsencrypt folder. First you need to compress /etc/letsencrypt with tar: tar czf /root/letsencrypt.tar.gz /etc/letsencrypttar czf /root/letsencrypt.tar.gz /etc/letsencrypt To restore it on another server make sure to preserve symlinks! Copy /root/letsencrypt.tar.gz on the new server. Uncompress letsencrypt.tar.gz with gunzip: gunzip letsencrypt.tar.gzgunzip letsencrypt.tar.gz Then uncompress the .tar archive using tar […]

How to Install OpenSSH SSHD Server on Debian Linux

You can install OpenSSH sshd server under Debian via apt-get. First make sure apt-get repositories are up-to-date: apt-get updateapt-get update Then you can install OpenSSH server: apt-get install openssh-serverapt-get install openssh-server By default OpenSSH sshd server opens port 22, check it with netstat: netstat -tulpn | grep :22netstat -tulpn | grep :22 Recommended: Check out […]

Enable IPv6 on a Scaleway VPS After a Reboot

If you have a Scaleway VPS with IPv6 enabled, you may have noticed that after a reboot the public (global) IPv6 address is not present. So after each reboot you may need to run this bash script to re-enabled the public IPv6 address (inet6 2001:*): #!/bin/bash # Load all IPv6 setting from the metadata service […]

Get Public IPv6 Address on Debian Linux

To get the public IPv6 address on a Debian server, type: /sbin/ip -6 addr | grep inet6/sbin/ip -6 addr | grep inet6 You should get something like this: inet6 ::1/128 scope host inet6 2001:123:456:55f::1/64 scope global inet6 fe80::62eb:69ff:fed2:d2a6/64 scope linkinet6 ::1/128 scope host inet6 2001:123:456:55f::1/64 scope global inet6 fe80::62eb:69ff:fed2:d2a6/64 scope link The line that contains […]