Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"net/http"
"crypto/tls"
"crypto/x509"
"encoding/pem"
)
var chain=`-----BEGIN CERTIFICATE-----
MIIG5jCCBc6gAwIBAgIQAze5KDR8YKauxa2xIX84YDANBgkqhkiG9w0BAQUFADBs
{
"configurations": [
{
"global": {
"nagios_contact": "admin@localhost"
}
},
{
"hdfs-site": {
"dfs.datanode.data.dir": "/mnt/fs1/,/mnt/fs2/"
<!DOCTYPE html>
<script src="http://mbostock.github.com/d3/d3.v2.js?2.8.1"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<style>
body {
font: 10px sans-serif;
}
rect {
@lalyos
lalyos / README.md
Last active August 29, 2015 14:05 — forked from mbostock/.block
@lalyos
lalyos / tool.sh
Created September 14, 2015 15:34 — forked from anonymous/tool.sh
docopts bash
#!/bin/bash
main() {
eval "$(docopts -V - -h - : "$@" <<EOF
Usage: tool [options]
--page=<page> Page numbers [default: 10]
--user=<user> Username
--password=<pwd> Password
@lalyos
lalyos / README.md
Last active December 12, 2015 05:08 — forked from mbostock/.block

Let's see where are the buyers of g360!

@lalyos
lalyos / README.md
Last active December 12, 2015 05:09 — forked from mbostock/.block

Let's see where are the G360 customers?

@lalyos
lalyos / main.go
Created September 22, 2016 15:59 — forked from lizrice/main.go
Container from scratch
package main
// @lizrice, mostly copied from @doctor_julz: https://gist.github.com/julz/c0017fa7a40de0543001
import (
"fmt"
"os"
"os/exec"
"syscall"
)
@lalyos
lalyos / echoHttpRequest.js
Created October 27, 2016 20:25 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
console.log("Console messages are sent to /logs");
console.log(hook.params);
console.log(hook.req.path);
console.log(hook.req.method);
@lalyos
lalyos / debounce-with-tmr.lua
Created March 20, 2017 17:44 — forked from marcelstoer/debounce-with-tmr.lua
NodeMCU debounce based on timer with GPIO pullup
-- inspired by https://github.com/hackhitchin/esp8266-co-uk/blob/master/tutorials/introduction-to-gpio-api.md
-- and http://www.esp8266.com/viewtopic.php?f=24&t=4833&start=5#p29127
local pin = 4 --> GPIO2
function debounce (func)
local last = 0
local delay = 50000 -- 50ms * 1000 as tmr.now() has μs resolution
return function (...)
local now = tmr.now()