This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:'<,'>s/export \(.*\)="\$\({.*}\)"/export \1="\${\1}"/g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:%s/\$\([A-Za-z_]\+\)/${\1}/g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# 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}"; |
OlderNewer