Skip to content

Instantly share code, notes, and snippets.

@shmick
shmick / verifyAkamaiIp.sh
Created January 24, 2017 15:56 — forked from rafaelfelix/verifyAkamaiIp.sh
Shell script to programmatically check if an IP address belongs to Akamai. Requires Akamai login, password and permission to access https://control.akamai.com/partner-tools/index.action?target=VerifyAkamaiIP
#!/bin/bash
#
# Issue request to Akamai tool verifyAkamaiIpInternal to check if
# the given IP address belongs to Akamai
#
## defining helper functions first
# show usage
@shmick
shmick / ColorTwinkles.ino
Created November 30, 2016 21:25 — forked from kriegsman/ColorTwinkles.ino
Twinkling 'holiday' lights that fade in and out.
#include "FastLED.h"
#define LED_PIN 3
#define LED_TYPE WS2811
#define COLOR_ORDER RGB
#define NUM_LEDS 50
CRGB leds[NUM_LEDS];
// Twinkling 'holiday' lights that fade up and down in brightness.
// Colors are chosen from a palette; a few palettes are provided.
@shmick
shmick / stripedTwinkle.ino
Created November 21, 2016 05:58 — forked from hsiboy/stripedTwinkle.ino
fastled - striped twinkle
void stripedTwinkle(){
int twinkle = 0;
int flash = 15; // twinkle flash time
int lag = 50; // time between twinkles
for (i = 0; i <LED_NUM i++)
{
if (i % 2 == 0)
{
leds[twinkle] = CRGB::Red;
@shmick
shmick / FastLED-Sunrise.ino
Created November 21, 2016 03:24 — forked from jasoncoon/FastLED-Sunrise.ino
Simple FastLED "sunrise" example that fades from black to red, orange, yellow, and white.
#include "FastLED.h"
// How many leds in your strip?
#define NUM_LEDS 60
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 3
#define CLOCK_PIN 13
@shmick
shmick / SoftTwinkles.ino
Created November 21, 2016 03:20 — forked from kriegsman/SoftTwinkles.ino
Soft, warm twinkles. Super short code, super complicated theory of operation.
#include "FastLED.h"
#define LED_PIN 3
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
#define NUM_LEDS 30
CRGB leds[NUM_LEDS];
#define BRIGHTNESS 120
#define DENSITY 80
@shmick
shmick / TwinkleFOX.ino
Created November 20, 2016 16:17 — forked from kriegsman/TwinkleFOX.ino
TwinkleFOX: Colored Twinkling Holiday Lights
#include "FastLED.h"
#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
#warning "Requires FastLED 3.1 or later; check github for latest code."
#endif
#define NUM_LEDS 100
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
@shmick
shmick / build_nginx.sh
Created February 17, 2016 20:36 — forked from MatthewVance/build_nginx.sh
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# make script exit if a simple command fails and
# make script print commands being executed
set -e -x
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2f
export VERSION_NGINX=nginx-1.9.11
@shmick
shmick / build_nginx.sh
Last active January 30, 2016 20:00 — forked from MattWilcox/build_nginx.sh
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2f
export VERSION_NGINX=nginx-1.9.9
# URLs to the source directories
export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
export SOURCE_OPENSSL=https://www.openssl.org/source/
@shmick
shmick / README.md
Created January 7, 2016 01:31 — forked from renchap/README.md
One-line certificate generation/renews with Letsencrypt and nginx

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {
@shmick
shmick / usbreset.c
Created January 6, 2016 04:23 — forked from x2q/usbreset.c
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
*
* */