Create Swapfile

Swapfile and swap-partitions are rarely used now-a-days. But they still have one major use case which is hibernation. Use the following Commands to create and enable swapfile Commands sudo fallocate -l 6G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile then change fstab (/etc/fstab) so it automatically mounts your swap file on startup /swapfile none swap sw 0 0 Afterward, check if your swap file is operating properly with htop....

November 15, 2023 84 words 1 min

Optimizing Linux Boot Time

Boot time is how much time it takes to boot your computer when you press your power button. A lot of things can slow down your boot on Linux. In this article we will discuss this in detail. Systemd optimizations Disabling unnecessary services systemd-analyze is a command available on systemd distros (which most distros are). It shows which service is using more time to load and you can disable that service....

Disable Core Dumps

Setting Limits Edit /etc/security/limits.conf Append the following lines * hard core 0 * soft core 0 Disabling setgid and setuid programs from core dumping Edit /etc/sysctl.d/9999-disable-core-dump.conf or /etc/sysctl.conf Append the following lines fs.suid.dumpable=0 kernel.core_pattern= |/bin/false

Autologin Linux

Getting one click boot is very satisfactory but you should know the security risks asscoiated with it. Nevertheless, here is the guide to Setup Autologin. Configuring TTY Replace ar0177417 with your username /sbin/agetty -n -N -i -a ar0177417 tty1 38400 linux Autostarting Display Server Replace Hyprland or startx with your desired WM or startx for xorg For Fish Shell Add this to your fish config if status is-login if test -z "$DISPLAY" -a "$XDG_VTNR" = 1 export LIBSEAT_BACKEND=logind exec dbus-run-session Hyprland &> /dev/null end end if status is-interactive # Commands to run in interactive sessions can go here end For Bash Shell Add this to ~/....

September 09, 2023 121 words 1 min

Basic Git Cheatsheat

Git is a very powerful version control and a project managing tool. Every dev has to use git for projects. Below is my git cheatsheat. Below are some basic commands and some settings every developer should know Basics git init for initiating a git repo in a folder git add to add file/folder to staging area git commit to commit changes git push to publish changes to remote git status to check status of git repo including staged and unstaged changes Branches You can use branches for making a copy of repo, implementing a feature and then merging it back to main branch...

Effortless Directory Regeneration Using Pacman

I was trying to edit /etc/pam.d and fix elogind on my Artix Installation. Unfortunately, It went badly and I messed up my pam.d directory.However, I Found a Fix. In pacman, It is very easy to check files owned by packages. So, We can simply generate a list of packages which have files in pam.d and reinstall them. Steps Remove Files to be regenerated Then, Stock Files are regenerated by using the following command: For Bash Shell pacman -S $(pacman -Ql | grep /etc/pam....

Blocking Ads on Spotify

Are you tired of constantly being interrupted by ads while listening to your favorite music on Spotify? If so, you’re in luck! I just stumbled upon SpotX, the Spotify ad blocker that will revolutionize the way you listen to music. SpotX and BlockTheSpot are simple, lightweight tools that blocks all ads on Spotify, allowing you to enjoy uninterrupted music all day long. With SpotX, you no longer have to put up with annoying ads or pay for a premium subscription to get rid of them....