This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config() | |
const AWS = require('aws-sdk'); | |
AWS.config.update({ | |
credentials: { | |
accessKeyId: 'xxx', | |
secretAccessKey: 'xxx' | |
}, | |
region: 'eu-central-1' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias npm='docker run -v `pwd`:/app --rm -it -w=/app node:10 npm' | |
# Use NODEV=8 npm to specify a different node version | |
npm() { docker run -v `pwd`:/app --rm -it -w=/app node:${NODEV-10} npm; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "localtunnel", | |
"script": "bin/server", | |
"args": "--port=1234 --host=example.com", | |
"cwd": "/opt/localtunnel", | |
"env": { | |
"DEBUG": "localtunnel*", | |
"NODE_ENV": "production" | |
}, | |
"error_file": "/mnt/usbstick2/logs/lt-error.log", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( $argc === 1 ) { | |
die('Will periodically backup a file. Usage: php ' . $argv[0] . ' filename' . PHP_EOL); | |
} | |
$filename = $argv[1]; | |
if( !file_exists($filename) ) | |
die('File ' . $filename . ' not found.' . PHP_EOL); | |
$backupEverySeconds = 60*30; //backup every half hour |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir $1.git | |
cd $1.git | |
git init --bare | |
cd .. | |
chown -R git:git $1.git | |
chmod -R g+w $1.git | |
echo "Add as remote: git remote add origin user@git.server:$1.git" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>RTMDash</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<style type="text/css"> | |
/* IE10 Consumer Preview */ | |
background-image: -ms-linear-gradient(bottom, #FFFFFF 0%, #23A614 100%); | |
/* Mozilla Firefox */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name RockMongo with ACE | |
// @match http://127.0.0.1/rockmongo/* | |
// @match https://127.0.0.1/rockmongo/* | |
// ==/UserScript== | |
// Stolen from http://stackoverflow.com/a/3550261/360593 | |
function addHeadJS(callback) { | |
var script = document.createElement("script"); | |
script.setAttribute("src", "//cdnjs.cloudflare.com/ajax/libs/headjs/0.99/head.min.js"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: openhab | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: OpenHAB Daemon | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( isset($_REQUEST['url']) ) { | |
$url = $_REQUEST['url']; | |
$host = $_REQUEST['host']; | |
/* Borrowed from http://stackoverflow.com/questions/9932636/how-to-set-hostname-using-php-curl-for-a-specific-ip */ | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: ' . $host)); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
echo curl_exec($ch); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload = function () { | |
var menu = document.getElementById('menu'); | |
var init = menu.offsetTop; | |
var docked; | |
window.onscroll = function () { | |
if (!docked && (menu.offsetTop - scrollTop() < 0)) { | |
menu.style.top = 0; | |
menu.style.position = 'fixed'; | |
menu.className = 'docked'; |
NewerOlder