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 / nvim_cheats.md
Created April 14, 2025 04:02
Neovim Cheatsheet

colemak-cheatsheet

@sonulohani
sonulohani / config
Last active March 29, 2025 05:47
Ghostty
font-family = "RecMonoCasual Nerd Font"
font-size = 10
theme = catppuccin-mocha
gtk-titlebar = true
window-decoration = true
gtk-adwaita = false
cursor-style = block
cursor-style-blink = false
shell-integration-features = no-cursor
gtk-tabs-location = bottom
@sonulohani
sonulohani / docker.md
Created January 2, 2025 13:05
Docker
  1. docker build -t ubuntu_rolling_image .
  2. docker run -d -it --name ubuntu-rolling -v /home/sonul:/home/ubuntu --user ubuntu ubuntu_rolling_image zsh
  3. docker exec -it <container_id> zsh
  4. docker ps -a
  5. docker stop $(docker ps -q)
  6. docker rm -f <container_id>
  7. docker start my_container
  8. docker run -it --rm --privileged --net=host -e DISPLAY=$DISPLAY -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY -e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR --name ubuntu-rolling --user=$(id -u):$(id -g) -v /home/sonul/Documents/docker/InsideDocker/home/ubuntu:/home/ubuntu -v /run/user/$(id -u):/run/user/1000 -v /tmp:/tmp ubuntu_rolling_image zsh
  9. for running gui apps and audio do this in docker container: sudo chown -R 1000:1000 /run/user/1000/*
  10. For running nvidia in docker, follow this (link][https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html] and after setup use --gpus=all in docker run
@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 / AG tutorial.md
Last active November 20, 2024 09:26
AG tool cheatsheet
  • Find files containing "foo", and print the line matches in context: ag foo
  • Find files containing "foo" in a specific directory: ag foo path/to/directory
  • Find files containing "foo", but only list the filenames: ag -l foo
  • Find files containing "FOO" case-insensitively, and print only the match, rather than the whole line: ag -i -o FOO
  • Find "foo" in files with a name matching "bar": ag foo -G bar