Skip to content

Instantly share code, notes, and snippets.

@sainak
sainak / using-multiple-github-accounts-with-ssh-keys.md
Last active January 27, 2023 07:23 — forked from oanhnn/using-multiple-github-accounts-with-ssh-keys.md
Using multiple github accounts with ssh keys
@sainak
sainak / tts.py
Last active December 25, 2025 01:06
tts using google gstatic dictionary
#!/usr/bin/env python3
# ./tts.py hello world
import requests, string, os
from playsound import playsound
from sys import argv
text = (
" ".join(argv[1:]).lower().translate(str.maketrans("", "", string.punctuation)).split(" ")
)
@sainak
sainak / 10-quirks.conf
Last active May 9, 2021 06:27 — forked from jgkim2020/10-quirks.conf
Fix for MSI laptop random screen brightness bug(Xorg only)
# MSI laptop random screen brightness bug
# https://askubuntu.com/questions/777754/brightness-randomly-up-and-down-on-msi-laptop/808785#808785
# /etc/X11/xorg.conf.d/10-quirks.conf
Section "InputClass"
Identifier "Spooky Ghosts"
MatchProduct "Video Bus"
Option "Ignore" "on"
EndSection
@sainak
sainak / 70-videobus.rules
Created May 8, 2021 21:24
udev rule to ignore input events form video bus. this fixes backlight changing randomly.
ACTION=="add", SUBSYSTEM=="input", ATTR{name}=="*Video Bus*", ATTR{phys}=="*LNXVIDEO*", ATTR{inhibited}="1"
@sainak
sainak / fish.fish
Created May 7, 2021 20:51
install fish
#install fish
paru -S fish pkgfile
#setup command not found
sudo pkgfile -u && sudo pkgfile makepkg
#install oh-my-fish
curl -L https://get.oh-my.fish | fish
#install theme
@sainak
sainak / postgresql-setup.sh
Created May 7, 2021 20:48
setup postgres in arch linux
##############################################################
#setup postgresql
sudo pacman -S postgresql && \
sudo mkdir /var/lib/postgres/data && \
sudo chown -c -R postgres:postgres /var/lib/postgres && \
sudo -i -u postgres
initdb -D '/var/lib/postgres/data'
logout
@sainak
sainak / 50-udisks.rules
Last active May 5, 2021 11:23
udisks rules to let wheel group users mount drives without authentication
#Create the file /etc/polkit-1/rules.d/50-udisks.rules with permissions 644, and with the following contents:
polkit.addRule(function(action, subject) {
var YES = polkit.Result.YES;
var permission = {
// only required for udisks2:
"org.freedesktop.udisks2.filesystem-mount": YES,
"org.freedesktop.udisks2.encrypted-unlock": YES,
"org.freedesktop.udisks2.eject-media": YES,
"org.freedesktop.udisks2.power-off-drive": YES,
@sainak
sainak / rotate.sh
Created April 16, 2021 12:43
a script to rotate screen by 180 degrees on linux
#!/bin/bash
# Location for file to save rotation state
TOGGLE=/tmp/.toggle
if [ ! -e $TOGGLE ]; then
touch $TOGGLE
xrandr -o inverted
else
rm $TOGGLE
@sainak
sainak / mirrorlist
Last active December 17, 2024 06:50
pacman mirrorlist
# https://cloudflaremirrors.com/
Server = https://cloudflaremirrors.com/archlinux/$repo/os/$arch
Server = https://download.nus.edu.sg/mirror/archlinux/$repo/os/$arch
Server = https://mirror.osbeck.com/archlinux/$repo/os/$arch
Server = https://asia.mirror.pkgbuild.com/$repo/os/$arch
Server = https://mirror.f4st.host/archlinux/$repo/os/$arch
Server = https://mirror.f4st.host/archlinux/$repo/os/$arch
Server = https://mirror.chaoticum.net/arch/$repo/os/$arch
Server = https://archlinux.mailtunnel.eu/$repo/os/$arch
Server = https://archlinux.uk.mirror.allworldit.com/archlinux/$repo/os/$arch
@sainak
sainak / 10-quirks.conf
Created January 2, 2021 20:23
fix msi laptop brightness changing randomly
#append this to
#/usr/share/X11/xorg.conf.d/10-quirks.conf
#Brightness changes randomly
#https://ubuntuforums.org/showthread.php?t=2314161&page=2&p=13465220#post13465220
Section "InputClass"
Identifier "Spooky Ghosts"
MatchProduct "Video Bus"
Option "Ignore" "on"