Skip to content

Instantly share code, notes, and snippets.

@waseem
waseem / query.graphql
Last active July 22, 2022 17:56
Github GraphQL repo commit history for commits made before a certain commit.
query {
repository(owner: "rails", name:"rails") {
ref(qualifiedName:"master") {
target {
... on Commit {
id
#
# We're are requesting commits in the multiple of 5. We can assume that the page size here is 5.
# Next page/cursor should use value in next multiples of 5s. So next page will have a
# after: "05eaa07627376626902bd7acde35406edf1bb2f2 5"
@pjbgf
pjbgf / disable-automount-service-account-default.yaml
Created March 8, 2018 22:01
Disable the auto-mount for the default Service Account
apiVersion: v1
kind: ServiceAccount
metadata:
name: default
automountServiceAccountToken: false
@rbnpi
rbnpi / ReadMe.md
Last active December 23, 2018 05:05
Recorder Player for Sonic Pi Read the accompanying article at https://rbnrpi.wordpress.com/project-list/sonic-pi-3-player-recorder-using-touchosc/ for details of setup. Also there is a video at https://youtu.be/2yoJ2ygs0xM

Sonic Pi Record / Player

The three other files enable a TouchOSC interface to be used with Sonic Pi 3 and above to allow notes to be played on Sonic Pi, and also recorded in real time for subsequent replay. Recordings can also be stored in files on your computer. NB spRecordPlayer.rb changed to release 1.0.1 line 144 updated "piano,"pluck" changed to :piano,:pluck

The two Sonic Pi programs should be loaded into separate buffers, where they are both run. At any time you can re-run either file. If you ever press the stop button you must re-run both.

$ node -v
v8.4.0
$ node --v8-options | grep gc
--gc_global (always perform global GCs)
--gc_interval (garbage collect after <n> allocations)
--retain_maps_for_n_gc (keeps maps alive for <n> old space garbage collections)
--trace_gc (print one trace line following each garbage collection)
--trace_gc_nvp (print one detailed trace line in name=value format after each garbage collection)
--trace_gc_ignore_scavenger (do not print trace line after scavenger collection)
--trace_gc_verbose (print more details following each garbage collection)
@timmartin
timmartin / gist:556b8552735312c0093b4594053c6335
Created January 27, 2018 16:52
Terraform rules for CloudWatch events triggering CodeBuild
provider "aws" {
region = "us-east-1"
}
resource "aws_codecommit_repository" "test" {
repository_name = "BuildTestRepository"
}
resource "aws_codebuild_project" "build_test" {
name = "BuildTest"
#!/usr/bin/env ruby
require 'base64'
require 'digest'
require 'openssl'
# Author: @thesubtlety
# Decrypts Jenkins 2 encrypted strings, code change introduced around Jenkins ver 2.44
# Based off work by juyeong, https://gist.github.com/juyeong/081379bd1ddb3754ed51ab8b8e535f7c
@bwann
bwann / README.md
Last active May 5, 2024 02:47
Tunnelling SSH over SSL/TLS

How to tunnel SSH over SSL/TLS

laptop ssh -> laptop stunnel -> evil network -> internet -> your server -> your server ssh

Server (your shell server/home box/work box/whatever)

Sets up a stunnel process listening externally on port 2443/tcp, forwards to localhost 22/tcp

  • Install stunnel, e.g. yum install stunnel
  • Install server config snippet to /etc/stunnel/stunnel.conf
@nuboli
nuboli / lambda-s3-integration-resources-access-iam-policy.json
Last active November 10, 2017 21:31
AWS IAM - Grant Access to Resources required for a Lambda-S3 Integration Raw
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListExistingFunctions",
"Effect": "Allow",
"Action": [
"lambda:ListFunctions",
"lambda:ListVersionsByFunction",
"lambda:ListAliases",
@wryun
wryun / example-aws-mock.js
Last active November 16, 2017 10:26
Mocking js aws-sdk using sinon (rough notes)
beforeEach(function () {
this.aws = {};
stubAwsRequest(stubs);
});
afterEach(function () {
AWS.Request.prototype.runTo.restore();
});
AWS.Request.prototype.originalRunTo = AWS.Request.prototype.runTo;
@ammario
ammario / goth
Created September 2, 2016 16:27
golang test coverage html
#!/bin/bash
go test -coverprofile=coverage.out
go tool cover -html=coverage.out