When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}| LDAP_SERVER = "ldaps://my-ldap-server.com/" | |
| LDAP_BASE = "dc=my-ldap-server,dc=com" | |
| def users_ldap_groups(uid): | |
| """ Returns a list of the groups that the uid is a member of. | |
| Returns False if it can't find the uid or throws an exception. | |
| It's up to the caller to ensure that the UID they're using exists! | |
| """ | |
| logger.debug("uid: ", uid) |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from flask import * | |
| import os | |
| from werkzeug import secure_filename | |
| app = Flask(__name__) | |
| #searchword = request.args.get('q', '') |
| ######################## | |
| # UUID for SQLite hack # | |
| ######################## | |
| from sqlalchemy.types import TypeDecorator, CHAR | |
| from sqlalchemy.dialects.postgresql import UUID | |
| import uuid | |
| class GUID(TypeDecorator): |
If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:
$ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)$ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)$ git config --global alias.logs "log --show-signature" (now available as $ git logs)$ git config --global alias.cis "commit -S" (optional if global signing is false)$ echo "Some content" >> example.txt$ git add example.txt$ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)| # Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands) | |
| gpg --gen-key | |
| # maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null` | |
| # check current keys: | |
| gpg --list-secret-keys --keyid-format LONG | |
| # See your gpg public key: | |
| gpg --armor --export YOUR_KEY_ID | |
| # YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333) |
| import ldap | |
| def check_credentials(username, password): | |
| """Verifies credentials for username and password. | |
| Returns None on success or a string describing the error on failure | |
| # Adapt to your needs | |
| """ | |
| LDAP_SERVER = 'ldap://xxx' | |
| # fully qualified AD user name | |
| LDAP_USERNAME = '%[email protected]' % username |
| /* border-serrated - a zig zag triangle border with linear gradient | |
| */ | |
| @mixin border-top-serrated($size, $color-outer) { | |
| & { | |
| position: relative; | |
| overflow: auto; | |
| padding-top: $size; | |
| } | |
| &:before { | |
| top: 0px; |
| #!/bin/bash | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
| #!/usr/bin/env sh | |
| # Link good as of June 2018 | |
| # Download lists, unpack and filter, write to stdout | |
| curl -s https://www.iblocklist.com/lists.php \ | |
| | sed -n "s/.*value='\(http:.*\?list=.*\)'.*/\1/p" \ | |
| | xargs wget -O - \ | |
| | gunzip \ | |
| | egrep -v '^#' |