Skip to content

Instantly share code, notes, and snippets.

View DeviaVir's full-sized avatar
🏴‍☠️

Chase DeviaVir

🏴‍☠️
View GitHub Profile
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_objects import RGBColor
import argparse
import math
@DeviaVir
DeviaVir / wp.conf
Created March 4, 2014 11:23
Wordpress nginx config
location / {
if (!-e $request_filename) {
rewrite ^(.+)$ / last;
break;
}
}
@DeviaVir
DeviaVir / dd-infra-history.md
Last active August 29, 2015 14:08
DualDev Infrastructure History

DualDev

Below you will find an overview of all changes made to the DualDev infrastructure since founding the company back in 2010. We hope this document clears up many of the technical and executive choices we've had to make in the past. News is noted from newest to oldest date.

2014

November - continuing development The move to AWS has been completed to a phase where we don't have to keep monitoring the platform 24/7, and where we can finally start trusting the platform again. We still have to move several services (including loadbalancers, DNS and other things), but we've continued development of a renewed website, face and customer panel. The service we offer, will be again fast, stable and futuristic, as you're used to from us, soon. Before we continue on building the new website, we still have two of the old servers in service for loadbalancing, backups and e-mail services. These will be retired the 28th of november (at night). The loadbalancing and backups have been moved. E-mail will also

@DeviaVir
DeviaVir / nginx
Created November 7, 2014 11:16
/etc/logrotate.d/nginx
/var/log/nginx/*/*.log {
create 0644 nginx nginx
daily
rotate 10
missingok
notifempty
compress
sharedscripts
postrotate
/etc/init.d/nginx reopen_logs
@DeviaVir
DeviaVir / youtube-categories.json
Created November 19, 2014 11:13
All YouTube Categories
{
"kind": "youtube#videoCategoryListResponse",
"etag": "\"yHwg34KvgIlW9-uBcSEkgasDbzI/7bU1D6PRprGz-kkVw8F263q0FD8\"",
"items": [
{
"kind": "youtube#videoCategory",
"etag": "\"yHwg34KvgIlW9-uBcSEkgasDbzI/Xy1mB4_yLrHy_BmKmPBggty2mZQ\"",
"id": "1",
"snippet": {
"channelId": "UCBR8-60-B28hp2BmDPdntcQ",
@DeviaVir
DeviaVir / dabblet.css
Created January 5, 2015 11:17 — forked from LeaVerou/dabblet.css
The cicada principle in animations
/**
* The cicada principle in animations
* Remember the cicada principle that used prime numbers to make multiple overlaid repeated backgrounds seem more random?
* There’s no reason it can’t be applied to repeating linear animations too (using primes for the durations, divided by 10)
*/
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes radius { 50% { border-radius: 50%; } }
@keyframes color { 50% { color: orange; } }
@keyframes width { 50% { border-width: .3em; } }
@DeviaVir
DeviaVir / nginx.conf
Last active August 29, 2015 14:12
Subdomain rewrite
location /wp {
if (!-e $request_filename) {
rewrite ^(.*)$ /wp/index.php?/$1 last;
break;
}
}
@DeviaVir
DeviaVir / ips.txt
Created January 7, 2015 17:13
CryptoPHP Control Node IP addresses
192.42.116.41/32
209.99.40.219/32
78.138.118.195/32
78.138.118.196/30
78.138.118.200/29
78.138.118.208/31
209.99.40.220/30
87.119.222.112/32
87.119.222.108/30
87.119.222.112/29
@DeviaVir
DeviaVir / email.eml
Created January 8, 2015 08:39
Formal complaint to Spamhaus
Dear Spamhaus,
We would like to submit a formal complaint regarding one of your divisions, the CBL (CBL.abuseat.org), and hope you will swiftly take action regarding these practices.
Two days ago, our customers started to notify us that we were blacklisted.
The CBL had picked this up using a sinkhole, and had banned our IP's. Upon investigation we found several hacked wordpress and joomla websites, that were being abused, we cleaned these up and forced the customers to upgrade.
This seemed to not please the CBL, however, as they already enforced a 48 hour ban on all of our IP's. One IP address which was not even active the last month. Imagine our surprise when we tried to switch one out to use it. I think it's outrageous to immediately enforce a 48 hour ban on any IP connecting to the sinkhole, these IP's are used to send legitimate e-mail (usually), and all of our customers are impacted by this practice.
We would like to suggest to you to use a different practice, please do not ban IP's for 48 (!) hours
<?php
// bootstrap.php
// trust x-forwarded-for headers, needed because we are behind a proxy/load balancer
if(!empty($app['http.options']['trustedProxies'])) {
Request::setTrustedProxies($app['http.options']['trustedProxies']);
}
// config/default.php
$config['http.options'] = [