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
| frontend www-http | |
| bind :80 | |
| bind *:443 ssl crt /etc/haproxy/certs no-sslv3 | |
| capture request header X-Forwarded-For len 50 | |
| acl is_cf req.hdr(cf-connecting-ip) -m found | |
| http-request set-header X-Client-IP %[src] if !is_cf | |
| http-request set-header X-Client-IP %[hdr(cf-connecting-ip)] if is_cf |
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 | |
| mkdir ~/glibc_install; cd ~/glibc_install | |
| wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz | |
| tar zxvf glibc-2.14.tar.gz | |
| cd glibc-2.14 |
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
| import macros | |
| template value(x: untyped) {.pragma.} | |
| proc init[T](t: typedesc[T]): T = | |
| for k, v in result.fieldPairs: | |
| if v.hasCustomPragma(value): | |
| v = v.getCustomPragmaVal(value) | |
| type | |
| MyObj = object |
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 | |
| command -v curl >/dev/null 2>&1 || { echo >&2 "curl is required"; exit 1; } | |
| if [ "$1" == "" ]; then | |
| echo "Usage: ${0} <warp+ id>" | |
| exit 1 | |
| fi | |
| RUNNING=true | |
| BOOSTED=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
| import prompt, unicode, terminal | |
| proc autoComplete(line: seq[Rune], cursorpos: int): seq[string] {.gcsafe.} = | |
| if line.len == 0: | |
| return @[] | |
| if $line == "hi": | |
| result = @["Hello", "Xin chao", "Bonjour"] | |
| else: |
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
| var data = file.readFile() | |
| var filedata = splitToChunks(data,24) | |
| echo filedata | |
| for i in filedata: | |
| echo i | |
| client.send(i & "\r\L") | |
| client.send("DONE" & "\r\L") |
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 | |
| if [ $# -ne 3 ]; then | |
| echo "usage: $0 <unix socket file> <host> <listen port>" | |
| exit | |
| fi | |
| SOCK=$1 | |
| HOST=$2 | |
| PORT=$3 |
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
| /* | |
| CREDIT: Josh Sherman (https://joshtronic.com/2017/07/26/hide-title-bars-in-gnome-shell) | |
| USAGE: copy and paste the code bellow in to ~/.config/gtk-3.0/gtk.css | |
| */ | |
| window.ssd.maximized separator:first-child + headerbar:backdrop, | |
| window.ssd.maximized separator:first-child + headerbar, | |
| window.ssd.maximized headerbar:first-child:backdrop, | |
| window.ssd.maximized headerbar:first-child, |
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
| const NULL* = "\0" | |
| type Row = seq[string] | |
| let r: Row = @["qwe", NULL] |
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/perl | |
| use strict; | |
| # Usage: | |
| # make_classless_option({ "subnet/mask" => "router", "subnet/mask" => "router", ... }); | |
| # subnet the subnet address, 4 dot-separated numbers | |
| # mask the subnet mask length (e.g. /24 corresponds to 255.255.255.0, /8 corresponds to 255.0.0.0) | |
| # router the router address, 4 dot-separated numbers | |
| sub make_classless_option{ | |
| my $routes = shift; |