Skip to content

Instantly share code, notes, and snippets.

View xspager's full-sized avatar
🐼

Daniel Lemos xspager

🐼
View GitHub Profile
@xspager
xspager / gunicorn
Created December 22, 2011 21:21 — forked from suda/gunicorn
Gunicorn init.d script (redhat/centos)
#!/bin/sh
### BEGIN INIT INFO
# Provides: gunicorn
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the gunicorn server
# Description: starts gunicorn using start-stop-daemon
@xspager
xspager / temp.py
Last active August 29, 2015 14:12
Show the current time and temperature of the Raspberry Pi using Adafruit_Nokia_LCD
# Author: Daniel Lemos
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@xspager
xspager / dump_yellow_gbc_info.py
Last active November 18, 2020 01:25
Dump some stuff from a GameBoy Rom. Saves the Nintendo logo from it if PIL (or Pillow) is installed.
import sys
import array
if len(sys.argv) < 2:
filename = "pokeyellow.gbc"
else:
filename = sys.argv[1]
rom = array.array('B')
@xspager
xspager / boards.txt
Created February 1, 2015 22:09
Extra boards for "bareduinos" using the internal 8MHz oscillator and slow programmer.
##############################################################
atmega8_8MHz.name=Arduino NG or older w/ ATmega8 @8MHz
atmega8_8MHz.upload.protocol=arduino
atmega8_8MHz.upload.maximum_size=7168
atmega8_8MHz.upload.speed=9600
atmega8_8MHz.bootloader.low_fuses=0xe4
atmega8_8MHz.bootloader.high_fuses=0xc2
digraph structs {
node [shape=record]
rankdir=LR
struct1 [label="{<ptr> ptr|{len|5}|{capacity|5}}"]
struct3 [label="{{<i0> 0|h}|{1|e}|{2|l}|{3|l}|{4|o}}}"]
struct1:ptr -> struct3:i0 [splines=curved]
}
##
#
# Sample config file for a Sailor based website
#
# On Debian you may copy this file to /etc/nginx/sites-available and then link it on /etc/nginx/sites-enabled
#
##
# Use the luarock's path command to get the value for those and add the path to your code for lua_package_path
lua_package_path '/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/share/lua/5.1//?.lua;/usr/share/lua/5.1//?/init.lua;./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua;/var/www/html/hey_arnold/?.lua';
@xspager
xspager / fastcgi.conf
Last active February 23, 2016 15:14
config file for fcgi on nginx
server {
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
root /home/xspager;
index index.lua index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
server.modules += ( "mod_rewrite" )
fastcgi.debug = 1
# serve index pages
url.rewrite = ( "^(/.*)$" => "/index.lua$1" )
index-file.names += ("index.lua",)
fastcgi.server = (
#!/usr/bin/env /home/xspager/.lua/52/bin/cgilua.fcgi
--cgilua.handle("index.lp")
--require('mobdebug').start("192.168.0.6")
cgilua.htmlheader()
local SERVER_VARIABLES = {"PATH_TRANSLATED", "QUERY_STRING", "REMOTE_ADDR", "REQUEST_METHOD", "SCRIPT_NAME", "SERVER_PROTOCOL", "SERVER_SOFTWARE"}
server {
listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
root /usr/home/freebsd/xspager;
index index.lua;
# Make site accessible from http://ablogusingsailor.danielocl.com.br/
server_name ablogusingsailor.danielocl.com.br;