Skip to content

Instantly share code, notes, and snippets.

View richdouglasevans's full-sized avatar
✌️

Rich richdouglasevans

✌️
  • Oxford, England
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 22, 2024 17:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
<powershell>
write-output "Running User Data Script"
write-host "(host) Running User Data Script"
# Set TZ
#cmd.exe /c tzutil /s \"Pacific Standard Time\"
cmd.exe /c net user /add packer packer
cmd.exe /c net localgroup administrators packer /add
cmd.exe /c wmic useraccount where "name='packer'" set PasswordExpires=FALSE
@LuRsT
LuRsT / json_for_humans.py
Created February 27, 2015 12:38
Json for humans
from json import loads as json_decode
from json import dumps as json_encode
@LHSimon
LHSimon / netrunnerRedirect.html
Created April 20, 2015 23:39
This is designed to redirect to a random Netrunner card from http://netrunnerbd.com. I threw it together to work with the New Tab Redirect Chrome extension (https://chrome.google.com/webstore/detail/new-tab-redirect/icpgjfneehieebagbmdbhnlpiopdcmna?hl=en). It could all be done a lot better, but this was quick and it's done :-)
<html>
<head>
<script type="text/javascript">
var baseUrl = 'http://netrunnerdb.com/en/card/';
var maxSetId = 8;
var cardsCoreSet = 119;
var cardsBigBox = 55;
var cardsCycle = 120;
@mefellows
mefellows / BundleConfig.ps1
Last active December 25, 2023 23:33
Sysprepped Windows AMI using Packer
$EC2SettingsFile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Settings\\BundleConfig.xml"
$xml = [xml](get-content $EC2SettingsFile)
$xmlElement = $xml.get_DocumentElement()
foreach ($element in $xmlElement.Property)
{
if ($element.Name -eq "AutoSysprep")
{
$element.Value="Yes"
}
@benfoxall
benfoxall / runkeeper-export.sh
Last active April 20, 2018 20:47
A bash script for exporting runkeeper data.
# Requires:
# a) `jq` to be installed
# b) A Bearer token (you can grab this from the healthgraph debug console)
export BEARER=MY_TOKEN_FROM_THE_CONSOLE
curl https://api.runkeeper.com/fitnessActivities?pageSize=100 -H "Authorization: Bearer $BEARER" > page1.json
curl https://api.runkeeper.com/fitnessActivities?pageSize=100&page=2 -H "Authorization: Bearer $BEARER" > page2.json
curl https://api.runkeeper.com/fitnessActivities?pageSize=100&page=3 -H "Authorization: Bearer $BEARER" > page3.json
@LuRsT
LuRsT / Dockerfile
Created September 19, 2015 10:31
Dockerfile for `hr`
FROM debian
RUN apt-get update && apt-get install -y curl
RUN curl https://raw.githubusercontent.com/LuRsT/hr/master/hr > /bin/hr
RUN chmod +x /bin/hr
@ygotthilf
ygotthilf / jwtRS256.sh
Last active July 22, 2024 13:05
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@kangax
kangax / quicksort.hs
Last active September 5, 2021 19:44
Haskell-inspired quick sort in ES6
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let smallerSorted = quicksort (filter (<=x) xs)
biggerSorted = quicksort (filter (>x) xs)
in smallerSorted ++ [x] ++ biggerSorted
@ericclemmons
ericclemmons / example.md
Last active July 17, 2024 06:50
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here