Skip to content

Instantly share code, notes, and snippets.

View sonulohani's full-sized avatar
🏠
Working from home

Sonu Lohani sonulohani

🏠
Working from home
View GitHub Profile
@sonulohani
sonulohani / fonts_utils.md
Created October 10, 2023 04:21
fonts utilities

Pull images

podman pull <image-name>

Example: podman pull docker.io/library/ubuntu:22.04


Create container

@sonulohani
sonulohani / temp_throttle.service
Created August 25, 2022 06:41
Temp throttle systemd service
[Unit]
Description=Temp throttle
[Service]
Type=oneshot
ExecStart="/usr/local/bin/temp_throttle" 90
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
@sonulohani
sonulohani / starship.toml
Last active September 29, 2022 07:55
My startship config
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = true
# Replace the "❯" symbol in the prompt with "➜"
[character] # The name of the module we are configuring is "character"
success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green"
error_symbol = "[✖](bold red) "
@sonulohani
sonulohani / find_cmd.txt
Created June 26, 2022 15:15
Find tutorial
https://www.tecmint.com/35-practical-examples-of-linux-find-command/
https://geekflare.com/linux-find-commands/
@sonulohani
sonulohani / yay_helper.txt
Created December 22, 2021 06:22
yay_helper
# Remove the orphaned packages with Yay
yay -Yc
# Search for a package
yay -Ss package_name
# Remove a package
yay -Rns package_name
@sonulohani
sonulohani / patch_and_apply.md
Last active April 23, 2021 05:49
How to create git patch and apply between two commits

Creating the GIT Patch

The following command creates a single .patch file that contains multiple commits.

git format-patch cc1dde0dd^..6de6d4b06 --stdout > foo.patch

You can then apply it like so:

git am foo.patch
Note: Be sure to use ^.. instead of .. if you want the first commit SHA to be included.

@sonulohani
sonulohani / build_info.md
Last active April 21, 2021 06:03
Ubuntu source built packages(needs after every full-upgrade)

CMake

sudo apt-get build-dep cmake-qt-gui
./configure --qt-gui

libmypaint

./autogen.sh    # Only needed when building from git.
./configure

Fix stuck at dell logo boot

sudo pacman -Syyu haveged
sudo systemctl enable haveged --now

Swappiness

First, check the default swappiness value. Run in a terminal:

cat /proc/sys/vm/swappiness

git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\] \[\033[01;31m\]\$(git_branch)\[\033[00m\]\$ "