Skip to content

Instantly share code, notes, and snippets.

View dharple's full-sized avatar

Doug Harple dharple

View GitHub Profile
@dharple
dharple / post-main-fix.md
Last active February 11, 2023 13:48
Switch checkout from master to main

After renaming master to main on GitHub, run:

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
git fetch --prune
@krisleech
krisleech / renew-gpgkey.md
Last active May 12, 2024 16:55
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@folbert
folbert / _display-bootstrap-size.scss
Last active December 29, 2021 17:43
Display current Bootstrap v4 size on screen
/*
Inspired by https://www.viget.com/articles/check-your-breakpoint-using-this-simple-css-snippet
*/
body:after {
color: #000;
font-family: Helvetica;
font-size: 12px;
padding: 5px;
font-weight: bold;
@jcberthon
jcberthon / networkmanager-wifi-powersave.md
Last active April 22, 2024 14:33
NetworkManager Wi-Fi powersaving configuration

NetworkManager WiFi Power Saving

NetworkManager supports WiFi powersaving but the function is rather undocumented.

From the source code: wifi.powersave can have the following value:

  • NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
  • NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
  • NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
@jrelo
jrelo / gcc-security.txt
Last active May 18, 2024 01:13
GCC security related flags reference.
Source material:
http://security.stackexchange.com/questions/24444/what-is-the-most-hardened-set-of-options-for-gcc-compiling-c-c
https://wiki.gentoo.org/wiki/Hardened_Gentoo
https://wiki.debian.org/Hardening
================================================================================================================>
GCC Security related flags and options:
CFLAGS="-fPIE -fstack-protector-all -D_FORTIFY_SOURCE=2"
LDFLAGS="-Wl,-z,now -Wl,-z,relro"