Skip to content

Instantly share code, notes, and snippets.

View deckarep's full-sized avatar
🎯
Focusing

Ralph Caraveo deckarep

🎯
Focusing
View GitHub Profile
@jerem
jerem / s3delete.py
Last active October 9, 2015 10:28
A python/gevent script to quickly delete a very large Amazon S3 bucket.
#!/usr/bin/env python
import gevent.monkey
gevent.monkey.patch_all()
import sys
import optparse
import gevent
from boto.s3.connection import S3Connection
import oursql
import sys
from twisted.enterprise import adbapi
from twisted.internet import defer, reactor
from twisted.python import log
log.startLogging(sys.stderr)
# Use 'test' database with default credentials
@NTICompass
NTICompass / Dockerfile
Created January 27, 2016 22:10
Run headless wkhtmltopdf inside Docker container
# wkhtmltopdf from: http://wkhtmltopdf.org/downloads.html
FROM centos:7
MAINTAINER Eric Siegel <nticompass@gmail.com>
# Upgrade packages & repo
RUN yum -y update
# wkhtmltopdf's dependencies
RUN yum -y install zlib fontconfig freetype libX11 libXext libXrender
# Download x64 static build of wkhtmltox (with patched QT)
package main
import (
"fmt"
"log"
"math"
"net/http"
"os"
"os/exec"
"time"
@peterhellberg
peterhellberg / popcorn.go
Created January 14, 2016 23:21
Fractal popcorn in Go, inspired by http://paulbourke.net/fractals/popcorn/
package main
import (
"flag"
"image"
"image/color"
"image/draw"
"image/png"
"math"
"os"
@mboersma
mboersma / Go pre-commit
Last active December 6, 2017 02:00
Go project pre-commit hook
#!/bin/sh
# Save this file as ".git/hooks/pre-commit" in your
# git repository and set it to executable.
#
# To use the "go vet" command:
# $ go get -v code.google.com/p/go.tools/cmd/vet
# To use the "golint" command:
# $ go get -v github.com/golang/lint/golint
@cfenollosa
cfenollosa / email-deadlines.php
Last active April 24, 2018 18:17
Postpone your own email
#!/usr/bin/env php
<?php
// Script to postpone your own email. Parses IMAP folders and moves emails to a folder named "Today"
// Run this from a crontab, for example at 6 AM
// BSD License
// (C) Carlos Fenollosa, 2011-2016
// Read more about this script: http://cfenollosa.com/blog/a-simple-script-to-postpone-your-own-email.html
// Please leave comments and feedback for bugs and ideas!
@einthusan
einthusan / go1.4arc65-ubuntu.sh
Last active July 10, 2018 23:43
Install Golang 1.4.1 on Ubuntu 14.04 AWS EC2
#!/bin/sh
# OPTIONAL FLAGS:
#
# -geoip true
# this will install maxmind geoip and auto update crontab file
#
# -cloudwatch true
# this will install aws cloud watch metrics and send them to aws dashboard
#
@jameshartig
jameshartig / ioCrawler.go
Last active September 19, 2018 00:23
Google I/O 2014 redeem easter egg crawler
//before running make sure you setup a GOPATH env variable and ran: "go get code.google.com/p/go.net/html"
//to run: go run ioCrawler.go -url="http://developers.google.com/"
//also try http://developer.android.com/index.html
//output goo.gl links to try and redeem will be sent to foundLinks.txt
//by the way there's an artificial "rate limit" in func crawler, you can lower that or raise it as you wish
//You can also comment out the onlyGoogleRegex code if you don't want to limit to google.com/youtube
//if you're getting I/O timeout errors, then you might need to increase the timeouts on line 231
@msoap
msoap / Raspberry Pi httpd benchmark.md
Last active September 26, 2018 16:09
Raspberry Pi httpd benchmark with wrk

Raspberry Pi httpd benchmark

Total RPS

All:

               Go/fasthttp (10 thr): 930.0 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

Nginx (10 thr): 826.1 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■