View correcao_poupanca.gs
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
/** | |
* Calcula o rendimento de poupança de um valor em um período específico. | |
* | |
* @param {value} input O valor a ser calculado. | |
* @param {initialDate} input Data inicial. | |
* @param {finalDate} input Data final. | |
* @return O valor corrigido. | |
* @customfunction | |
*/ | |
function CORRECAO_POUPANCA(value, initialDate, finalDate = now()) { |
View fan.sh
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
minSpeed=1500 | |
maxSpeed=5500 | |
highTemp=70 | |
normalTemp=40 | |
output=/sys/devices/platform/applesmc.768/fan1_output | |
manual=/sys/devices/platform/applesmc.768/fan1_manual | |
currentSpeed=$(cat $output) |
View vwash.sh
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
cache=/var/db/vwash.cache | |
touch $cache | |
while read line; do | |
mac=$(echo "$line" | cut -d: -f1-3) | |
if echo $mac | grep -i -e '[a-f0-9]\{2\}:' > /dev/null; then | |
lookup=$(grep "$mac=" $cache) | |
if [ $? -gt 0 ]; then |
View main.go
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
package main | |
import ( | |
"fmt" | |
"runtime" | |
) | |
type CPF []int | |
func NewCPF(cpf int64) CPF { |
View main.go
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"regexp" | |
"sort" | |
"strconv" | |
"strings" |
View nginx+socks.patch
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
diff -rupN nginx-1.6.2/auto/modules nginx-1.6.2-socks-upstream/auto/modules | |
--- nginx-1.6.2/auto/modules 2014-09-16 09:23:19.000000000 -0300 | |
+++ nginx-1.6.2-socks-upstream/auto/modules 2014-10-29 19:28:26.451597644 -0200 | |
@@ -381,6 +381,11 @@ if [ $HTTP_UPSTREAM_LEAST_CONN = YES ]; | |
HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_LEAST_CONN_SRCS" | |
fi | |
+if [ $HTTP_UPSTREAM_SOCKS = YES ]; then | |
+ have=NGX_HTTP_UPSTREAM_SOCKS . auto/have | |
+ HTTP_SRCS="$HTTP_SRCS src/http/modules/ngx_http_upstream_socks_module.c" |
View snake-os-qemu.sh
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
#******************************************************************** | |
# WARNING:: This whole exercise is performed while logged in as root. | |
# FOLLOW AT YOUR OWN RISK | |
#******************************************************************** | |
# Setup a working directory anywhere you like. I'm using /vb/snakex. | |
mkdir /vb/snakex | |
cd /vb/snakex | |
export MYTOP=`pwd` |
View gist:6076361
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
hosts=/etc/hosts | |
host=$1 | |
ip=$2 | |
if [ "$ip" = "" ]; then | |
ip=$(wget -qO- http://checkip.dyndns.org | cut -f2 -d":" | cut -f1 -d"<" | sed "s/ //") | |
fi | |
line=$(grep $host $hosts) |
View gist:5823291
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
# take one | |
# subdirectory (one server, multiple services) | |
location /btsync/ { | |
rewrite ^/btsync/gui(.*) /btsync$1 last; | |
proxy_pass http://127.0.0.1:8888/gui/; | |
proxy_redirect /gui/ /btsync/; | |
proxy_buffering off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; |
NewerOlder