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
cecho(){ | |
RED="\033[0;31m" | |
GREEN='\033[0;32m' | |
YELLOW='\033[1;33m' | |
NC='\033[0m' # No Color | |
printf "${!1}${2} ${NC}\n" | |
} | |
assert_fail(){ |
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 argparse | |
import logging | |
class Foo(): | |
def __init__(self): | |
self.args = None | |
def run(self, args): | |
self.args = args |
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 | |
# -*- coding: utf-8 -*- | |
# vim:fenc=utf-8 | |
# | |
# Copyright © 2019 Tim Hughes <[email protected]> | |
# | |
# Distributed under terms of the MIT license. | |
""" | |
This is an example python server than can use either |
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
thughes@krypton [0] $ gsettings get org.freedesktop.ibus.panel.emoji hotkey | |
['<Control><Shift>e'] | |
thughes@krypton [0] $ gsettings set org.freedesktop.ibus.panel.emoji hotkey [] | |
thughes@krypton [0] $ gsettings get org.freedesktop.ibus.panel.emoji hotkey | |
@as [] |
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
from datetime import datetime, timedelta, tzinfo | |
class UTC(tzinfo): | |
def utcoffset(self, dt): return timedelta(0) | |
def dst(self, dt): return timedelta(0) | |
def tzname(self, dt): return 'UTC' | |
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 | |
# This self-executing Java program uses the following /embedded shell script/ to compile & execute itself.. | |
# magic constant holding length of script | |
SKIP=26 | |
# parse our name.. | |
FILE=`basename $0 .java` | |
# get some working space, clean up old crud |
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 | |
# SPDX-License-Identifier: MIT | |
## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]> | |
## | |
## This script is licensed under the terms of the MIT license. | |
## https://opensource.org/licenses/MIT | |
# | |
# Lockable script boilerplate | |
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 | |
# | |
# build_wachman_rpm.sh | |
# Copyright (C) 2018 Tim Hughes <[email protected]> | |
# | |
# Distributed under terms of the MIT license. | |
# | |
# Uses FPM to create a rpm for easy installation and removal | |
VERSION='v4.9.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
export FQDN=foo.int.example.com | |
export GANDI_LIVEDNS_KEY="xxxxxxxxxxxxxxxx" | |
curl https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh > acme.sh | |
chmod a+x "acme.sh" | |
./acme.sh --install | |
wget https://raw.githubusercontent.com/Neilpang/acme.sh/master/dnsapi/dns_gandi_livedns.sh -O /root/.acme.sh/dns_gandi_livedns.sh | |
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
urlencode() { | |
# urlencode <string> | |
old_lc_collate=$LC_COLLATE | |
LC_COLLATE=C | |
local length="${#1}" | |
for (( i = 0; i < length; i++ )); do | |
local c="${1:i:1}" | |
case $c in | |
[a-zA-Z0-9.~_-]) printf "$c" ;; |