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 | |
# Add this script to your cloudformation directory (we have ours in the project root). | |
# Then set up a build step in Team City that executes the custom script: | |
# | |
# [[ -f ./cloudformation/validate-cloudformation.sh ]] && ./cloudformation/validate-cloudformation.sh | |
# | |
# That way branches without the script will still build. | |
# | |
# Make sure your CI user has the following policy attached to it for AWS: |
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
{% if site.github.public_repositories %} | |
{% assign sorted_repositories = site.github.public_repositories | sort: 'watchers_count' %} | |
{% for repository in sorted_repositories reversed %} | |
<h2><a href="{{ repository.html_url }}" target="_blank">{{ repository.name }}</a></h2> | |
<p>{{ repository.description }}</p> | |
{% endfor %} | |
{% endif %} |
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
module['exports'] = function echo (hook) { | |
// Access Node.js HTTP Request and Response objects | |
var req = hook.req, | |
res = hook.res; | |
// Use NPM Modules | |
var faker = require('faker'); | |
res.write('<strong>hello</strong> '); | |
res.write(req.headers["x-forwarded-for"] + '<br/>'); | |
res.end(faker.hacker.phrase()); | |
}; |
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
import java.io.FileOutputStream; | |
import java.io.ObjectOutputStream; | |
import java.security.cert.CertPath; | |
import java.security.cert.CertificateFactory; | |
import java.util.ArrayList; | |
import java.util.List; | |
import javax.net.ssl.HttpsURLConnection; | |
import javax.net.ssl.SSLSession; | |
import javax.net.ssl.SSLSocket; |
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
echo 'net.core.wmem_max=12582912' >> /etc/sysctl.conf | |
echo 'net.core.rmem_max=12582912' >> /etc/sysctl.conf | |
echo 'net.ipv4.tcp_rmem= 10240 87380 12582912' >> /etc/sysctl.conf | |
echo 'net.ipv4.tcp_wmem= 10240 87380 12582912' >> /etc/sysctl.conf | |
echo 'net.ipv4.tcp_window_scaling = 1' >> /etc/sysctl.conf | |
echo 'net.ipv4.tcp_timestamps = 1' >> /etc/sysctl.conf | |
echo 'net.ipv4.tcp_sack = 1' >> /etc/sysctl.conf | |
echo 'net.ipv4.tcp_no_metrics_save = 1' >> /etc/sysctl.conf | |
echo 'net.core.netdev_max_backlog = 5000' >> /etc/sysctl.conf | |
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: GnuPG/MacGPG2 v2.0.18 (Darwin) | |
mQINBFHK/6cBEAC+XPwiHQ3eZ1B9OfnyITX5ADFlks06JP0icrcmMDDNEpTYSC+q | |
FHJ/D/uEdKM03RalVGZ8KES/TG3kjaEPUODR8adRWP8EYm/EGTozn6qO5YwiB/7q | |
8v9R9R+ZZwivRvM56054A/RgAgy09Qf50uLgRGryRyDuPEwyVDJEcGglCwOR+oep | |
FGnxi7kmO2RTVmHHEAQWoCZDbkgyQctmh++99UKdKMG7yhlX8EMOmN+iYAW4ZXS/ | |
fFSOKTdgb26gNUhaBuKboHmCEx3JwZXnkHZ853jXFWQndb70+wcVnP9i04vM2Nsn | |
8ACBVg0y7zheGV6eBz9X+MD/+fSui7syINYDW9oiswQm5A9tgP/Bl+XDqI5HZIOZ | |
twuO7YJBQfWX5Js6Qc1qxaSl96VzlNoL1xXx+ULBqgyaEOTd0M4AcJW3V0vnaTd2 |
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 | |
set -e | |
NGINX_VERSION="1.6.0" | |
NGINX_TARBALL="nginx-${NGINX_VERSION}.tar.gz" | |
PCRE_VERSION="8.34" | |
PCRE_TARBALL="pcre-${PCRE_VERSION}.tar.gz" | |
OPENSSL_VERSION="1.0.1g" | |
OPENSSL_TARBALL="openssl-${OPENSSL_VERSION}.tar.gz" |
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 | |
# Set Graphite host | |
GRAPHITE="172.16.20.1" | |
GRAPHITE_PORT="2003" | |
stats() { | |
HOSTNAME="mediacenter" | |
DATE=$(date +%s) | |
echo "server.${HOSTNAME}.${1} ${2} ${DATE}" | nc $GRAPHITE $GRAPHITE_PORT -w 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
# Gain XP on HabitRPG | |
HABITRPG_UID="xxxxx" | |
HABITRPG_TOKEN="yyyyyy" | |
curl -X POST -H 'Content-Type:application/json' \ | |
"https://habitrpg.com/v1/users/${HABITRPG_UID}/tasks/git/up" \ | |
-d "{\"apiToken\":\"${HABITRPG_TOKEN}\", \"title\":\"Git commit\", \"service\":\"git\", \"icon\":\"https://github.com/favicon.ico\"}" 1>/dev/null 2 | |
>&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
// MySQL | |
$sql = "SELECT all, the fields, you, want, ((ACOS(SIN(c.Latitude * PI() / 180) * SIN(" . $lat . " * PI() / 180) + COS(c.Latitude * PI() / 180) * COS(" . $lat . " * PI() / 180) * COS((c.Longitude - " . $lng . ") * PI() / 180)) * 180 / PI()) * 60 * 2) as distance FROM places ORDER BY distance DESC;"; | |
// MongoDB | |
$this->places->find(array( 'loc' => array( '$near' => array($lat, $lng) ) )); |