Category Archives: Linux

Create a SOCKS 5 Proxy on Top of a SSH Tunnel on Linux

Just get a cheap VPS from DigitalOcean or any other company. Then login as root to the VPS and type: ssh -N -C -q -D VPS_IP:SOCKS5_PORT -p SSH_PORT localhostssh -N -C -q -D VPS_IP:SOCKS5_PORT -p SSH_PORT localhost Here is an example: ssh -N -C -q -D 54.54.54.54:1080 -p 22 localhostssh -N -C -q -D 54.54.54.54:1080 […]

Disable Compression when Encrypting with GNU GPG

By default GPG uses RFC1950 compression when encrypting a file. Use “–compress-algo none” to disable compression on GPG: /usr/bin/gpg –trust-model always –encrypt –compress-algo none –recipient ‘YOUR KEY NAME HERE’ file.tar/usr/bin/gpg –trust-model always –encrypt –compress-algo none –recipient ‘YOUR KEY NAME HERE’ file.tar To run the command in background use: nohup /usr/bin/gpg –trust-model always –encrypt –compress-algo none […]

Linux Client Tools that Support TLS (GnuTLS, OpenSSL, Socat, Ncat, Telnet-SSL)

Here are some Linux tools that support TLS/SSL connection: 1) GnuTLS has a TLS client tool on Linux, example: gnutls-cli imap.server.com -p 993gnutls-cli imap.server.com -p 993 * Use -s for STARTTLS 2) OpenSSL supports TLS via s_client option, example: openssl s_client -connect imap.server.com:993openssl s_client -connect imap.server.com:993 * Use -starttls imap or -starttls smtp for STARTTLS […]

How to create a 1GB random file in Linux

You can use OpenSSL to create a 1 GB random file in Linux: openssl rand -out sample.txt -base64 $(( 2**30 * 3/4 ))openssl rand -out sample.txt -base64 $(( 2**30 * 3/4 )) 1 Gigabyte is like 230 bytes (you can use 10**9 for 109 bytes instead). The “* 3/4” section is for base64 overhead, making […]

Prevent less from Clearing the Screen upon Exit on Linux

To prevent less from clearing the screen upon exit you can just use -X option: -X or –no-init Disables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen. To make less exit if the content fits on one screen, […]

How to fix Warning: the ECDSA host key differs from

If you get this error while setting up password-less SSH with ssh-copy-id: Warning: the ECDSA host key for ‘server’ differs from the key for the IP address ‘192.168.1.122’ Warning: the ECDSA host key for ‘server’ differs from the key for the IP address ‘192.168.1.122’ Try to remove the cached key for the server IP address: […]

Force Apt-get to use IPv4 on Debian Linux

In some VPS or servers you may get errors when doing apt-get due to IPv6. To force apt-get to use IPv4 just type this command: echo ‘Acquire::ForceIPv4 "true";’ | tee /etc/apt/apt.conf.d/99force-ipv4echo ‘Acquire::ForceIPv4 "true";’ | tee /etc/apt/apt.conf.d/99force-ipv4 The setting will be permanent.

Install MariaDB 10.3 Server on Debian Linux

To install MariaDB 10.3 server on Debian Linux just type: apt-get install -y -q software-properties-common dirmngr apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 add-apt-repository "deb [arch=amd64,i386,ppc64el] http://mariadb.mirror.nucleus.be/repo/10.3/debian stretch main" apt-get update apt-get install mariadb-serverapt-get install -y -q software-properties-common dirmngr apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 add-apt-repository "deb [arch=amd64,i386,ppc64el] http://mariadb.mirror.nucleus.be/repo/10.3/debian stretch main" apt-get update apt-get install mariadb-server

Install Only MariaDB Client on Debian Linux

To install only MariaDB client on Debian Linux just type: apt-get install -y -q software-properties-common dirmngr apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 add-apt-repository "deb [arch=amd64,i386,ppc64el] http://mariadb.mirror.nucleus.be/repo/10.3/debian stretch main" apt-get update apt-get install mariadb-clientapt-get install -y -q software-properties-common dirmngr apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 add-apt-repository "deb [arch=amd64,i386,ppc64el] http://mariadb.mirror.nucleus.be/repo/10.3/debian stretch main" apt-get update apt-get install mariadb-client