Skip to content

Instantly share code, notes, and snippets.

@jackinloadup
jackinloadup / cert-generator
Last active July 6, 2018 22:10
Self signed cert creator
#!/bin/bash
readonly PROGNAME="$(basename "$0")"
readonly PROGDIR="$(readlink -m "$(dirname "$0")")"
readonly ARGS="$@"
#readonly DAYS_IN_YEAR=365
#readonly YEARS=3
#readonly CERT_DAYS= $DAYS_IN_YEAR * $YEARS
HOSTNAME="$1"
@jackinloadup
jackinloadup / modem
Created July 2, 2018 14:42
Script to get modem correctables and uncorrectables for i3blocks
#!/bin/bash
DIR="/var/run/vpnc/defaultroute"
# IF VPN is running
if [ -a $DIR ]; then
STATUS=$(ssh 10.16.1.251 curl -s http://192.168.100.1/cgi-bin/status)
else
STATUS=$(curl -s http://192.168.100.1/cgi-bin/status)
fi
@jackinloadup
jackinloadup / generate
Created June 11, 2018 20:03
Generate SAML certificate for NISM
#!/bin/bash
readonly PROGNAME="$(basename "$0")"
readonly PROGDIR="$(readlink -m "$(dirname "$0")")"
readonly ARGS="$@"
HOSTNAME="$1"
if [ -z "$HOSTNAME" ]; then
! ------------------------------------------------------------------------------
! ! ROFI Color theme
! ! ------------------------------------------------------------------------------
!rofi.font: Hack 11
!rofi.color-enabled: true
rofi.color-window: #273238, #071218, #1e2529
rofi.color-normal: #273238, #c1c1c1, #273238, #394249, #ffffff
rofi.color-active: #273238, #80cbc4, #273238, #394249, #80cbc4
rofi.color-urgent: #273238, #ff1844, #273238, #394249, #ff1844
#!/bin/bash
# Smooth brightness control
readonly PROGNAME="$(basename "$0")"
readonly PROGDIR="$(readlink -m "$(dirname "$0")")"
readonly ARGS="$@"
function main {
@jackinloadup
jackinloadup / gist:e18b11a07dbaf22b31df85f11e4d1670
Created January 15, 2018 00:47
xresources settings for urxvt
!URxvt*background: #161616
URxvt*foreground: #FFFFFF
URxvt*cursorBlink: true
URxvt.cursorColor: #FFFFFF
!black
*color0: #222222
*color8: #666666
!red
*color1: #E84F4F
@jackinloadup
jackinloadup / gist:c46aa8751925bc8845524602ae544f56
Last active November 15, 2017 21:12
open-here - for use with uxrvt and x11. will open a terminal in the same directory as the terminal you have focused
#!/bin/bash
# Get the focused window ID
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
# Get the SHELL id
PID=$(xprop -id "$ID" | grep -m 1 PID | cut -d " " -f 3)
# get the TERM id that is running the SHELL
TERM_ID=$(pgrep -P "$PID")
# if there is a current working directory navigate to it
#!/bin/bash
# Xorg window id
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
# SHELL id
PID=$(xprop -id $ID | grep -m 1 PID | cut -d " " -f 3)
# TERM id
TERM_ID=$(pgrep -P $PID)
#echo "ID: $ID"
#echo "PID: $PID"
@jackinloadup
jackinloadup / vpn
Created January 3, 2017 05:51
vpn i3block
#!/bin/sh
usage() { echo "Usage: $0 [-i enable icon]" 1>&2; exit 1; }
lock=" "
unlock=" "
icon=" " #rocket
text="VPN"
while getopts "d:i" o;
@jackinloadup
jackinloadup / mopidy
Created January 3, 2017 05:21
mopidy for i3blocks
#!/bin/bash
#
# Author: Raphael P. Ribeiro <raphaelpr01@gmail.com>
MPCSTAT=`mpc | grep -v '^volume:'`
if [ -z "${MPCSTAT}" ]; then # if not playing, exit
echo "$line" || exit 1
else
if [ $1 == '1' ]; then # if arg = 1, show music symbols
MPCSTAT2=`echo "${MPCSTAT}" | sed 's, *, ,g; 1h;1d;2G' | head -n1 | cut -d ']' -f 1 | tr -d [`