| A | B |
|---|---|
| newline | B |
This file contains hidden or 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
| body { margin 0 1em; } @media screen and (min-width: 42em) { body { margin: auto; max-width: 40em; } } |
This file contains hidden or 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
| function Cache(n, f) { | |
| if (!new.target) { | |
| return new Cache(n, f); | |
| } | |
| n = n >= 2 ? n : 2; | |
| var kv = Object.create(null); | |
| var ki = Object.create(null); | |
| var ik = Object.create(null); | |
| var size = 0; |
This file contains hidden or 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/bash -x | |
| INTERFACE="$1" | |
| DEVICE="$2" | |
| SPEED="$3" | |
| LOCALIP="$4" | |
| REMOTEIP="$5" | |
| IPPARAM="$6" | |
| if [[ "$IPPARAM" != "vpn" ]] ; then |
In our discussion yesterday, @bradfitz asked if weak pointers made it possible to maintain a map of expensive derived information about something without preventing the GC of that something. Here is a worked example of how weak pointer enables that:
var cache struct { mu sync.Mutex m map[weak.Pointer[Foo]]*derived } func init() { cache.m = make(map[weak.Pointer[Foo]]*derived)
From LinuxBender @ HN
Create /etc/modprobe.d/nf_conntrack.conf:
options nf_conntrack expect_hashsize=256400 hashsize=256400
And then in /etc/sysctl.conf:
This file contains hidden or 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 | |
| set -e | |
| require() { | |
| if ! command -v "$1" > /dev/null 2>/dev/null ; then | |
| >&2 echo "$1 utility not found!" | |
| exit 1 | |
| fi | |
| } |
This file contains hidden or 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
| global | |
| log /dev/log local0 | |
| log /dev/log local1 notice | |
| chroot /var/lib/haproxy | |
| stats socket /run/haproxy/admin.sock mode 660 level admin | |
| stats timeout 30s | |
| user haproxy | |
| group haproxy | |
| daemon |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import sys | |
| from Crypto.PublicKey import RSA | |
| from fractions import gcd | |
| if __name__ == '__main__': | |
| if len(sys.argv) != 2: | |
| print >> sys.stderr, "Usage: %s <RSA privatekey file>" % sys.argv[0] | |
| exit(2) |
This file contains hidden or 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
| # /lib/systemd/system/openvswitch-ipsec.service | |
| [Unit] | |
| Description=Open vSwitch IPsec daemon | |
| Requires=openvswitch-switch.service | |
| After=openvswitch-switch.service | |
| [Service] | |
| Type=forking | |
| PIDFile=/run/openvswitch/ovs-monitor-ipsec.pid | |
| ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \ |
NewerOlder