Skip to content

Instantly share code, notes, and snippets.

View genevera's full-sized avatar

genevera (she/her) genevera

  • Queens, NY
View GitHub Profile
@genevera
genevera / proxytoggle.sh
Last active June 15, 2016 19:47
Toggle web proxy via command-line (cli) in Mac OS X
# use sudo else you'll need to deal with a popup auth dialog.
#
# you can also add yourself to the sudoers file with NOPASSWD for this particular command.
# e.g. genevera ALL = (genevera) NOPASSWD: /usr/sbin/networksetup
# then you won't need to enter a pw at all for this :)
proxytoggle () {
if [[ $(networksetup -getwebproxy Wi-Fi | grep -c Yes) -eq 1 ]]
then
export http_proxy=
export https_proxy=
@genevera
genevera / README
Created May 24, 2016 23:45 — forked from k4ml/README
Install alpine linux on xhyve VM
# curl -LO http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86_64/alpine-3.3.3-x86_64.iso
curl -LO http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86/alpine-3.3.3-x86.iso
# create hdd image (8GB)
dd if=/dev/zero of=hdd.img bs=1g count=8
# extract kernel and initramfs
brew install cdrtools
isoinfo -i alpine-3.3.1-x86.iso -J -x /boot/initramfs-grsec > initramfs-grsec
isoinfo -i alpine-3.3.1-x86.iso -J -x /boot/vmlinuz-grsec > vmlinuz-grsec
@genevera
genevera / rename.sh
Created February 15, 2017 18:52 — forked from szeidner/rename.sh
Shell script for renaming an Android package and app name.
#!/bin/sh
set -e
PROGNAME=$(basename $0)
WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
OLD_TITLE="DTStart"
OLD_PACKAGE="old.package.name"
die() {
echo "$PROGNAME: $*" >&2
@genevera
genevera / rename-apk-namespace
Created February 15, 2017 18:59 — forked from vavrecan/rename-apk-namespace
Script that allows renaming namespace of Android APK so you can install same application multiple times
#!/bin/bash
# author Marek Vavrecan ([email protected])
# show usage
[ $# -eq 0 ] && { echo "Usage: $0 [apk path] [source namespace] [target namespace]"; exit 1; }
APK_PATH="$1"
NAMESPACE_FROM="$2"
NAMESPACE_TO="$3"
@genevera
genevera / vpnnat.conf
Last active June 8, 2020 01:25
pfctl NAT for VPN
lan="{192.168.64.0/24}"
vpn="{ VPN_RANGE_GOES_HERE }"
ext_if="bridge100"
vpn_if="utun0"
nat on $ext_if from $lan to $vpn -> ($ext_if)
nat on $vpn_if from $lan to $vpn -> ($vpn_if)
:'<,'>s/export \(.*\)="\$\({.*}\)"/export \1="\${\1}"/g 
@genevera
genevera / gist:ca2b3fdf59236948b692d76f56581a4c
Created June 5, 2018 21:04
vim regex to fix bash variable name formatting
:%s/\$\([A-Za-z_]\+\)/${\1}/g
@genevera
genevera / strace.sh
Last active May 23, 2023 10:41
spoofing strace for htop on mac os x
#!/usr/local/bin/genv /usr/local/bin/bash
args_modded="-a $(echo ${*}| sed 's/-s 512//')";
exec /usr/bin/sudo -E /usr/bin/dtruss ${args_modded}
@genevera
genevera / docker-x11.bash
Created January 20, 2019 06:31 — forked from kiki67100/docker-x11.bash
Docker macOS X11 display
### Script to install xquartz and set the DISPLAY variable correctly, find the listen port and add current ip to connect to X11.
#skip if you want, install xquartz
brew cask reinstall xquartz
#get ip
IP=$(ifconfig|grep -E inet.*broad|awk '{ print $2; }')
#open XQuartz
open -a XQuartz &
#Go to preference Security check allow network, restart :
read -p "Go to preference Security check allow network and press a key to continue"
@genevera
genevera / svc_bounce.zsh
Last active April 13, 2019 20:54
ZSH function to stop and restart a service under launchd - written on high sierra 10.13.6 for zsh 5.7.1
################################################################################
# restarts a service in launchd. assumes you have
# https://github.com/MarkTiedemann/countdown-cli installed. but will run `sleep`
# if you don't.
#
# usage: svc_bounce domain/svc_target timeout
# timeout is needed so launchd can shut the service down gracefully.
################################################################################
function svc_bounce() {
local -r svc="${1}";