Skip to content

Instantly share code, notes, and snippets.

View peshi's full-sized avatar

Roland Ekström peshi

  • Peshi AB
  • Sweden
View GitHub Profile
const fs = require('fs')
const _sass = require('node-sass')
const cssnano = require('cssnano')
const purifycss = require('purify-css')
const promisify = (ctx, func = ctx) => (...args) => {
return new Promise((resolve, reject) => {
func.apply(ctx, [...args, (err, result) => err ? reject(err) : resolve(result)])
})
}
@peshi
peshi / blockpeers.sh
Created March 7, 2016 02:02 — forked from jult/blockpeers.sh
blocking p2p peer snoopers and evil corp (for Tixati IP filter and such)
#!/bin/sh
# This script runs every other night at 04:56 CET on a webserver I maintain
# Results are always at: https://jult.net/block.txt ( or https://jult.net/block.txt.gz )
# And much smaller, stripped of BS; https://jult.net/bloc.txt
# For use in Tixati IP filter: https://jult.net/bloc.txt.gz
# And finally a txt file with just the bold IP-ranges: https://jult.net/bl.txt (or https://jult.net/bl.txt.gz )
# Download open block-lists, unpack, filter:
curl -s https://www.iblocklist.com/lists.php | grep -A 2 Bluetack | xargs wget -qO - --limit-rate=500k | gunzip -f | egrep -v '^#' > /tmp/xbp
@peshi
peshi / letsencrypt.md
Created December 5, 2015 04:20 — forked from xrstf/letsencrypt.md
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

@peshi
peshi / UUID.php
Created February 11, 2014 00:23 — forked from dahnielson/UUID.php
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4211 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
<?php
namespace Acme\DemoBundle\DBAL\Type;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
/**
* Class SemicolonArrayType represents an array of values that will be persisted as a string of semicolon-separated strings.
*
#!/bin/sh
# Download and build OS X Mavericks XNU Source
if [ ! -d "dtrace-118" ]; then
curl -O http://opensource.apple.com/tarballs/dtrace/dtrace-118.tar.gz
tar zxf dtrace-118.tar.gz
rm dtrace-118.tar.gz
fi
if [ ! -d "AvailabilityVersions-6" ]; then
curl -O http://opensource.apple.com/tarballs/AvailabilityVersions/AvailabilityVersions-6.tar.gz
tar zxf AvailabilityVersions-6.tar.gz