Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Akhil 4khi1

🎯
Focusing
Block or report user

Report or block 4khi1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@4khi1
4khi1 / import-rds-certs.sh
Created Jan 25, 2020 — forked from shareefhiasat/import-rds-certs.sh
import RDS certificates to java keystore on alpine / osx
View import-rds-certs.sh
#!/usr/bin/env sh
#i tried it and working like charm just have to note make the file .sh chmod +x and you may need sudo to run with permission but be carefull with sudo
#be sure the $JAVA_HOME is configure correctly or make it static as commentedline 7 below
OLDDIR="$PWD"
if [ -z "$CACERTS_FILE" ]; then
# you should have java home configure to point for example /usr/lib/jvm/default-java/jre/lib/security/cacerts
CACERTS_FILE=$JAVA_HOME/jre/lib/security/cacerts
fi
View akhil.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCej5+ZVYorX/XUrRJGCtqEWvEcv/tAsxrwCzeJDQmINfoeDcHz5oumnT6hYs3izMaGCc0UKi8ibsktmKYeECvWFNJeHHclM+NEgsF85E9eq/E07BetuD6JefA8FetgkuvtAjhB+Rir9fF4a4YPnVshEh7e0dwaw7bG4WcJ1rrSbWePWoPjCEEISNUHKUmAW7KlN53WXIGlw7G1cPbGUG9372cfgWEW37DYCgeTCd7/mdXqFZe5xGui6phafzHh68fitmdRsEAlOlJkGKrT1hDJnj5oa5mNtZ1qJipkQT4EU1m4xi9SzgisBaKJEP+/xC5N2wu7+KFIF+jhYU5ZOMm1 akhil
@4khi1
4khi1 / net-speed-and-brightness.sh
Created Nov 26, 2019
display brightness and net speed on i3 status bar
View net-speed-and-brightness.sh
#!/bin/sh
# Authors:
# - Moritz Warning <moritzwarning@web.de> (2016)
# - Zhong Jianxin <azuwis@gmail.com> (2014)
# - Akhil Jalagam <contact@akhil.io> (2019)
#
# See file LICENSE at the project root directory for license information.
#
# i3status.conf should contain:
@4khi1
4khi1 / NC-MySQLDUMP.sh
Last active Oct 31, 2019 — forked from vanjos/NC-MySQLDUMP.sh
Easy way to do a mysqldump and restore using netcat... with and without encryption
View NC-MySQLDUMP.sh
#!/bin/bash
#####
# You'll be needing two machines, the target machine and source one (makes sense, right)?
# without encryption
#####
# On the target machine
nc -l 55555 | gzip -d -c | mysql <database name> -u<user> -p<password> [ | <decrypt> ]
@4khi1
4khi1 / nginx.conf
Last active Oct 31, 2019 — forked from abraae/nginx.conf
grafana proxying dashboard queries based on user account...
View nginx.conf
worker_processes 2;
events {
worker_connections 1024;
}
http {
# access_log off;
access_log /var/log/nginx/access.log;
@4khi1
4khi1 / dmenu_path
Created Oct 24, 2019 — forked from webstrand/dmenu_path
dmenu_path supporting bash aliases
View dmenu_path
#!/bin/bash
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
if [ -d "$cachedir" ]; then
cache=$cachedir/dmenu_run
else
cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~
fi
IFS=:
if stest -dqr -n "$cache" $PATH; then
compgen -ac | sort -u | tee "$cache"
@4khi1
4khi1 / apps-bin-path.sh
Created Sep 19, 2019 — forked from luispabon/apps-bin-path.sh
Snap app support in shell
View apps-bin-path.sh
# shellcheck shell=sh
# Expand $PATH to include the directory where snappy applications go.
snap_bin_path="/snap/bin"
if [ -n "${PATH##*${snap_bin_path}}" -a -n "${PATH##*${snap_bin_path}:*}" ]; then
export PATH=$PATH:${snap_bin_path}
fi
# Ensure base distro defaults xdg path are set if nothing filed up some
# defaults yet.
@4khi1
4khi1 / pre-commit.sh
Created Sep 18, 2019 — forked from milancermak/pre-commit.sh
Python pre-commit hook
View pre-commit.sh
#!/bin/sh
# make sure requirements.txt is up to date with every commit
# by comparing the output of pip freeze
pip freeze | diff requirements.txt - > /dev/null
if [ $? != 0 ]
then
echo "Missing python module dependencies in requirements.txt. Run 'pip freeze > requirements.txt' to update."
exit 1
fi
@4khi1
4khi1 / git-auto-sign-commits.sh
Created Sep 18, 2019 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
View git-auto-sign-commits.sh
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@4khi1
4khi1 / bind.c
Created Jun 28, 2019
bind interface
View bind.c
/*
Copyright (C) 2000 Daniel Ryde
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
You can’t perform that action at this time.