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 python3 | |
# -*- coding: utf-8 -*- | |
# A custom exception class that closely resembles the behavior of | |
# Python’s built-in OSError, including arguments and automatic | |
# subclassing. Useful if a fine-grained error handling based on | |
# error numbers is needed. | |
class VirtualOSError(Exception): | |
"""Base exception for all virtual OS related errors. |
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
<?php | |
// Stop PHP’s dangerous name handling | |
function undefined_name_error($errno, $errstr, $errfile='', $errline=0, $errcontext=NULL) { | |
if (stripos($errstr, 'Undefined') !== false) { | |
error_log("PHP Fatal error: $errstr in $errfile on line $errline"); | |
exit(255); | |
} | |
else { | |
return false; |
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
# ~/.pythonrc | |
# -*- coding: utf-8 -*- | |
# Make `exit` work without parentheses | |
import sys | |
if "site" in sys.modules: | |
Quitter = type(exit) | |
Quitter.__str__ = Quitter.__repr__ | |
Quitter.__repr__ = Quitter.__call__ | |
del Quitter |
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 --login | |
# Make a backup of the user's Bash history | |
if [ -z "${HISTFILE}" ]; then | |
cd "${HOME}" | |
hfile='.bash_history' | |
else | |
cd "${HISTFILE%/*}" | |
hfile="${HISTFILE##*/}" | |
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
#!/bin/sh -eu | |
python3 -m venv --upgrade /opt/certbot | |
python3 -m venv --upgrade-deps /opt/certbot | |
/opt/certbot/bin/pip install --upgrade certbot certbot-dns-standalone |
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 -eu | |
if [ $(id -u) -ne 0 ]; then | |
echo 'Only root can do this' >&2 | |
exit 1 | |
fi | |
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql | |
mysql_tzinfo_to_sql --leap /etc/localtime | mysql mysql | |
systemctl restart mysql.service |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 python3 | |
# -*- coding: utf-8 -*- | |
# A simple abstraction of Python’s ConfigParser. | |
# It features implicit type conversion and defaults through prior | |
# registration of settings. It can be used to save and read settings | |
# without bothering about the specifics of ConfigParser or the INI files | |
# themselves. It could also serve as a starting point to abstract | |
# platform-specific saving methods through its general API. |
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 -eu | |
while read -r discard; do :; done; unset -v discard | |
echo 'Content-Type: text/plain; charset=UTF-8' | |
echo 'Cache-Control: no-store, max-age=0' | |
echo | |
git fetch -q github main | |
git reset --hard github/main | |
git clean -d -e '/deploy.cgi' -x |
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
-----BEGIN PRIVATE KEY----- | |
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDCS1cz8+MwcnN6 | |
A5qK30AQX+CPXNwuYF738+1zhlVuHzdo/3X76Go1lCfFM+8lpYYxKPOsz6cgLf5f | |
HWfc3Ikj1OCmHs5LorfQKVormkbBW9aBwaN79Uq+Y8+r6dz0pT0HyLzcWQ/DDgbX | |
GAzU1hZcuYw5UjN4dptpZk27sTKTrukgNcMttC0CRYgpV1ICCgeT7D1mVAoB+oeF | |
0I+OxkX5vkPZAab/nzGSuW+hMHiwsf0OoNtkAxkGjrPvHXmB6t/MrYDByCQBi3x9 | |
jhRKZ4ADPXCZMTw7iUoAqBDJ4imMbHN/cfonuKmU0YSbQJYLrZFhOVWHHGJeeXqW | |
8EuYojaxsxR8YRirNKNVSaUA+7zo0zMWo1Ig1tqONSwZys3QbZA4W3nibICZA8bR | |
0onKo1iyq+ASHxD7hEEKHLuZnfgs5y8jXbIyxOMAiiFHJoRwwckJ3PcsmvUmpHuG | |
MinJisbDAVGk2wAzZ7clZs9l510sgFw9RrEGvedB1lO6UFxs2VxxyH6sOfWc4HTs |
OlderNewer