All About My Custom Hugo Theme KMT

My ToDo List for 2024 (daily updates)

Zig Will Succeed

A Complete Guide to Docker | Cheatsheet

What is docker ? 🔗 Docker is a platform for developing, deploying, and running applications in standardized units called containers. These containers package the application’s code, libraries, and dependencies, ensuring it runs consistently across different environments. Think of it like shipping containers for software, making it easier and faster to move your application around without worrying about compatibility issues. Why Docker ? 🔗 Portability: Docker apps run consistently across different environments, from development machines to production servers, avoiding the “it works on my machine” problem.

How to get the stdout of a command into the clipboard on Ubuntu Linux ?

Pre-installed Commandline Tools on Ubuntu 🔗 xsel comes preintalled in Ubuntu Linux. Actually XSEL is pre-installed with XServer if you are using it. You can copy with xsel like this. echo "text to be copied" | xsel -ib Or copy by directing the output of text files like that. xsel -ib < ~/.bashrc You can paste the copied text into the standard output by this command. xsel -ob Or just use the command without any arguments.

How to get the stdout of a command into the clipboard on Mac OS ?

Mac OS Native Commandline Tools 🔗 Mac OS comes with pbcopy to copy text, and pbpaste to paste the previously copied text. You can copy with pbcopy like this. pbcopy < id_bus_ssh_pass.txt or piping the standard output (stdout) into standard input (stdin) of pbcopy. cat id_bus_ssh_pass.txt | pbcopy You can use pbpaste to print out the previously copied text. pbpaste spits out the text into the standard output (stdout). So, you can use it in scripts like this.

How to get a text file from a server I already SSHed into ?

I ssh into my server via this command. sudo ssh -i /Users/mbp/.ssh/authorized_keys/id_bus [email protected] When I click enter, I should write the sudo password. Then I write the password of the SSH key (id_bus). Make sure you use the main domain name of your shared hosting or dedicated VPS. So, I use SCP to download a text file from my server using SSH key identity by this command. sudo scp -i /Users/mbp/.

Software I Use

I share with you all software I use as a software developer. Here is the list of all programs, apps, .. all software products and services. Web Browser 🔗 I use Google Chrome, Google Chrome Dev, Mozilla Firefox, Firefox Developer Edition, Apple Safari, Microsoft Edge and Brave. As a full stack web developer I need to use them all for testing websites. I striked out the web browsers I uninstalled from my main work machine/laptop.

Vim cheatsheet | navigation, editing, insert mode, visual mode

Vim is an efficient text editor used in terminal (CLI). Vim is mostly used by programmers. There is a new VIM fork called NeoVIM or nvim. It is great and modern with better capabilities. All things in this cheatsheet works on vim and nvim. Exiting Vim 🔗 :q : close file (if it is the only file in vim, vim will be exited too). (a.k.a quit vim) :qa: close all files.

How to rename all files inside a directory to a sequence of incremented files in FISH shell ?

rename all files inside a specific directory/folder 🔗 First of all, change directory (cd) into the directory where the files exist. cd /path/to/your/directory/ Use this command to rename all images (ending with .png) to a number sequence. set i 1 for file in * mv $file (printf "%02d.png" $i) set i (math $i + 1) end The command explained 🔗 set i 1 creates a variable called i and set its value to 1.

How to support multiligual links to tags and categories in Hugo ?

I faced this issue in my custom Hugo theme. I use kmt theme on this website you are reading on. It is bilingual. You find blog posts in English and their translations in Arabic. But when I click on a tag in the Arabic part of the website, it is 404 NOT FOUND ! what?! The problem is that the tag link is /tags/the-tag-itself but to work it needs to be /ar/tags/the-tag-itself.

How to remove all directories inside a specific directory?

How to remove directories in Terminal 🔗 To remove all directories inside a specific directory, you can use the rm command with the -r (recursive) option. This option ensures that the command removes directories and their contents recursively. Here is the command you can use: rm -r /path/to/your/directory/*/ This command will remove all directories and their contents inside /path/to/your/directory/. Make sure that you include a / at the end to tell that you want to delete directories not files.

Vulnerable WordPress Release Not Yet Fixed

Today, I checked my WordPress website inside my shared hosting > CPanel > WP toolkit. I ran into this screen. It says Fix vulnerability in security. I clicked on it. A security scanning process stated. After the scan completed, It stated that my current WordPress core release is vulnerable. It is affected by unauthorized blind server-side request forgery vulnerability. I clicked on mitigate to reduce the risk of the vulnerability if it is exploited.