Skip to content

Instantly share code, notes, and snippets.

View llazzaro's full-sized avatar
👨‍🚒
Fighting fire with fire 🔥

Leonardo Lazzaro llazzaro

👨‍🚒
Fighting fire with fire 🔥
View GitHub Profile
@llazzaro
llazzaro / about.md
Last active December 4, 2016 01:45 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
#!/bin/bash
### BEGIN INIT INFO
# Provides: Django EC2 server
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Django server management script
# Description: Django server management script
### END INIT INFO
@llazzaro
llazzaro / BCM4322
Created March 9, 2014 06:22
Install broadcom BCM4322 drivers
sudo yum install kmod-wl-`uname -r`
.configure \
--prefix=/usr/share/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--user=www-data \
--group=www-data \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-log-path=/var/log/nginx/access.log \
--http-proxy-temp-path=/var/lib/nginx/proxy \
# This is a step by step tutorial on how to run uwsgi in emperor mode,
# behind nginx on Fedora 20. I'll add to the tutorial as time goes on.
# SeLinux will likely be a pain (even in permissive mode), so please see my comment on how to fix it.
sudo yum upgrade
sudo yum install nano yum-utils gcc uwsgi-plugin-python3 nginx
yum-builddep python3-psycopg2
#!/bin/sh
# Settings for a PHP Project
# Using:
# * PHP Lint
# *- PHP CS
# *- PHP Analyzer
# *- EmptyLines Checker
# *- Scrutinizer
# * PHPCPD
@llazzaro
llazzaro / gist:3353a8add5d9f7fea918
Created June 21, 2014 17:16
Share Internet with Debian
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -F FORWARD
iptables -A FORWARD -j ACCEPT
apt-get install dnsmasq
printf " interface=eth0\ndhcp-range=192.168.10.10,192.168.10.19,4h" >> file.txt
/etc/init.d/dnsmasq restart
ifconfig eth0 192.168.10.1 netmask 255.255.255.0
# Manually download APP-SDK from here: http://developer.amd.com/tools-and-sdks/opencl-zone/opencl-tools-sdks/amd-accelerated-parallel-processing-app-sdk/
mkdir AMD-APP-SDK-lnx64
cd AMD-APP-SDK-lnx64/
tar -zxvf AMD-APP-SDK-v2.9-lnx64.tgz
sudo ./Install-AMD-APP.sh
sudo apt-get install libssl-dev build-essential python-dev libpcap-dev
export AMDAPPSDKROOT="/opt/AMDAPP"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/opt/AMDAPP/lib/x86_64":"/opt/AMDAPP/lib/x86"
@llazzaro
llazzaro / fabric_backup_mysql.py
Created June 25, 2014 12:42
Fabric script for mysql backup
import time
def vps():
env.hosts = ['apps.myvps.com']
env.user = 'app'
env.dbname = 'blog'
env.dbuser = 'blogger'
env.dbpass = 'password'
def backup():
@llazzaro
llazzaro / fabric_pgdump_all.py
Last active August 29, 2015 14:03
Fabric script for Postgres backup
import os
import time
from fabric.contrib.files import exists
from fabric.api import (
env,
require,
run,
get,
sudo