Skip to content

Instantly share code, notes, and snippets.

View andrewodri's full-sized avatar
😍

Andrew Odri andrewodri

😍
View GitHub Profile
@mbierman
mbierman / lights.sh
Last active November 13, 2023 16:27
Turn on/off lights on Unifi APs
#!/bin/bash
# Variables
result=""
count=0
log=/data/logs/lights.log
private=/home/pi/.firewalla/config/post_main.d/pass.txt
dir=$(dirname "$0")
user=$(cat $dir/lights.txt | grep user | cut -f2 -d "=" )
baseIP=192.168.0
@jj1bdx
jj1bdx / audio-stream-nc-radio-stereo.sh
Last active November 23, 2022 20:05
Audio streaming script from Linux to macOS
# Sender Linux script
# Raw output from gqrx
# Note: the "hw:" in the device name
# Use "plughw:" if you need a conversion between the software and arecord
arecord --buffer-time=15000 -D hw:Loopback,1,0 -t raw -r 48000 -f FLOAT_LE -c 2 | nc "receiver macOS IP address" 23456
# Receiver macOS script
nc -l 23456 | play --buffer 64 -t raw -e floating-point -b32 -r 48000 -c 2 -q -
@masablo
masablo / apksigner.sh
Last active March 31, 2024 10:51
How to make a signed .apk file
# 1. install Android Studio from https://developer.android.com/studio/?hl=ja
# 2. add PATH for the Android SDK
cat << 'EOS' >> ~/.zshrc
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/build-tools/29.0.3
EOS
@opexxx
opexxx / iranian_apit_groups_possible_commands.md
Created January 9, 2020 23:31 — forked from MSAdministrator/iranian_apit_groups_possible_commands.md
Iranian APT Groups & Possible Commands Used By These Groups

Overview

The following content is generated using a preview release of Swimlane's pyattck.

This snippet of data is scoped to the following actor groups:

  • APT33
  • APT34
  • APT39
  • Charming Kitten
@greguz
greguz / stream_parse_xml.js
Last active March 10, 2023 10:33
Node.js XML to objects streaming edition (htmlparser2)
import { Parser } from 'htmlparser2'
import { Transform } from 'stream'
import _ from 'lodash'
export default class XmlParser extends Transform {
constructor (path = [], options = {}) {
super({
...options,
objectMode: true
})
@AtomicBlom
AtomicBlom / pixelate.shader
Created October 9, 2018 14:29
Pixelate effect for OBS Study (obs-shaderfilter plugin)
//-----------------------------------------------------------------------------------------
// Shader constant register mappings (scalars - float, double, Point, Color, Point3D, etc.)
//-----------------------------------------------------------------------------------------
uniform float horizontal_pixel_counts;
uniform float vertical_pixel_counts;
uniform float speed;
//--------------------------------------------------------------------------------------
// Sampler Inputs (Brushes, including ImplicitInput)
@kbingham
kbingham / uvc-gadget.sh
Created May 15, 2018 08:18
UVC ConfigFS Gadget configuration tool
#!/bin/sh
set -e
#set -x
CONFIGFS="/sys/kernel/config"
GADGET="$CONFIGFS/usb_gadget"
VID="0x0525"
PID="0xa4a2"
SERIAL="0123456789"
@jj1bdx
jj1bdx / APRS-airspyhf_rx.md
Last active May 9, 2023 01:59
APRS with rtl_fm, direwolf, and multimon-ng / and also airspyhf_rx

APRS with airspyhf_rx, csdr, and direwolf

1200bps 144.660MHz

# Choose 11025Hz for the intermediate IF/audio frequency
airspyhf_rx -f 144.66 -a 768000 -r stdout | \
  csdr fir_decimate_cc 69.65986394557823129252 0.005 HAMMING | \
  csdr fmdemod_quadri_cf | csdr limit_ff 0.5 | csdr deemphasis_nfm_ff 11025 | \
  csdr fastagc_ff | csdr limit_ff 0.5 | csdr convert_f_s16 | \

/usr/local/bin/direwolf -c ~/bin/sdr-1200bps.conf -t 0 -T "%FT%TZ" -r 11025 -D 1 -B 1200 -

@WintersMichael
WintersMichael / patch_configmap.sh
Created February 7, 2018 16:38
Patch / update a configmap from inside Kubernetes using curl
KUBE_TOKEN=$(</var/run/secrets/kubernetes.io/serviceaccount/token)
NAMESPACE=myapp-dev
CONFIGMAP_NAME=testconfig
curl -sSk \
-X PATCH \
-d @- \
-H "Authorization: Bearer $KUBE_TOKEN" \
-H 'Accept: application/json' \
-H'Content-Type: application/strategic-merge-patch+json' \
https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/$NAMESPACE/configmaps/$CONFIGMAP_NAME <<'EOF'