Linux touch command for Windows

Create touch.cmd with the following content and it to ENV Path. @echo off setlocal enableextensions disabledelayedexpansion (for %%a in (%*) do if exist “%%~a” ( pushd “%%~dpa” && ( copy /b “%%~nxa”+,, & popd ) ) else ( type nul

Things to do after deploying a Ubuntu server

Disable ipv6 Create /etc/sysctl.d/60-ipv6-disable.conf with the following contents: net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 Run service procps restart Change timezone Source: timedatectl set-timezone Asia/Kolkata # or use dpkg-reconfigure tzdata Change hostname To do this read:

LEMP stack in WSL

add-apt-repository ppa:nginx/stable add-apt-repository ppa:ondrej/php apt-key adv –recv-keys –keyserver hkp:// 0xF1656F24C74CD1D8 add-apt-repository ‘deb [arch=amd64,arm64,i386,ppc64el] xenial main’ apt update && apt upgrade -y apt install nginx-extras mariadb-server php7.3-fpm php7.3-pdo php7.3-mysql php7.3-zip php7.3-gd php7.3-mbstring php7.3-curl php7.3-xml phpdismod opcache service mysql start mysql_secure_installation

Add additional IP addresses to Ubuntu

Login as root then enter command nano /etc/network/interfaces If have something like this on that file iface enp1s0f0 inet static address netmask gateway 123.444.123.1 Then to add additional ips, have it like this iface enp1s0f0 inet static address

Tweaking WSL (Windows Subsystem for Linux)

Use ‘exp’ command to open Windows Explorer Login as root in WSL then: touch /etc/profile.d/ nano /etc/profile.d/ Add the below lines to alias exp=”explorer.exe .” Now, reload settings using . ~/.profile . /etc/profile Done. Now whenever you type exp

Upgrade cURL to latest version on Ubuntu

Tested on Ubuntu 16.04 only. Login as root then do the following: mkdir latestcurl cd latestcurl apt build-dep curl If E: Unable to find a source package for curl error appears then do the following otherwise skip the below part. sed

Things to do after installing RunCloud

Some few things I do after connecting a server to runcloud. MySQL Create /etc/mysql/conf.d/custom_config.cnf with the following contents: [mysqld] # Disable binary log skip-log-bin # Set default MySQL character set and collation # Source: character-set-server = utf8mb4 collation-server =

Useful Linux Commands

Run command without output command > /dev/null 2>&1 Run command in background without output nohup command > /dev/null 2>&1 & List all files recursively find -type f -printf “%[email protected] %p\n” | cut -d\ -f2- Search for specific file recursively find

Increase Swap in Linux

Swap space is fake memory that is actually disk space. The purpose of swap space is to be emergency overflow memory. Normally, if your server runs out of memory, the Linux kernel has to decide which processes to kill to

Install & Use Geekbench 4 on Linux

Geekbench is a cross-platform processor benchmark tool with a scoring system that separates single-core and multi-core performance and workloads that simulate real-world scenarios. The higher Geekbench score means the better and faster CPU. To install log in on your server