Skip to content

Instantly share code, notes, and snippets.

View faceleg's full-sized avatar

Michael Robinson faceleg

  • Auckland, New Zealand
View GitHub Profile
@allanlw
allanlw / webpack-exec-on-compile.js
Last active February 21, 2021 08:33
POC for executing webpack code through webpack imort magic comments
/*
It's possible to execute arbitrary code during webpack execution by abusing the magic
comment feature documented here: https://webpack.js.org/api/module-methods/#magic-comments
These comments eventually get executed by `vm.runInContext` which is well-known to be unsafe
at https://github.com/webpack/webpack/blob/v4.43.0/lib/Parser.js#L2338
This is an example payload that reads process.env, ps aux and /etc/passwd and posts to localhost:8080.
Reported to NPM security for webpack July 12th, 2020, but considered not a bug.
@faceleg
faceleg / faceleg.json
Last active January 14, 2020 02:57
QMK Keymap for Redox W
{"keyboard":"redox_w","keymap":"faceleg","layout":"LAYOUT","layers":[["KC_ESC","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","TG(3)","KC_Q","KC_W","KC_E","KC_R","KC_T","TG(1)","TG(2)","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_EQL","LGUI(KC_C)","KC_A","KC_S","KC_D","KC_F","KC_G","KC_LBRC","KC_RBRC","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","LGUI(KC_V)","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_LCTL","KC_DEL","KC_TAB","KC_RCTL","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RALT","LCA(KC_I)","KC_GRV","KC_LEFT","KC_RGHT","KC_LGUI","KC_BSPC","KC_LSFT","KC_ENT","KC_SPC","KC_RGUI","KC_UP","KC_DOWN","KC_BSLS","RGUI(KC_SPC)"],["KC_TRNS","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_VOLU","KC_TRNS","KC_EXLM","KC_AT","KC_LCBR","KC_RCBR","KC_PIPE","KC_TRNS","KC_TRNS","KC_MRWD","KC_P7","KC_P8","KC_P9","KC_MUTE","KC_VOLD","KC_TRNS","KC_HASH","KC_DLR","KC_LBRC","KC_RBRC","KC_GRV","KC_TRNS","KC_TRNS","KC_MFFD","KC_P4","KC_P5","KC_P6","KC_MSTP","KC_BRIU
@miguelmota
miguelmota / setup.config
Last active July 26, 2021 15:42
Elastic Beanstalk NGINX rewrite http to https using .ebextensions
files:
"/etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf":
mode: "000755"
owner: root
group: root
content: |
server {
listen 80;
gzip on;
@tache
tache / hook.rb
Last active January 11, 2018 21:08 — forked from asimihsan/hook.rb
Hook for letsencrypt.sh to do DNS challenges
#!/usr/bin/env ruby
require 'aws-sdk'
require 'pry'
require 'awesome_print'
require 'domainatrix'
# ------------------------------------------------------------------------------
# Credentials
# ------------------------------------------------------------------------------
@Manouchehri
Manouchehri / idea.properties
Created November 20, 2015 18:22
idea.properties for zero latency typing in Intellij IDEA 15
editor.zero.latency.typing=true
@RobertoSchneiders
RobertoSchneiders / deploy_with_ebcli3_on_circleci.md
Last active December 4, 2023 09:07
Settings to deploy to AWS Elastic Beanstalk on CircleCi (EB Cli 3)

This is how I configured the deploy of my rails apps to AWS Elastic Beanstalk through CircleCI 1.0.

If you are using the Circle CI 2.0, take a look at this article from ryansimms

Configure Environments Variables

On Project Settings > Environment Variables add this keys:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
    The aws user must have the right permissions. This can be hard, maybe, this can help you.
@vikrant2mahajan
vikrant2mahajan / Angular Sanitize HTML Filter
Last active August 28, 2020 10:08
Angular sanitize safe HTML filter to user with angular ng-bind-html
filter('trust', ['$sce',function($sce) {
return function(value, type) {
return $sce.trustAs(type || 'html', value);
}
}]);
@drblue
drblue / fix_onedrive.sh
Last active April 16, 2024 21:54
Fix OneDrive for Mac CPU usage
#!/bin/bash
## Fix OneDrive for Mac CPU usage
##
## Seems this is still a problem 5 years later after I created this little gist.
## I have long since stopped using OneDrive (luckily), but according to
## comments below, I have added the new path for OfficeFileCache for macOS
## Mojave (10.14) and Catalina (10.15).
## Run this on macOS Mojave (10.14) and Catalina (10.15)
find ~/Library/Containers/ -type d -name OfficeFileCache -exec rm -r {} +
@iansinnott
iansinnott / docker_wrapper.sh
Last active March 20, 2016 12:29
Automatically set up boot2docker on a Mac whenever `docker` is called
#!/bin/bash
# A wrapper for the docker binary. Checks to make sure the docker host is
# set before executing docker commands.
docker() {
# Start the daemon if it's not running
if [ $(boot2docker status) != 'running' ]; then
echo 'Starting the Docker daemon.'
boot2docker start
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing