Skip to content

Instantly share code, notes, and snippets.

View ai7ch's full-sized avatar
:octocat:
Git-tying up some code

ai7ch ai7ch

:octocat:
Git-tying up some code
View GitHub Profile
@ai7ch
ai7ch / psql-with-gzip-cheatsheet.sh
Created November 9, 2021 12:42 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@ai7ch
ai7ch / jwtRS256.sh
Created February 2, 2022 07:17 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@ai7ch
ai7ch / .psqlrc
Created October 30, 2022 11:26 — forked from jaytaylor/.psqlrc
My .psqlrc file.
-- Found at:
-- http://www.if-not-true-then-false.com/2009/postgresql-psql-psqlrc-tips-and-tricks/
-- http://opensourcedbms.com/dbms/psqlrc-psql-startup-file-for-postgres/
\set QUIET ON
\pset pager always
\pset null 'NULL'
@ai7ch
ai7ch / git-commit-log-stats.md
Created April 26, 2023 13:02 — forked from eyecatchup/git-commit-log-stats.md
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@ai7ch
ai7ch / regular_expression_engine_comparison.md
Created September 13, 2023 13:56 — forked from CMCDragonkai/regular_expression_engine_comparison.md
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html

@ai7ch
ai7ch / calendar
Created November 6, 2023 15:43 — forked from phuntik/calendar
i3blocks notify-send calendar
#! /bin/bash
send_current() {
TODAY=$(date '+%-d')
month=$(ncal -bhM)
BODY=$( tail -n7 <<< $month | sed -z "s/$TODAY/<span bgcolor='white' color='black'>$TODAY<\/span>/1" | sed "s/\(.*\)\(.\{7\}\)$/\1<span color='IndianRed'>\2<\/span>/")
HEAD=$(echo "$month" | head -n1)
notify-send -u critical \
"$HEAD" "$BODY"
}