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
| void calcLocator(char *dst, double lat, double lon) { | |
| int o1, o2, o3; | |
| int a1, a2, a3; | |
| double remainder; | |
| // longitude | |
| remainder = lon + 180.0; | |
| o1 = (int)(remainder / 20.0); | |
| remainder = remainder - (double)o1 * 20.0; | |
| o2 = (int)(remainder / 2.0); | |
| remainder = remainder - 2.0 * (double)o2; |
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
| dig +short myip.opendns.com @resolver1.opendns.com |
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/sh | |
| sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's%\(..\)%\1:%g; s%.$%%') |
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
| setopt HIST_IGNORE_SPACE | |
| alias cleardns="sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; say DNS cache flushed" | |
| PROMPT='%W %* ${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}%{$reset_color%}' |
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
| until myserver; do | |
| echo "Server 'myserver' crashed with exit code $?. Respawning..." >&2 | |
| sleep 1 | |
| done |
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
| // instructions: | |
| // 1. log in to american express | |
| // 2. open the developer console in chrome | |
| // 3. run the script below (at your own risk) | |
| // | |
| // This is free and unencumbered software released into the public domain. | |
| // | |
| // Anyone is free to copy, modify, publish, use, compile, sell, or | |
| // distribute this software, either in source code form or as a compiled | |
| // binary, for any purpose, commercial or non-commercial, and by any |
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 | |
| MATRIX="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()_+-=~\`{[}]|\\:;\"\'<,>.?/" | |
| # ==> Password will consist of alphanum and punct characters. | |
| LENGTH="24" | |
| while [ "${n:=1}" -le "$LENGTH" ] | |
| # ==> So, if 'n' has not been initialized, set it to 1. | |
| do | |
| PASS="$PASS${MATRIX:$(($RANDOM%${#MATRIX})):1}" |
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
| set -g prefix C-a | |
| unbind C-b | |
| bind a send-prefix | |
| # Setting vi style stuff | |
| set -g status-keys vi | |
| set -g history-limit 10000 | |
| setw -g monitor-activity on | |
| unbind , | |
| bind-key A command-prompt -I "#W" "rename-window '%%'" | |
| bind-key '"' choose-window |
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
| <?php | |
| exec("system_profiler SPFirewallDataType SPPowerDataType SPNetworkDataType SPSoftwareDataType 2>/dev/null", $systemvars); | |
| $tree = array(); | |
| foreach($systemvars as $var){ | |
| if(preg_match("`^(\s+)(.*):\s+(.*)$`", $var, $match)){ | |
| $variable = $match[2]; | |
| $value = $match[3]; |
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
| # no annoying audible bell, please | |
| vbell on | |
| # detach on hangup | |
| autodetach on | |
| # don't display the copyright page | |
| startup_message off | |
| # Here comes the pain... |
NewerOlder