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
#!/usr/bin/python | |
# coding: utf-8 | |
""" | |
qr - Convert stdin (or the first argument) to a QR Code. | |
When stdout is a tty the QR Code is printed to the terminal and when stdout is | |
a pipe to a file an image is written. The default image format is PNG. | |
""" | |
import sys | |
import optparse |
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
██████████████████████████████████████████████████████████████ | |
██ ██ ██████ ██ ████ ██ | |
██ ██████████ ██ ██ ████ ████ ██████ ██████████ ██ | |
██ ██ ██ ████ ██ ██████ ██ ██ ██ ██ ██ | |
██ ██ ██ ██ ████ ██ ████ ██ ████ ██ ██ ██ | |
██ ██ ██ ████ ████ ██ ██ ████ ██ ██ ██ | |
██ ██████████ ████ ████ ████ ██ ██████████ ██ | |
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ | |
██████████████████ ████ ████████████████████ | |
██ ██ ██ ████ ██ ██ ██████ ████ ██ ██ |
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
import ldap | |
# ldap server settings | |
AUTH_LDAP_SERVER_URI = "ldap://ldap.example.com" | |
AUTH_LDAP_START_TLS = True | |
# User DN for authentication | |
AUTH_LDAP_USER_DN_TEMPLATE = 'uid=%(user)s,ou=People,dc=example,dc=com' | |
# Restrict log in to only members that belong to staff group |
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
user "blah"; | |
password "blah"; | |
pass_auth; | |
group myserver => "mypi"; | |
task "myperl", group => "myserver", sub { | |
file "/home/user/myperl.pl", | |
source => "myperl.pl", | |
mode => 755; |
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
# Maintainer: Nikolay Amiantov <[email protected]> | |
# pkgbase=pfixtools-git | |
# pkgname=(pfix-srsd-git postlicyd-git) | |
pkgname=pfix-srsd-git | |
pkgver=0.8.r110.g6096375 | |
pkgrel=1 | |
# pkgdesc="Collection of postfix-related tools." | |
pkgdesc="This daemon brings SRS to postfix using its tcp_table or socketmap_table mechanisms." | |
# makedepends=(libsrs2 libev pcre unbound libsrs2 tokyocabinet |
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
# CA | |
openssl genrsa -des3 -passout pass:x -out ca.pass.key 2048 | |
openssl rsa -passin pass:x -in ca.pass.key -out ca.key | |
openssl req -new -x509 -days 365 -key ca.key -out ca.crt | |
# server | |
openssl genrsa -des3 -out server.key 2048 | |
openssl req -new -key server.key -out server.csr | |
openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt |
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
### Keybase proof | |
I hereby claim: | |
* I am Lance0312 on github. | |
* I am lancechen (https://keybase.io/lancechen) on keybase. | |
* I have a public key whose fingerprint is F8DA BD84 6787 EBE5 C8CA 58C6 BD3F 87DB 6A0C 53E2 | |
To claim this, I am signing this object: |
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
#!/usr/bin/env python | |
from jsonschema import Draft4Validator, RefResolver | |
import json | |
import os | |
import sys | |
if len(sys.argv) != 3: | |
print("Usage: %s <data file> <schema file>" % sys.argv[0]) | |
exit(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
#include <sys/socket.h> | |
#include <sys/un.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
static void err_quit(const char * const msg) { | |
puts(msg); | |
exit(-1); | |
} |