Skip to content

Instantly share code, notes, and snippets.

View sarangnx's full-sized avatar
👨‍💻
Working From Home

Sarang N sarangnx

👨‍💻
Working From Home
View GitHub Profile
@sarangnx
sarangnx / docker-logs-cleanup.sh
Created June 6, 2023 06:20
Delete logs of all docker containers
#!/bin/bash
container_ids=$(docker ps -q)
for container_id in $container_ids; do
sudo truncate -s 0 $(docker inspect --format='{{.LogPath}}' "$container_id")
done
@sarangnx
sarangnx / commands.sh
Last active May 23, 2023 10:29
Some random useful shell commands
# enable autofocus of webcam
sudo v4l2-ctl -d 1 -c focus_automatic_continuous=1
# fix save dialog freezing brave
# https://community.brave.com/t/brave-browser-freezes-on-uploading-or-downloading-any-file-in-ubuntu/453578/10
dconf write /org/gnome/desktop/sound/input-feedback-sounds false
@sarangnx
sarangnx / touchegg.conf
Created February 7, 2022 17:49
Custom config for JoseExposito/touchegg
<touchégg>
<settings>
<property name="animation_delay">150</property>
<property name="action_execute_threshold">20</property>
<property name="color">auto</property>
<property name="borderColor">auto</property>
</settings>
<application name="All">
@sarangnx
sarangnx / cm
Last active January 5, 2021 15:34
Git Semantic commit.
#!/bin/bash
printUsage() {
cat <<EOM
Usage: cm [OPTION]... [MESSAGE]
Options:
--scope,-s Scope of the change.
Commit Types
--bulid Changes related to configs, dependencies etc.
@sarangnx
sarangnx / nginxconfig
Last active October 26, 2019 08:53
Nginx configuration example
#redirect all request to port 80 to 443 ( http -> https )
server {
listen 80;
server_name servername;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
@sarangnx
sarangnx / .bashrc
Last active October 7, 2020 08:34
bashrc settings
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[ \1 ] /'
}
PS1="\[\033[02;37m\]\$(git_branch)\[\033[00m\]\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\W \[\033[00m\]\$ "
# Git commit using emoji
cm() {
# Menu