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
(sudo -iu postgres psql 2>/dev/null -Atc '\l'| \ | |
awk -F"|" '!/^=|^postgres=|template/{print $1}')| \ | |
xargs -rn1 -P1 bash -c 'sudo -iu postgres psql 2>/dev/null ${0} -Atc "\dt+;"| \ | |
awk -vH=${0} -F"|" '"'"'{print H,$2}'"'"''| \ | |
xargs -rn2 -P1 bash -c \ | |
'printf "\n\e[1;34mHoovering table $1 in DB $0\e[0m\n\n"; | |
sudo -iu postgres psql $0 -c "VACUUM(FULL, ANALYZE, VERBOSE) ${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
#!/usr/bin/env python3 | |
import sys | |
import codecs | |
import os | |
from launchpadlib.launchpad import Launchpad | |
cachedir = "~/.launchpadlib/cache" | |
l = Launchpad.login_anonymously('anonymously', 'production', cachedir) | |
if sys.stdout.encoding is None: | |
sys.stdout = codecs.open("/dev/stdout", "w", 'utf-8') | |
for URL in [ ppa.web_link for ppa in l.people['maas'].ppas ]: |
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
#!/bin/bash | |
# This fixes an error happening on impish with fontconfig parsing various font .conf files | |
# Example when launching chromium (snap version) | |
# | |
# $ chromium http://ubuntu.com | |
# | |
# Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 4: unknown element "its:rules" | |
# Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 5: unknown element "its:translateRule" | |
# ... <100+ more errors> ... |
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
'Source: https://www.robvanderwoude.com/sourcecode.php?src=timesyncweb_vbs | |
Option Explicit | |
Dim arrDateTime | |
Dim blnTest | |
Dim dtmDateTime, dtmNewDateTime | |
Dim intDateDiff, intOffset, intStatus, intThreshold, intTimeDiff | |
dim colItems, objHTTP, objItem, objRE, objWMIService | |
Dim strDateTime, strLocalDateTime, strMsg, strNewdateTime, strURL |
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
#!/bin/bash | |
# Github: https://github.com/debauchee/barrier | |
# Barrier is available in Ubuntu Repos (Universe) | |
# Other distros: https://github.com/debauchee/barrier#distro-specific-packages | |
# Change these variables as required per client | |
export BDISP=':1' | |
export BUSER='craigbender' |
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
lxd-show-images() { | |
declare -ag IMGS=($(lxc image list images: amd64 -cl --format csv|sed -r 's/ \(.*$//g;/cloud|desktop/d'|sort -uV)) | |
(printf '%s\n' ${IMGS[@]%%/*}|sort -uV)|xargs -rn1 -P0 bash -c 'printf "\n\e[1m${0}:\e[0m\n$(lxc image list images: $0 amd64 -cl --format csv|sed '"'"'s/ (.*)//g;s/^/ /g'"'"'|awk '"'"'!seen[$0]++'"'"')\n"' | |
};export -f lxd-show-images |
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
maas-backup-params() { | |
(maas ${MAAS_PROFILE:-admin} maas get-config --help|awk -F: '/^:/&&!/^$|param|type/{print $2}')|\ | |
xargs -rn1 -P1 bash -c 'printf "maas \${MAAS_PROFILE:-admin} maas set-config name=$0 value=$(maas 2>/dev/null ${MAAS_PROFILE:-admin} maas get-config name=$0)\n"|sed -r "s/(^.*null$)/#\1/"' | |
};export -f maas-backup-params |
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
curl -sSLl https://www.iana.org/assignments/dns-parameters/dns-parameters-4.csv|\ | |
awk -F',' 'NR>1{if (NF==6 && !/OBS|EXP|^Una|^Pri|^Res/) print $1"|"$2"|"$3}'|\ | |
sort -uV|\ | |
column -ets"|" |
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
yaml-flip-indent() { | |
yaml-flip-indent_usage() { | |
printf "\n\e[2GUsage: ${FUNCNAME%%_*} [-f,--file <filename>] [-i,--in-place] \e[0m\n" 1>&2 | |
printf "\n\e[9Gecho \"\${MYYAMLVAR}\"|${FUNCNAME%%_*} \e[0m\n" 1>&2 | |
printf "\n\e[9Gcat /path/to/file.yaml|${FUNCNAME%%_*} \e[0m\n" 1>&2 | |
printf "\n\e[2GOptions:\n\n" | |
printf "\e[2G-i, --in-place\e[25GIf a filename is given, edit file in-place\n\n" | |
printf "\e[2G-f, --file\e[25GFile to change indent\n\n" | |
printf "\e[2G-h, --help\e[25GThis message\n\n" | |
printf "\n" |
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
maas-get-profile() { | |
sudo -iu postgres psql maasdb -Atc 'select username from auth_user where is_superuser = true and last_login is not null;' | |
};export -f maas-get-profile |