Skip to content

Instantly share code, notes, and snippets.

@RobK
RobK / gist:52bfbc2df76f5189e3cc
Created August 8, 2015 09:57
Install basic software
opkg update
opkg install openvpn-openssl luci-app-openvpn
@RobK
RobK / gist:efb7135b3e4ece9e7448
Last active December 8, 2016 23:41
Create userpass file
cat > /etc/openvpn/userpass.txt << EOF
YOUR_PIA_USERNAME
YOUR_PIA_PASSWORD
EOF
chmod 0400 /etc/openvpn/userpass.txt
cat > /etc/openvpn/crl.pem<< EOF
-----BEGIN X509 CRL-----
MIIBgTCB6zANBgkqhkiG9w0BAQ0FADCBpTELMAkGA1UEBhMCVVMxCzAJBgNVBAgT
Ak9IMREwDwYDVQQHEwhDb2x1bWJ1czEgMB4GA1UEChMXUHJpdmF0ZSBJbnRlcm5l
dCBBY2Nlc3MxIzAhBgNVBAMTGlByaXZhdGUgSW50ZXJuZXQgQWNjZXNzIENBMS8w
LQYJKoZIhvcNAQkBFiBzZWN1cmVAcHJpdmF0ZWludGVybmV0YWNjZXNzLmNvbRcN
MTQwNTA3MTgwOTE5WhcNMjQwNTA3MTgwOTE5WjAUMBICAQEXDTE0MDQyODIyMDMy
NVowDQYJKoZIhvcNAQENBQADgYEA4EA2wjio+BxYFui1mBj5gmypxUQyA7xQJ3Vo
cwWSllQKHpfmQ7fwyTL22uc21W9hM4geD1FwoXDUEraQjfyBJOxJwc6GOhTN2wHv
3vplKjdbXmxxAfjduBvlIB0a6qSz1L6hwZJrZUGimlWS9NQrmYaKLbtG07n2UyA+
@RobK
RobK / gist:763c4807bd369e70d9b3
Last active August 29, 2015 14:26
Add firewall rules
cat >> /etc/config/firewall << EOF
config zone
option name 'VPN_FW'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
option network 'PIA_VPN'
@RobK
RobK / serial.js
Last active June 28, 2022 02:54
Generate Random Serial Keys
/**
* Created by Robert Kehoe on 09/06/2014.
* MIT Licensed.
*
* 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 furnished to do so, subject to
"Drag and drop test (useCss)" : function (browser) {
browser
.useCss()
.moveToElement('#draggable', 0, 0)
.mouseButtonDown(0)
.moveToElement('body', 200, 600) // Move to offset position of 200(x) 600(y)
.mouseButtonUp(0)
.pause(5000) // Keep browser open for 5 seconds so you can see result
.end();
}
@RobK
RobK / example.js
Last active August 29, 2015 14:00
Photobox-download Example
var photoBox = require('photobox-downloader');
var config = {
"baseDomain" : "www.photobox.ie",
"authCookieValue" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // change to your own auth cookie value
};
// Login and download all photos from every album
photoBox.login(config, function (err) {
if (err) {
console.log('ERROR! Something went wrong logging in, check your authCookieValue!');
@RobK
RobK / core.js
Last active January 28, 2022 10:03
NodeJS example code to generate a RFC 2104 compliant HMAC
var crypto = require("crypto");
/**
* Get the signature/digest of a supplied input string
* @param data [Required] The String to encode
* @param awsSecretKey [Required] Secret key shared with Amazon
* @param algorithm [Optional] Encryption algorithm, defaults to sha256
* @param encoding [Optional] The output encoding. Default to base64
* @returns Str with encoded digest of the input string
*/
function generateHmac (data, awsSecretKey, algorithm, encoding) {
@RobK
RobK / karma.conf.js
Created September 4, 2013 13:41
Original karma.conf.js
// Contents of: config/karma.conf.js
basePath = '../';
files = [
JASMINE,
JASMINE_ADAPTER,
'app/lib/angular/angular.js',
'app/lib/angular/angular-*.js',
'test/lib/angular/angular-mocks.js',
'app/js/**/*.js',