Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
""" | |
Support for TPLink HS100/HS110/HS200 smart switch. | |
For more details about this platform, please refer to the documentation at | |
https://home-assistant.io/components/switch.tplink/ | |
""" | |
import logging | |
import time | |
import voluptuous as vol |
// This is a minimal Base64 encode/decode utility for Nashorn -> JavaScript | |
// Add error checking for data types as needed within encode or decode | |
var Base64 = { | |
decode: function (str) { | |
return new java.lang.String(java.util.Base64.decoder.decode(str)); | |
}, | |
encode: function (str) { | |
return java.util.Base64.encoder.encodeToString(str.bytes); | |
} | |
}; |
#!/bin/sh | |
# Make sure to: | |
# 1) Name this file `backup.sh` and place it in /home/ubuntu | |
# 2) Run sudo apt-get install awscli to install the AWSCLI | |
# 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
# 4) Fill in DB host + name | |
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
# 6) Run chmod +x backup.sh | |
# 7) Test it out via ./backup.sh |
# post_loc.txt contains the json you want to post | |
# -p means to POST it | |
# -H adds an Auth header (could be Basic or Token) | |
# -T sets the Content-Type | |
# -c is concurrent clients | |
# -n is the number of requests to run in the test | |
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
var MyApp = angular.module('MyApp'); | |
MyApp.factory('msgBus', ['$rootScope', function($rootScope) { | |
var msgBus = {}; | |
msgBus.emitMsg = function(msg, data) { | |
data = data || {}; | |
$rootScope.$emit(msg, data); | |
}; | |
msgBus.onMsg = function(msg, func, scope) { | |
var unbind = $rootScope.$on(msg, func); | |
if (scope) { |
#!/usr/bin/env python | |
# decrypt_dbvis.py ~ [email protected] | |
# DbVisualizer uses PBEWithMD5AndDES with a static key to store passwords. | |
# This is a quick hack to extract and decrypt credentials from DbVisualizer config files. | |
# Tested against DbVisualizer Free 9.0.9 and 9.1.6 | |
""" | |
[2014-03-25 02:05:30][not-the-sea workspace]$ security/p/gerry/misc/decrypt_dbvis.py | |
[+] DbVisualizer Password Extractor and Decryptor (@gerryeisenhaur) | |
[+] Additional Usage Options: | |
[+] security/p/gerry/misc/decrypt_dbvis.py <config filename> |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
_.mixin({ | |
// Get/set the value of a nested property | |
deep: function (obj, key, value) { | |
var keys = key.replace(/\[(["']?)([^\1]+?)\1?\]/g, '.$2').replace(/^\./, '').split('.'), | |
root, | |
i = 0, | |
n = keys.length; |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
/*Make position:fixed work in IE6!*/ | |
.fixed-top /* position fixed Top */{position:fixed;bottom:auto;top:0;} | |
.fixed-bottom /* position fixed Bottom */{position:fixed;bottom:0;top:auto;} | |
.fixed-left /* position fixed Left */{position:fixed;right:auto;left:0;} | |
.fixed-right /* position fixed right */{position:fixed;right:0;left:auto;} | |
* html,* html body /* IE6 Fixed Position Jitter Fix */{background-image:url(about:blank);background-attachment:fixed;} | |
* html .fixed-top /* IE6 position fixed Top */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));} | |
* html .fixed-right /* IE6 position fixed right */{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));} |