A collection of markdown files that were ripped from https://masterwiki.how/.
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/code/bin/code-server --auth none --port 8080 |
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
random_password() | |
{ | |
LENGTH=32; if [[ -n "$1" ]]; then LENGTH=$1; fi | |
</dev/urandom tr -dc '0-9-a-z-A-Z@#()-=_+[]{},.' | head -c"$LENGTH"; echo "" | |
} | |
PASSWORD=$(random_password 20) |
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
$IGNORE_LIST = @('not-in-use') #List of keyvaults to ignore, i.e. 'audit-tracked-secrets','nothing-to-see-here' | |
Write-Output "Getting subscriptions..." | |
$SUBSCRIPTIONS = Get-AzSubscription | Where-Object {$_.State -eq "Enabled"} | |
ForEach($SUBSCRIPTION in $SUBSCRIPTIONS) | |
{ | |
Write-Output "✨ $($SUBSCRIPTION.Name) ($($SUBSCRIPTION.Id))" | |
Set-AzContext -Subscription $($SUBSCRIPTION.Id) | Out-Null |
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
function gmailAutoarchive() { | |
var holdDays = 8; | |
var maxDate = new Date(); | |
maxDate.setDate(maxDate.getDate()-holdDays); | |
var threads = GmailApp.getInboxThreads(0,500).filter(function(thread) { | |
// Return only old threads and without stars | |
return (thread.getLastMessageDate() < maxDate && thread.hasStarredMessages() == 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
#!/bin/bash | |
mkdir -p /tmp/plex/ > /dev/null 2>&1 | |
rm -rf /tmp/plex/* > /dev/null 2>&1 | |
token=$(cat /volume1/Plex/Library/Application\ Support/Plex\ Media\ Server/Preferences.xml | grep -oP 'PlexOnlineToken="\K[^"]+') | |
url=$(echo "https://plex.tv/api/downloads/5.json?channel=plexpass&X-Plex-Token=$token") | |
jq=$(curl -s ${url}) | |
newversion=$(echo $jq | jq -r .nas.Synology.version) | |
echo New Ver: $newversion | |
curversion=$(synopkg version "Plex Media Server") | |
echo Cur Ver: $curversion |
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 | |
if [[ -z "$SSH_CLIENT" ]]; then SSH_CLIENT="127.0.0.1"; fi | |
TEXT="A user successfully logged on to \`$USER@$HOSTNAME\` ($(hostname -I | awk '{print $1}')) from \`$(echo $SSH_CLIENT | awk '{print $1}')\`.<br/>Please review this activity." | |
MESSAGE=$( echo ${TEXT} | sed 's/"/\"/g' | sed "s/'/\'/g" ) | |
JSON="{\"title\": \"Unusual user login activity\", \"themeColor\": \"\", \"text\": \"${MESSAGE}\" }" | |
curl --silent -H "Content-Type: application/json" -d "${JSON}" "https://outlook.office.com/webhook/..." > /dev/null |
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
{ | |
"telemetry.telemetryLevel": "off", | |
"editor.guides.bracketPairs": true, | |
"go.toolsManagement.autoUpdate" : true, | |
"explorer.compactFolders" : false, | |
"todo-tree.general.tags" : [ | |
"BUG", | |
"HACK", | |
"FIXME", | |
"TODO", |
NewerOlder