Skip to content

Instantly share code, notes, and snippets.

View ethagnawl's full-sized avatar
🐢

Pete Doherty ethagnawl

🐢
View GitHub Profile
@ethagnawl
ethagnawl / coupon-codes.txt
Created October 30, 2017 04:59
Top 100 Ecommerce Coupon Codes
# source: https://www.slideshare.net/CouponFollow/top-100-most-common-coupon-code-phrases
fall
twitter
black
MEMORIAL
TWEET20
FREESHIP
earlybird
MONDAY
holidays
@ethagnawl
ethagnawl / i3autolock.md
Created June 24, 2023 16:56 — forked from rometsch/i3autolock.md
Configure lockscreen for i3 window manager.

The i3-wm does not come with a keybinding to lock the screen or a preconfigured auto lockscreen. This gist describes how to setup both using i3lock and xautolock. i3lock is a minimalistic lockscreen and xautolock monitors mouse and keyboard activities to automatically lock the screen after a certain time of beiing inactive.

First get the tools if neccessary. E.g. sudo apt install i3lock xautolock.

To setup the keybinding Ctrl+Alt+l (last one is a lowercase L) to lock the screen append the following lines to the i3 configuration file located at ~/.config/i3/config.

# keybinding to lock screen
@ethagnawl
ethagnawl / Install NVIDIA Driver and CUDA.md
Created February 12, 2022 19:56 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@ethagnawl
ethagnawl / doseq-with-index.clj
Created April 22, 2017 03:51
doseq with index
;; https://groups.google.com/d/msg/clojure/cBCf_ftFSw4/xBG_SfMeMBAJ
(doseq [[idx item] (map-indexed vector a-lazy-seq)]
(do-stuff! item idx))
@ethagnawl
ethagnawl / .inputrc
Last active May 5, 2021 19:54
Display Vim mode in Bash prompt
# requires >= Bash 4.3
# note: the prompt will not be updated if you use a custom PS1 which contains a newline character
set editing-mode vi
set keymap vi-command
set show-mode-in-prompt on
# if it's configured correctly, your prompt will be prefixed with a `+` while in insert mode and a `:` when in command mode.
@ethagnawl
ethagnawl / .tmux.conf
Created June 7, 2020 13:29
tmux pane titles
# tmux config file
# the rest of your config file ...
# This example creates a variable named `custom_pane_title` which will be
# displayed if and only if it has been set -- in this case by by your
# tmuxinator pane commands.
# This feature doesn't seem to be documented, otherwise I'd provide a link.
# I _believe_ this feature requires tmux >= 3.0
set -g pane-border-format "#{pane_index}#{?@custom_pane_title,:#{@custom_pane_title},}:#{pane_title}"
@ethagnawl
ethagnawl / gist:78c1d0945400987b29d8a0b281ecea0a
Created April 14, 2020 17:10
Find Raspberry Pi IP using arp-scan
sudo arp-scan --localnet 2> /dev/null | grep Pi | awk '{print $1}'
# https://www.postgresqltutorial.com/postgresql-indexes/postgresql-list-indexes/
SELECT
tablename,
indexname,
indexdef
FROM
pg_indexes
WHERE
schemaname = 'public'
ORDER BY
@ethagnawl
ethagnawl / pg_stat_activity.sql
Created January 18, 2020 03:13
view postgres clients
select pid as process_id,
usename as username,
datname as database_name,
client_addr as client_address,
application_name,
backend_start,
state,
state_change
from pg_stat_activity;
@ethagnawl
ethagnawl / README.md
Last active October 31, 2019 02:48
Deploying a Hakyll site with Haskell/Shelly

Deploy

stack exec deploy