Posts

Setup a Raspberry Pi Static IP Address

 In this tutorial, I use Raspbian operating system. How to setup a Raspberry Pi Static IP Address. Recommended Raspberry Pi Micro SD Card Power Supply Ethernet Cord or WiFi dongle (The Pi 3 and 4 has WiFi inbuilt) Step 1: we will first need to retrieve some information about your network ip r | grep default Step 2 : Retrieve the current DNS server and opening up the “resolv.conf” configuration file sudo nano /etc/resolv.conf Setting nameserver alternative DNS – such as 8.8.8.8 for Google, or 1.1.1.1 for Cloudflare. Step 3: modify the way the Raspberry Pi handles the network. sudo nano /etc/dhcpcd.conf Add lines as below: interface <NETWORK> static ip_address=<STATICIP>/24 static routers=<ROUTERIP> static domain_name_servers=<DNSIP> • NETWORK – your network connection type: eth0 (Ethernet) or wlan0 (wireless). • STATIC_IP – the static IP address you want to set for the Raspberry Pi. • ROUTER_IP – the gateway IP address for your router on the local network. • D

Fixed Wordpress plugin install Could not create directory

Image
 In this tutorial, How to Fixed wordpress plugin install could not create directory. I'm using Nginx, PHP 7.4 and WordPress on Ubuntu 21.04.  After install and configure wordpress completed. I have update plugin and could not create directory. I installed into a wordpress directory in /var/www . Nginx does not have permissions to write to the wp-content directory. Wordpress plugin SEO Error Installing Plugin: SEO 17.0 Downloading install package from https://downloads.wordpress.org/plugin/seo.17.0.zip… Unpacking the package… Could not create directory. How to do it Fixed Step 1: Getting the connection information Create new file whoami.php into /var/www/huuphan.com/ directory. For example, the content as below root@localhost:~# cat /var/www/huuphan.com/whoami.php <?php echo(exec("whoami")); ?> root@localhost:~# Curl url or type domain in browser as below  root@localhost:~# curl https://huuphan.com/whoami.php huupv root@localhost:~# Step 2: Change owner of the word

Rclone backup all VPS to microsoft onedrive

In this tutorial, How to use Rclone backup all VPS to microsoft onedrive. It's very simple, free to backup all to Cloud with Rclone. Rclone supports a lot of Cloud services Google Drive Amazon S3 Openstack Swift / Rackspace cloud files / Memset Memstore Dropbox Google Cloud Storage Amazon Drive Microsoft OneDrive Hubic Backblaze B2 Yandex Disk SFTP The local filesystem Install Rclone on VPS Link direct download here : I use Ubuntu server on VPS. cd /root/ wget https://downloads.rclone.org/rclone-current-linux-amd64.zip unzip rclone-current-linux-amd64.zip cp rclone-v*-linux-amd64/rclone /usr/sbin/ rm -rf rclone-* Rclone command basic rclone config – Configure the connection to the cloud service. rclone copy – Copy files from server to cloud, skip if data already exists. rclone sync – Synchronize between server and cloud, only update data on cloud. rclone move – Move files from server to cloud. rclone delete – Delete the data of the folder. rclone purge – Deletes the data of the fol

Issue Let's Encrypt certificates for multiple websites Nginx

In this tutorial, How to Issue Let's Encrypt certificates for multiple websites Nginx Let's Encrypt is a free and open-source Prerequisites Ubuntu instance with a LEMP stack installed. Two valid domain name. My example, devopsroles.com and huuphan.com You have access shell login VPS. You neeed install package certbot python3-certbot-nginx on your system. Let's Encrypt Certificates and Nginx Configure Certbot Let's Encrypt certificates for the first website Let's Encrypt free SSL for website. you run command the following certbot --nginx -d huuphan.com you see the following output: root@localhost:~# certbot --nginx -d huuphan.com Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator nginx, Installer nginx Cert not yet due for renewal You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry. (ref: /etc/letsencrypt/renewal/huuphan.com.conf) What would you like t

How to Install Caddy on Ubuntu

 In this tutorial, How to install Caddy on Ubuntu. The Caddy web server is an open-source web server written in Go. It is designed around simplicity and security that comes with a number of features that are useful for hosting websites. Caddy is both a flexible, efficient static file server and a powerful, scalable reverse proxy. Prerequisites A Ubuntu OS. A root user access or normal user with administrative privileges.  1. Update your system # apt update -y && apt upgrade -y 2. Install Caddy # curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo apt-key add - # curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee -a /etc/apt/sources.list.d/caddy-stable.list # apt update After install Caddy on Ubuntu server. # apt install caddy 3. Open your browser and enter your server IP or domain name: http://Server-IP OR http://yourdomain.com 4. Configure Domain with Caddy Create a directory for your website files # mkdir -

How to installing Docker in Raspberry Pi 4

  In this tutorial. How to installing Docker in Raspberry Pi 4 1. Setup OS in the Raspberry Pi I used Ubuntu OS. 2. Update your system $ sudo apt update && sudo apt upgrade 3. Install basic packages $ sudo apt install net-tools git openssh-server Setting up Docker $ sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - $ sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" $ sudo apt-get update $ apt-cache policy docker-ce $ sudo apt-get -y install docker-ce $ sudo usermod -aG docker ${USER} Installing Docker Compose $ sudo apt install python3-pip $ sudo pip3 install docker-compose The basic command docker compose Then deploy the application: $ docker-compose up -d Find what docker-compose is running with the following command: $ docker-compose ps To remove the application $ docker-compose down  

curl command cheat sheet

In this tutorial, I have compiled a comprehensive curl command cheat sheet. Curl is a powerful command-line tool for making HTTP requests and working with various protocols. The cheat sheet is designed to serve as a quick reference guide, providing concise and organized information on the essential curl commands. Whether you're a beginner or an experienced user, this resource aims to simplify the usage of curl commands, helping you navigate and leverage its capabilities efficiently. Feel free to explore the cheat sheet and enhance your proficiency in utilizing curl for various web-related tasks. curl command cheat sheet Option -o <file>       # --output: write to file -u user:pass  # --user: Authentication -v                  # --verbose -s                  # --silent -I                  # --head: headers only -i                  # --include: Include the HTTP-header in the output Request -X POST          # --request -L                     # follow link if page redirects -F  

How to enable SSH 2FA on AlmaLinux

Image
 In this tutorial, How to enable two-factor authentication (2FA) for SSH logins.  Install the Google Authenticator on AlmaLinux sudo dnf install epel-release -y sudo dnf install google-authenticator qrencode qrencode-libs -y After install completes, I will create a new secret key in ~/.ssh directory Run command as follows google-authenticator -s ~/.ssh/google_authenticator The output terminal as below [root@DevopsRoles ~]# google-authenticator -s ~/.ssh/google_authenticator Do you want authentication tokens to be time-based (y/n) y Warning: pasting the following URL into your browser exposes the OTP secret to Google:   https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/[email protected]%3Fsecret%3DDXFSMCJ42VQ7FPMS2VAJ3CIJIE%26issuer%3DDevopsRoles.com Your new secret key is: DXFSMCJ42VQ7FPMS2VAJ3CIJIE Your verification code is 222214 Your emergency scratch codes are:   36072722   12212187   31577834   31344084   92578576 Do you want me to update y

speed test command line linux

Image
 In this tutorial, How to  run a Speedtest from your command line. The requirement Nodejs version > 8+.    Install speed test command line [vagrant@localhost ~]$ wget https://nodejs.org/dist/v14.15.4/node-v14.15.4.tar.gz [vagrant@localhost ~]$ tar xvf node-v14.15.4.tar.gz [vagrant@localhost ~]$ cd node-v14.15.4/ [vagrant@localhost node-v14.15.4]$ sudo ./configure [vagrant@localhost node-v14.15.4]$ sudo make [vagrant@localhost node-v14.15.4]$ sudo make install Use NPM install speed test [vagrant@localhost ~]$ sudo npm install --global speed-test  The result, Install speed-test [vagrant@localhost node-v14.15.4]$ sudo npm install --global speed-test /usr/local/bin/speed-test -> /usr/local/lib/node_modules/speed-test/cli.js + [email protected] updated 2 packages in 10.4s [vagrant@localhost node-v14.15.4]$ Usage speed-test [vagrant@localhost node-v14.15.4]$ speed-test --help   Test your internet connection speed and ping using speedtest.net from the CLI   Usage     $ speed-test   Optio

Rasberry Pi 4 can't connect to WiFi ubuntu server [fixed]

 In this tutorial, How to connect to WiFi ubuntu server on Rasberry Pi  4. Today, I buy Rasberry PI 4 new and install ubuntu 20.04 LTS. root@ubuntu:~# cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS" root@ubuntu:~#  after finish, Rasberry Pi 4 no identify ip address of wilfi. :D.  Rasberry Pi 4 can't connect to WiFi ubuntu server [fixed] The first, check network interface your system. ll -la /sys/class/net/ Create new file config for wifi " /etc/netplan/wlan.yaml" apply configure and reboot netplan apply The result, as below root@ubuntu:~# ll -la /sys/class/net/ total 0 drwxr-xr-x  2 root root 0 Jan  1  1970 ./ drwxr-xr-x 74 root root 0 Jan  1  1970 ../ lrwxrwxrwx  1 root root 0 Jan  1  1970 eth0 -> ../../devices/platform/scb/fd580000.ethernet/net/eth0/ lrwxrwxrwx  1 root root 0 Jan  1  1970 lo -> ../../devices/virtual/net/lo/ lrwxrwxrwx  1 root root 0 Apr  1  2020 wlan0 -> ../.