View pgsqlvacuumstat.sh
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 | |
PGSQL_HOST="localhost" | |
PGSQL_PORT="5432" | |
PGSQL_DATABASE="postgres" | |
PGSQL_USERNAME="postgres" | |
export PGPASSWORD="passwd" | |
TMP_FILE="/tmp/pgsqlchk.out" | |
ERR_FILE="/tmp/pgsqlchk.err" | |
HOST=$(hostname) |
View pg_recovery_progress.sh
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
ls -l $(sudo lsof -p $(ps aux | grep postgres | grep startup | awk '{print $2}') | grep wal | awk '{print $9}') | awk '{print $6" "$7" "$8}' |
View slackpost.sh
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 | |
## Defaults | |
SLACK_TOKEN="YOUR TOKEN" | |
CHANNEL="YOUR CHANNEL" | |
IN="" | |
MESS="" | |
while getopts c:m: flag | |
do |
View get_blocking_queries.sh
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 | |
PGSQL_HOST="localhost" | |
PGSQL_PORT="5432" | |
PGSQL_DATABASE="postgres" | |
PGSQL_USERNAME="postgres" | |
export PGPASSWORD="passwd" | |
xmins=() | |
queries="" |
View nb_get.py
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 requests | |
import json | |
s = requests.Session() | |
resp = s.get('{notebook URL}/login', verify = False) | |
xsrf_cookie = resp.cookies['_xsrf'] | |
params = {'_xsrf':xsrf_cookie,'password': '{notebook password}'} | |
l = s.post('{notebook URL}/login?next=/api/sessions', data=params, verify = False, allow_redirects=True).json() |
View psqlactiveq.sh
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 | |
PGSQL_HOST="localhost" | |
PGSQL_PORT="5432" | |
PGSQL_DATABASE="postgres" | |
PGSQL_USERNAME="postgres" | |
export PGPASSWORD="passwd" | |
THISHOST=`hostname` | |
INFLUXLINES="" |
View UT2004SetupPublicDLs.sh
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
compress_ut_file() { | |
f=$(basename $1) | |
if [ ! -d "$file" -a ! -f "/var/www/ut2004/${f}.uz2" ] && [ "$file" != "*" ]; then | |
./ucc-bin compress -nohomedir $1 | |
mv "${1}.uz2" /var/www/ut2004/ | |
fi | |
} | |
export -f compress_ut_file |
View generate-map.js
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
// node .\tools\generate-map.js --bigfile .\src\fullmap.jpg --endpath .\public\grid\ --zoom 7 | |
const fs = require('fs'); | |
const sharp = require('sharp'); | |
const argv = require('yargs').argv; | |
const _cliProgress = require('cli-progress'); | |
const endPresentFile = argv.bigfile; | |
const gridPath = argv.endpath; | |
const bar1 = new _cliProgress.SingleBar({}, _cliProgress.Presets.shades_classic); |
View backlight.sh
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 | |
# You can call this script like this: | |
# $./backlight.sh up | |
# $./backlight.sh down | |
function get_brightness { | |
cat /sys/class/backlight/intel_backlight/brightness; | |
} |
View volume.sh
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 | |
# You can call this script like this: | |
# $./volume.sh up | |
# $./volume.sh down | |
# $./volume.sh mute | |
function get_volume { | |
amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1 | |
} |