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 | |
NAME="hello_app" # Name of the application | |
DJANGODIR=/webapps/hello_django/hello # Django project directory | |
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket | |
USER=hello # the user to run as | |
GROUP=webapps # the group to run as | |
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn | |
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use | |
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name |
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
"""A yet-to-be-disproven-as-safe python expression shell | |
Blacklisted functionalities include: | |
1. Anything containing '__', because introspection allows many, many hacks. | |
2. open(), because it allows you to overwrite files | |
3. memoryview(), because it manipulates memory (?) | |
4. help(), because it drops you into a manpage-reader with !shell access | |
5. eval(), exec(), compile(), because they allow code execution via constructable strings, circumventing #1 | |
6. vars(), getattr(), because they allow attribute access via constructable strings, circumventing #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
var gpio = require("gpio") | |
var gpio22, intervalTimer | |
// Flashing lights if LED connected to GPIO22 | |
gpio22 = gpio.export(22, { | |
ready: blinkLED | |
}) | |
function blinkLED() { | |
intervalTimer = setInterval(function() { |
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
curl -s --insecure https://api-3t.sandbox.paypal.com/nvp -d | |
"USER=<Caller_ID> | |
&PWD=<Caller_Pswd> | |
&SIGNATURE=<Caller_Sig> | |
&METHOD=DoExpressCheckoutPayment | |
&VERSION=93 | |
&TOKEN=<Token> # TOKEN value returned from SetExpressCheckout | |
&PAYERID=<PayerID> # PAYERID value returned from GetExpressCheckoutDetails | |
&PAYMENTREQUEST_0_AMT=250 # first payment details | |
&PAYMENTREQUEST_0_CURRENCYCODE=USD |
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
web1: | |
shared_writable_dirs: | |
- app/cache | |
- app/logs | |
- app/sessions | |
document_root: web | |
default_gateway: app.php | |
index_list: [app.php] | |
php_version: 5.3.10 | |
php_extensions: |
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
source "http://rubygems.org" | |
gem "rails", "3.2.5" | |
# Supported DBs | |
gem "sqlite3" | |
gem "mysql2" | |
# Auth | |
gem "devise", "~> 2.1.0" |
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
#!/usr/bin/env python3 | |
from urllib.request import urlopen | |
from xml.dom.minidom import parseString | |
import os | |
""" | |
Request current weather from Yahoo's public weather API and append to a log | |
""" | |
# Where to put the log file? | |
desired_path = os.getenv("HOME") + '/weather.log' | |
# Temperature unit: c for Celsius, f for Fahrenheit |
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 RPi.GPIO as GPIO, feedparser | |
USERNAME="[email protected]" | |
PASSWORD="password" | |
GPIO_PIN=12 | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(GPIO_PIN, GPIO.OUT) | |
newmails = int(feedparser.parse("https://" + USERNAME + ":" + PASSWORD + "@mail.google.com/gmail/feed/atom")["feed"]["fullcount"]) | |
if newmails > 0: | |
GPIO.output(GPIO_PIN, True) | |
else: |
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
syntax on | |
set expandtab | |
set shiftwidth=4 | |
set tabstop=4 | |
set nobackup | |
set number | |
set termencoding=utf-8 | |
set encoding=utf-8 | |
set fileencodings=utf-8,euc-jp,sjis | |
set fileformat=unix |
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 com.package.utils; | |
/* | |
* This code is free software; you can redistribute it and/or modify it under | |
* the terms of the GNU Lesser General Public License as published by the Free | |
* Software Foundation; either version 2.1 of the License, or (at your option) | |
* any later version. | |
* | |
* This code is distributed in the hope that it will be useful, but WITHOUT ANY | |
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |