Skip to content

Instantly share code, notes, and snippets.

View jasonmadigan's full-sized avatar

Jason Madigan jasonmadigan

View GitHub Profile
@eoinfennessy
eoinfennessy / mgc-install-guide-base-setup.sh
Created August 29, 2023 12:07
Base setup for MGC install guide
#!/bin/bash
make local-setup-kind OCM_SINGLE=true
./bin/clusteradm init --bundle-version='0.11.0' --wait --context kind-mgc-control-plane
join=$(./bin/clusteradm get token --context kind-mgc-control-plane | grep -o 'join.*--cluster-name')
# Removed feature gate --feature-gates=RawFeedbackJsonString=true
./bin/clusteradm ${join} kind-mgc-control-plane --bundle-version='0.11.0' --force-internal-endpoint-lookup --context kind-mgc-control-plane
@ignisf
ignisf / gist:d4374fddc368439d1432ad5e8cf6fd5d
Last active May 12, 2023 18:08
Nedis WIFIDS10WT Tasmota Configuration
{"NAME":"Nedis WIFIDS10WT","GPIO":[0,107,0,108,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54}
Module 54
Backlog TuyaMCU 11,4; TuyaMCU 51,51
Backlog SetOption1 1; SetOption65 1; SetOption66 1
Rule1
ON TuyaReceived#Data=55AA000500056A0400010078 DO publish2 stat/%topic%/FIRE OFF ENDON
@rcgonzalezf
rcgonzalezf / Genymotion with Charles Proxy.md
Created September 14, 2019 06:45
Genymotion with Charles Proxy

Charles Proxy in your Genymotion Android emulator

  1. Settings -> Wifi -> Press and hold your active network
  2. Select “Modify Network”Select “Show Advanced Options”
  3. Select “Proxy Settings -> Manual”
  4. Set your Proxy to: 10.0.3.2 (Genymotion’s special code for the local workstation)
  5. Set your Port to: 8888
  6. Press Save
@unoexperto
unoexperto / patch_apk_for_sniffing.md
Last active April 12, 2025 10:39
How to patch Android app to sniff its HTTPS traffic with self-signed certificate

How to patch Android app to sniff its HTTPS traffic with self-signed certificate

  • Download apktool from https://ibotpeaches.github.io/Apktool/
  • Unpack apk file: java -jar /home/expert/work/tools/apktool.jar d [email protected]
  • Modify AndroidManifest.xml by adding android:networkSecurityConfig="@xml/network_security_config" attribute to application element.
  • Create file /res/xml/network_security_config.xml with following content:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config>
@twang2218
twang2218 / Dockerfile
Created July 14, 2016 16:00
Docker cron example
FROM python:3.5.2
ENV TZ=Asia/Shanghai
RUN apt-get update \
&& apt-get install -y cron \
&& apt-get autoremove -y
COPY ./cronpy /etc/cron.d/cronpy
CMD ["cron", "-f"]
@czardoz
czardoz / pre-commit.sh
Last active October 3, 2022 12:13
Git pre-commit hook that checks for AWS keys
#!/usr/bin/env bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
EMPTY_TREE=$(git hash-object -t tree /dev/null)
against=$EMPTY_TREE
fi
@yyang
yyang / centos7.sh
Last active April 8, 2025 16:29
centos 7 pptpd firewalld
#!/bin/sh
#
# pptpd installation script on my own CentOS 7 box.
# inspired by: https://www.digitalocean.com/community/questions/how-to-install-pptp-vpn-on-centos-7
# and http://unix.stackexchange.com/questions/150837/redhat-centos-7-firewalld-best-practice-for-pptp-or-l2tp-ipsec-rules
#
# Author: 2015 Steve Yang <[email protected]>
# The script comes with ABSOLUTELY NO WARRANTY.
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 10, 2025 09:21
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@pda
pda / www.rb
Created August 9, 2012 02:23
www: Serve the current directory via HTTP.
#!/usr/bin/env ruby
# Serve the current directory via HTTP.
# Like Python's SimpleHTTPServer, but with no-cache headers.
# Default port 8000, specify alternate port as first parameter:
# www 3000
# sudo www 80 # (probably a bad idea)
# Inspired by http://chrismdp.github.com/2011/12/cache-busting-ruby-http-server/
import time
import win32api, win32con
VK_CODE = {'left_arrow':0x25,
'spacebar':0x20,
'right_arrow':0x27}
def press(x):
win32api.keybd_event(VK_CODE[x], 0,0,0)
win32api.keybd_event(VK_CODE[x],0 ,win32con.KEYEVENTF_KEYUP ,0)