Skip to content

Instantly share code, notes, and snippets.

View rjl6789's full-sized avatar

Rob rjl6789

  • England
View GitHub Profile
@rjl6789
rjl6789 / chroot-to-pi.sh
Created August 28, 2019 08:07 — forked from htruong/chroot-to-pi.sh
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
@rjl6789
rjl6789 / squash-commits.md
Created July 17, 2019 05:24 — forked from longtimeago/squash-commits.md
How to squash commits in a GitHub pull request

How to squash commits in a GitHub pull request

o you've contributed some code to an open source project, say, Rails. And they'd like you to squash all of the commits in your pull request. But you're not a git wizard; how do you make this happen?

Normally, you'd do something like this. I'm assuming upstream is a git remote that is pointing at the official project repository, and that your changes are in your 'omgpull' branch:

@rjl6789
rjl6789 / dunst-archwiki.md
Last active July 8, 2019 10:49
dunst - basic indicator bar based on arch wiki and associated links

From Arch wiki

Source

Tips and tricks

Using dunstify as volume/brightness level indicator You can use the replace id feature to implement a simple volume or brightness indicator notification like in this picture [2].

To realize that volume indicator place the following script somewhere on your PATH.

Encrypted SWAP hibernation in Debian 9+

It took me about 6 hours to find out all of this, but after reading a ton of man pages, initram scripts, and bug reports, I got a working result that takes about 2' to set up...

The point is to have a SWAP partition encrypted with LUKS, and it should be decypted during boot.

When using SysV, initram hooks and scripts in Debian worked like a charm but then, Systemd came and it's not yet fully implemented so this kind of crap happens. Systemd's cryptsetup doesn't support parameters in /etc/crypttab so using a script there is ignored:

/* Options Debian's crypttab knows we don't:
@rjl6789
rjl6789 / brightnessControl.sh
Created July 7, 2019 18:26 — forked from Blaradox/brightnessControl.sh
Notifications for brightness and volume, using dunstify
#!/usr/bin/env bash
# You can call this script like this:
# $ ./brightnessControl.sh up
# $ ./brightnessControl.sh down
# Script inspired by these wonderful people:
# https://github.com/dastorm/volume-notification-dunst/blob/master/volume.sh
# https://gist.github.com/sebastiencs/5d7227f388d93374cebdf72e783fbd6a
! Xresourses is read by C preprocessor - variables are defined
#ifndef MON_DPI
#define MON_DPI 96
#endif
#ifndef CURSOR_SIZE
#define CURSOR_SIZE 24
#endif
#ifndef FONT_SIZE
@rjl6789
rjl6789 / dwm-ru_gaps-6.2.diff
Created May 30, 2019 08:42
some minor corrections and tidy up of dwm-ru_gaps-6.2.diff and associated bottomstack patch
diff -up 6.2/config.def.h ru/config.def.h
--- 6.2/config.def.h 2019-05-30 09:01:26.113367993 +0100
+++ ru/config.def.h 2019-05-30 08:48:06.076698048 +0100
@@ -2,6 +2,7 @@
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
+static const unsigned int gappx = 5; /* gaps between windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */