Skip to content

Instantly share code, notes, and snippets.

View joselitosn's full-sized avatar

Vinicios R. Portella joselitosn

View GitHub Profile
@jirutka
jirutka / rules-both.iptables
Created September 18, 2012 12:42
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# 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
@biskandar
biskandar / 2012101701.c
Created October 17, 2012 06:47
Request Counter with Arduino Uno + Ethernet Shield + LCD Shield 2012101701
#include <SPI.h>
#include <Ethernet.h>
#include <LiquidCrystal.h>
// prepare for lcd shield
LiquidCrystal lcd( 8 , 9 , 4 , 5 , 6 , 7 ) ;
// prepare for ethernet shield
byte mac[] = { 0x00 , 0x08 , 0xDC , 0x00 , 0x00 , 0x09 } ;
@biskandar
biskandar / 2012101702.c
Created October 17, 2012 06:56
Request Counter with Arduino Uno + Ethernet Shield + LCD Shield 2012101702
void loop() {
// verify if there is new client connected
EthernetClient client = server.available() ;
if ( !client ) return ;
// prepare for reading request data
boolean isBlankLine = true ;
// read and proces the client request data
@postrational
postrational / gunicorn_start.bash
Last active April 4, 2024 12:48
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/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
@sloria
sloria / bobp-python.md
Last active December 17, 2024 19:51
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@drmalex07
drmalex07 / helloworld-win32-service.py
Created April 12, 2014 20:08
An example Windows service implemented with pywin32 wrappers. #python #windows-service #pywin32
import win32serviceutil
import win32service
import win32event
import servicemanager
import socket
import time
import logging
logging.basicConfig(
filename = 'c:\\Temp\\hello-service.log',
@hitsumabushi
hitsumabushi / default
Last active September 21, 2020 09:12
Preseed Files : working with Wheezy & Ubuntu 14.04
# D-I config version 2.0
default debian/7.4/amd64/boot-screens/vesamenu.c32
prompt 1
timeout 300
menu title - Boop Menu -
label Debian-7.4
menu label ^0 Debian 7.4
#include debian/7.4/amd64/boot-screens/menu.cfg
kernel debian/7.4/amd64/linux
@sergejmueller
sergejmueller / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@fevangelou
fevangelou / default.vcl_PREFACE.md
Last active December 7, 2024 16:44
The perfect Varnish configuration for WordPress, Joomla, Drupal & other (common) CMS based websites

The perfect Varnish configuration for WordPress, Joomla, Drupal & other (common) CMS based websites

Updated on December 15th, 2021

IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).

USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.

IMPORTANT: The following setup assumes a 180 sec (3 minute) cache time for cacheable content that does not have the correct cache-control HTTP headers. You can safely increase this to 300 sec (or more) for less busier sites or drop it to 60 sec or even 30 sec for high traffic sites. It obviously depends on your use case.

@doorbash
doorbash / MisfortuneCookieExploit.py
Last active March 18, 2024 16:46
Multiple Vendors (RomPager <= 4.34) - Misfortune Cookie Router Authentication Bypass
# Title: Misfortune Cookie Exploit (RomPager <= 4.34) router authentication bypass exploit
# Date: 17/4/2016
# CVE: CVE-2015-9222 (http://mis.fortunecook.ie)
# Vendors: ZyXEL,TP-Link,D-Link,Nilox,Billion,ZTE,AirLive,...
# Vulnerable models: http://mis.fortunecook.ie/misfortune-cookie-suspected-vulnerable.pdf
# Versions affected: RomPager <= 4.34 (specially 4.07)
# Link: https://gist.github.com/doorbash/f454c698f192a0e5d1bf4da9c6869b67
# Exploit Database link: https://www.exploit-db.com/exploits/39739/
# 0day.today link: http://0day.today/exploit/25259
# Routersploit module : https://github.com/reverse-shell/routersploit/blob/master/routersploit/modules/exploits/multi/misfortune_cookie.py