This file contains hidden or 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 | |
| # NOTE: wifi network interface is: en1 | |
| wifi_router=192.168.200.1 | |
| wifi_address=en1:ec.35.86.4f.00.bc | |
| TOADDR=`ifconfig en1 inet | sed -nl 's/\w*inet \([^ ]*\).*/\1/p'` | |
| TO=`echo -n ${TOADDR//[[:space:]]}` | |
| echo "ADDING ROUTE TO $1 VIA en1 (wi-fi): $TO" | |
| route -n add -host $1 $wifi_router -ifp $wifi_address -ifa $TO -static |
This file contains hidden or 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
| #include <sys/types.h> | |
| #include <sys/ioctl.h> | |
| #include <sys/socket.h> | |
| #include <sys/sys_domain.h> | |
| #include <sys/kern_control.h> | |
| #include <net/if_utun.h> | |
| #include <errno.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <syslog.h> |
This file contains hidden or 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
| #include <sys/socket.h> | |
| #include <sys/un.h> | |
| #include <sys/event.h> | |
| #include <netdb.h> | |
| #include <assert.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #include <stdio.h> | |
| #include <errno.h> |
This file contains hidden or 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
| NSString *const PSPDFApplicationDidReceiveMemoryWarningNotification = @"PSPDFApplicationDidReceiveMemoryWarningNotification"; | |
| // Test with sudo memory_pressure -l critical. Don't forget to re-set afterwards! | |
| __attribute__((constructor)) static void PSPDFInstallLowMemoryNotificationWarningMac(void) { | |
| static dispatch_source_t source; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, 0, DISPATCH_MEMORYPRESSURE_WARN|DISPATCH_MEMORYPRESSURE_CRITICAL, dispatch_get_main_queue()); | |
| dispatch_source_set_event_handler(source, ^{ | |
| dispatch_source_memorypressure_flags_t pressureLevel = dispatch_source_get_data(source); |
This file contains hidden or 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
| // For more documentation and a newer version, | |
| // check out the full repo: https://github.com/kevincennis/TinyMusic | |
This file contains hidden or 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
| [peername] | |
| proto = nacltai | |
| proto_publickey = LOCAL_PUBKEY | |
| proto_privatekey = REMOTE_PRIKEY | |
| local = tuntap | |
| local_interface = tunnel | |
| local_tunmode = 1 | |
| peer = udp | |
| peer_localaddr = REMOTE_IP | |
| peer_localport = 8000 |
This file contains hidden or 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 | |
| SOURCE="${BASH_SOURCE[0]}" | |
| while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
| DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
| SOURCE="$(readlink "$SOURCE")" | |
| [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
| done | |
| DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
| echo $DIR |
This file contains hidden or 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
| # Generating throwaway QR codes from the command line for shunting URLS to mobile devices | |
| brew install qrencode | |
| qrencode -o - http://www.google.com | open -f -a preview |
This file contains hidden or 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
| package main | |
| import ( | |
| "bytes" | |
| "crypto/hmac" | |
| "crypto/rand" | |
| "encoding/base64" | |
| "encoding/binary" | |
| "encoding/hex" | |
| "fmt" |
This file contains hidden or 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 | |
| ########################################################## | |
| # Fix Symlinks | |
| # | |
| # Usage : Copy this file into the Framework directory, | |
| # Execute it passing the Framework Name in argument. | |
| # | |
| ########################################################## | |
| if [ -z $1 ] ; then |