Skip to content

Instantly share code, notes, and snippets.

View jaredallard's full-sized avatar
:shipit:

Jared Allard jaredallard

:shipit:
View GitHub Profile
@kelvie
kelvie / 0001-Add-a-lockdown_hibernate-parameter.patch
Created October 2, 2022 23:39
Enable hibernate during lockdown
From e4db4f07e77feb1c126e7afbf441e9eae34b4e57 Mon Sep 17 00:00:00 2001
From: Kelvie Wong <[email protected]>
Date: Sun, 2 Oct 2022 13:23:25 -0700
Subject: [PATCH] Add a lockdown_hibernate parameter
This allows the user to tell the kernel that they know better (namely,
they secured their swap properly), and that it can enable hibernation.
Signed-off-by: Kelvie Wong <[email protected]>
---
! 5/3/2018, 9:36:51 AM https://twitter.com/
twitter.com##.has-content.roaming-module.js-wtf-module.wtf-module.module
! 5/3/2018, 9:37:01 AM https://twitter.com/
twitter.com##.trends.Trends.module
! 5/3/2018, 9:37:09 AM https://twitter.com/
twitter.com##.js-moments-tab.moments > .js-dynamic-tooltip.js-tooltip.js-nav
@HacKanCuBa
HacKanCuBa / sshd_config
Last active December 21, 2024 15:38
Modern secure SSH daemon config
# Modern secure (OpenSSH Server 7+) SSHd config by HacKan
# Refer to the manual for more info: https://www.freebsd.org/cgi/man.cgi?sshd_config(5)
# Server fingerprint
# Regenerate with: ssh-keygen -o -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa -b 4096
HostKey /etc/ssh/ssh_host_rsa_key
# Regerate with: ssh-keygen -o -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519
HostKey /etc/ssh/ssh_host_ed25519_key
# Log for audit, even users' key fingerprint
@nicbou
nicbou / ChromeCastService.js
Created November 20, 2017 22:04
[JS] How to send videos with subtitles to a ChromeCast device
class ChromeCastService {
constructor() {
this.castSession = null;
this.sessionRequest = new chrome.cast.SessionRequest(chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID);
const apiConfig = new chrome.cast.ApiConfig(
this.sessionRequest,
(session) => { // sessionListener
console.log('Received ChromeCast session', session)
this.castSession = session;
@Neo23x0
Neo23x0 / nmap-cmdline
Last active March 19, 2020 17:10
Nmap Scan Params for CVE-2017-0143 MS17-010 Scanning
# Scan for CVE-2017-0143 MS17-010
# The vulnerability used by WannaCry Ransomware
#
# 1. Use @calderpwn's script
# http://seclists.org/nmap-dev/2017/q2/79
#
# 2. Save it to Nmap NSE script directory
# Linux - /usr/share/nmap/scripts/ or /usr/local/share/nmap/scripts/
# OSX - /opt/local/share/nmap/scripts/
#
@ericelliott
ericelliott / defaults-overrides.md
Last active May 7, 2023 13:52
ES6 defaults / overrides pattern

ES6 Defaults / Overrides Pattern

Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.

function foo ({
    bar = 'no',
    baz = 'works!'
  } = {}) {
@mb-tmatsuoka
mb-tmatsuoka / __svn_ps1.sh
Created August 20, 2012 02:06
define __svn_ps1 like __git_ps1
__svn_ps1() {
if [[ -d .svn ]]; then
local url=$(svn info | awk '/URL:/ {print $2}')
local repo=$(echo $url | sed 's/^.*\/\(trunk\|branches\|tags\)/\1/')
if $SVN_PS1_SHOWDIRTYSTATE; then
svn st | grep -e '^[MA]' > /dev/null 2>&1
local modified=$(echo $? | sed 's/0/+/' | sed 's/1//')
svn st | grep '^?' > /dev/null 2>&1
local added=$(echo $? | sed 's/0/*/' | sed 's/1//')
fi
@amcgregor
amcgregor / 00-header.sh
Last active April 10, 2025 21:08
A convenient motd-creation script for Gentoo servers.
#!/bin/sh
# Place in /etc/motd.d and drop the .sh suffix.
echo -e "\n\033[1mWelcome to Gentoo Linux!\033[0m"
echo -e "\nThis server is maintained by \033[1m$(cat /etc/maintainer)\033[0m."
echo -e "Contact \033[1m$(cat /etc/maintainer-address)\033[0m for support."
echo en "\n \033[1;32m*\033[0m "