Skip to content

Instantly share code, notes, and snippets.

View billwanjohi's full-sized avatar

Bill Kaguru Wanjohi billwanjohi

View GitHub Profile
@probonopd
probonopd / Wayland.md
Last active July 17, 2024 09:17
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

The Wayland project seems to operate like they were starting a greenfield project, whereas at the same time they try to position Wayland as "the X11 successor", which would clearly require a lot of thought about not breaking, or at least providing a smooth upgrade path for, existing software.

In fact, it is merely an incompatible alternative, and not e

@dardo82
dardo82 / mac-passwd2hashcat.sh
Created June 2, 2019 18:26
OSX user PW to HC format
#!/bin/sh
sudo dscl . read /Users/$USER ShadowHashData | tail -1 | xxd -p -r | plutil -convert xml1 - -o - | sed s/data/string/ | plutil -convert json - -o $USER.json
ITERATIONS=$(jq '."SALTED-SHA512-PBKDF2".iterations' $USER.json)
SALT=$(jq '."SALTED-SHA512-PBKDF2".salt' $USER.json | sed -E 's/"?\\n\\t\\t"?//g' | base64 -D | xxd -c 256 -p)
ENTROPY=$(jq '."SALTED-SHA512-PBKDF2".entropy' $USER.json | sed -E 's/"?\\n\\t\\t"?//g' | base64 -D | xxd -c 256 -p | cut -c -128)
echo "\$ml\$$ITERATIONS\$$SALT\$$ENTROPY" > $USER.hash
hashcat -m 7100 --example-hashes | awk '/HASH/{print $2}' > example.hash
hashcat -a 3 -m 7100 example.hash "?l?l?l?l?l?l?l"
@akamyshanov
akamyshanov / gmail-auto-archive.js
Created September 18, 2018 09:29
GMail Auto Archive script for Google Scripts
function gmailAutoarchive() {
var threads = GmailApp.search("in:inbox label:auto-archive older_than:2d");
Logger.log("found " + threads.length + " threads:");
for(var i = 0; i < threads.length; i++) {
var thread = threads[i];
Logger.log((i+1) + ". " + thread.getFirstMessageSubject());
}
var batch_size = 100;
@jasonrdsouza
jasonrdsouza / combineS3Files.py
Last active June 3, 2023 17:22
Python script to efficiently concatenate S3 files
'''
This script performs efficient concatenation of files stored in S3. Given a
folder, output location, and optional suffix, all files with the given suffix
will be concatenated into one file stored in the output location.
Concatenation is performed within S3 when possible, falling back to local
operations when necessary.
Run `python combineS3Files.py -h` for more info.
'''
@526avijitgupta
526avijitgupta / spacemacs-cheatsheet.md
Last active August 29, 2023 12:31
Spacemacs cheatsheet

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@benhagen
benhagen / awscreds_encrypt.sh
Last active January 6, 2023 19:05
BASH script to take your two AWS environment vars, and encrypt them via AES-256. Store these values in a generated shell script which can be sourced to apply the variables when the correct password is given.
#!/bin/bash
read -sp "Enter encryption password: " PASSWORD
echo ""
read -sp "Confirm encryption password: " PASSWORD_CONFIRM
echo ""
if [[ "$PASSWORD" != "$PASSWORD_CONFIRM" ]]; then
echo "ERROR: Passwords do not match!"
exit 1
@jamster
jamster / gist:3796181
Created September 27, 2012 20:08 — forked from davist11/gist:1204569
Campfire sounds
56k: "https://123.campfirenow.com/images/56k.gif"
bueller: "anyone?"
clowntown: "https://123.campfirenow.com/images/clowntown.gif"
crickets: "hears crickets chirping"
dangerzone: "https://123.campfirenow.com/images/dangerzone.png"
deeper: "https://123.campfirenow.com/images/top.gif"
drama: "https://123.campfirenow.com/images/drama.jpg"
greatjob: "https://123.campfirenow.com/images/greatjob.png"
heygirl: ":sparkles::information_desk_person::sparkles:"
horn: ":dog: :scissors: :cat:"
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 16, 2024 16:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname