Though it is ever shifting sands, there seems to be a sort of semi-coalescing within the Azure/Power/Fabric space. It is useful for me to pretend so, at least. Here are a handful of Tips and Techniques that I have found indispensible. Sometimes I'm kind of surprised they aren't built-in. Mostly this was accumulated from a PowerAutomate-into-* point of view, but probably will expand over time.
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
//https://www.gog.com/u/Your.User.Name.Here/games?sort=recent_playtime | |
var myUsername = JSON.parse(localStorage['ngStorage-user']).username | |
window.navigation.navigate("https://www.gog.com/u/"+myUsername+"/games?sort=recent_playtime"); | |
//Let that load first, then... | |
//Paste into console: | |
function download(filename, text, type="text/plain") { | |
// Create an invisible A element | |
const a = document.createElement("a"); |
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
# lets say you are backing up to external media like a usb hardisk drive. once in a while, you should restore the backup to an alternate location and verify and validate the restorability and fidelity of the backup. | |
# Following a mass file restore from backup to alternate location, perform comparison with original to confirm the backup is good and restorable | |
#On test restore host: | |
# zpool create -f tank /dev/sdb | |
# zpool list | |
mount /dev/sdc1 /mnt/bup/ #where sdc1 is the device for the external usb hdd you just plugged in | |
ls /mnt/bup | |
ls /mnt/bup/originhostname/ | |
ls -lFh /mnt/bup/originhostname/originhostname.garage.zfs |
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
# just keep running count of seconds gone by, printing to console periodicially. | |
# Useful as rough "stopwatch" when you need to prove to your netadmin that your ssh sessions are getting disconnected regularly. | |
BEGIN=$(date "+%Y%m%d%H%M%S") ; while [ 1=1 ] ; do echo "$(( $(date '+%Y%m%d%H%M%S') - $BEGIN ))" ; sleep 300 ; done | |
# Quick and dirty terminal-based test of (HTTPS) SSL connectivity and get the cert expiry properties | |
echo | openssl s_client -showcerts -connect foohost.bardomain.tld:443 | openssl x509 -noout -dates | |
## Thought: what belongs in here versus .profile as an alias/function? | |
## Probably anything that you aren't going to call often enough to warrant spending neurons on memroizing even the alias/func name. | |
## in which case most of what follows should actually go elsewhere. |
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
#Kind of an automatic listing of the services created by the running docker containers | |
#Like Apache Fancy AutoIndex, but for docker services that have mapped all the way out to host port. | |
#todo: | |
# - expand well known services handling / alternative urls | |
# - loop to automatically refresh | |
# - error handling | |
# - pseudo clever service probing to see if we can figure out more about what is actually served up. | |
# If actually http, then maybe even traverse HTML for title tags and meta decription tags? | |
# - automatic publishing copy to /var/www/html if it exists? |
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
# To deploy this to a newly created user account's home: | |
cd $HOME | |
GIST_ID="665715ff3fcdbf4f5b25b32feb8e8410ed37cf47" | |
curl -Lo github_gist_home.zip https://gist.github.com/jrwarwick/1bc3527e3db7b1a8cb7e5fcf6e916f39/archive/${GIST_ID}.zip | |
unzip github_gist_home.zip | |
ls -laFh *-${GIST_ID}/ && mv *-${GIST_ID} nix_home_kit | |
echo "ok, now something like: cp -i nix_home_kit/.[a-z]* \$HOME/" |
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
# GNU Screen - main configuration file | |
# All other .screenrc files should source this file to inherit settings. | |
# Author: Christian Wills - [email protected], minor mods [email protected] | |
# Allow bold colors - necessary for some reason | |
attrcolor b ".I" | |
# Tell screen how to set colors. AB = background, AF=foreground | |
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' |
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
-- Simple Oracle SQL haversine distance. | |
-- Most likely you will want to put this into a CTE. | |
-- Not suitable for high-accuracy. Answer will be in km. | |
-- Still requires sdo for at least the degrees to radians conversion. | |
SELECT descript, ( /* Approx. Earth radius in km:*/ 6371 * acos( | |
cos(SDO_UTIL.CONVERT_UNIT(Lat1, 'Degree', 'Radian')) * | |
cos(SDO_UTIL.CONVERT_UNIT(Lat2, 'Degree', 'Radian')) * | |
cos(SDO_UTIL.CONVERT_UNIT(Lon2, 'Degree', 'Radian') - SDO_UTIL.CONVERT_UNIT(Lon1, 'Degree', 'Radian') ) | |
+ sin(SDO_UTIL.CONVERT_UNIT(Lat1, 'Degree', 'Radian')) * sin(SDO_UTIL.CONVERT_UNIT(Lat2, 'Degree', 'Radian')) | |
)) AS haversine_distance |
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
create or replace function get_build_option_id( | |
p_build_option_name IN varchar2, | |
p_PRIMARY_APPLICATION_ID IN number := 10000 | |
) return number | |
IS | |
l_build_option_id number; | |
BEGIN | |
select build_option_id into l_build_option_id | |
from APEX_APPLICATION_BUILD_OPTIONS |
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/bash | |
#https://askubuntu.com/a/686944/234023 | |
if [ -z "$XDG_RUNTIME_DIR" ]; then | |
XDG_RUNTIME_DIR=/run/user/$(id -u) | |
if [ -d "$XDG_RUNTIME_DIR" ] && [ -w "$XDG_RUNTIME_DIR" ]; then | |
export XDG_RUNTIME_DIR | |
else | |
unset XDG_RUNTIME_DIR | |
fi | |
fi |
NewerOlder