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
<form id="donate_form" method="POST" action="/stripe/submit_form"> | |
<input type="button" id="submit" value="Submit >" onclick="submit_payment('form#donate_form')"> | |
</form> | |
function submit_payment(form) { | |
var $form = $(form); | |
var xhr = new XMLHttpRequest(); | |
xhr.onreadystatechange = function() { | |
if (xhr.readyState === XMLHttpRequest.DONE) { |
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
sudo chgrp -R users Music | |
sudo chmod g+s Music | |
sudo setfacl -d -m g::rwx Music |
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
I forget this snippet too much... | |
DirectoryIndex index.html index.php | |
AcceptPathInfo On | |
SuexecUserGroup user group | |
RewriteEngine On | |
# FastCGI PHP | |
<Files *.php> | |
SetHandler fcgid-script | |
#AddHandler fcgid-script .php |
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
# Initialize the inventory | |
inventory = {} | |
inventory['all'] = {'hosts': [], 'vars': {}} | |
inventory['_meta'] = {'hostvars': {}} | |
# Add localhost to inventory | |
inventory['all']['hosts'].append('localhost') | |
inventory['_meta']['hostvars']['localhost'] = {} | |
inventory['_meta']['hostvars']['localhost']['ansible_host'] = 'localhost' | |
inventory['_meta']['hostvars']['localhost']['ec2_public_dns_name'] = 'localhost' | |
inventory['_meta']['hostvars']['localhost']['ec2_public_ip_address'] = '127.0.0.1' |
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 | |
# This is run by a cron job. It periodically checks our repository and triggers a new jenkins run. | |
cd /var/www/bg/current | |
output=$(git pull) | |
if [ "$output" != "Already up-to-date." ]; then | |
curl -sS http://127.0.0.1:8080/job/BG5/build?token=bg5isthecoolest | |
fi |
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 | |
# Source function library. | |
. /etc/rc.d/init.d/functions | |
setsid java -jar /opt/ci/selenium-server-standalone-2.35.0.jar 2>&1 > /var/log/selenium.log & |
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 | |
XVFB=/usr/bin/Xvfb | |
XVFBARGS=":0 -screen 0 1280x1024x8 -fbdir /var/run" | |
PIDFILE=/var/run/xvfb.pid | |
# Source function library. | |
. /etc/rc.d/init.d/functions | |
case "$1" in |
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 | |
# This script ensures that Xvnc is running | |
vncserver :0 -depth 8 -geometry 1280x1024 -PasswordFile /opt/ci/passwd | |
setsid mwm 2>&1 > /dev/null |
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
-- https://github.com/openresty/lua-nginx-module#nginx-api-for-lua | |
-- https://www.nginx.com/resources/wiki/modules/lua/ | |
-- http://www.staticshin.com/programming/definitely-an-open-resty-guide/ | |
-- access_by_lua_file /path/to/waf.lua; | |
-- examine request | |
ngx.req.read_body() | |
local request_method = ngx.req.get_method() | |
local get_args = ngx.req.get_uri_args() | |
local post_args, err = ngx.req.get_post_args() |
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
# my quick and dirty method: | |
setsid /bin/sh -c "cd /; $@ 2>&1 < /dev/null | logger -t $1 &" | |
# or the full proper method, found online: | |
# full daemonization of external command with setsid | |
daemonize() { | |
( # 1. fork | |
# 2.1. redirect stdin/stdout/stderr before setsid. redirect tty fds to /dev/null. |