As of 1.8, assets are stored by hash, which makes it fiddly to listen to Minecraft's amazing ambient soundtrack outside the game.
This script can be used to copy music files to appopriately-named and organised .ogg files for easier listening.
| ## $env:USERPROFILE\Documents\WindowsPowerShell\Microsoft.PowerShellISE_Profile.ps1 | |
| # Very low external dependencies edition | |
| $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Run with -Verbose',{ Invoke-Expression ` | |
| -Command ". '$($psISE.CurrentFile.FullPath)' -Verbose" }, ` | |
| 'Ctrl+F5') | Out-Null | |
| $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Run with -Debug', { Invoke-Expression ` | |
| -Command ". '$($psISE.CurrentFile.FullPath)' -Debug" }, ` | |
| 'Ctrl+F6') | Out-Null | |
| $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Launch Script Analyzer',{ Invoke-Expression ` |
| #Maybe you just finished executing a bunch of stuff in the ISE script window and want to save the entire output | |
| #maybe for a deployment log or something. Just drop this in scripting window, highlight, and execute selection. | |
| #Could use this as an sort of alternative to Start-Transcript, too, but only in ISE execution situation. | |
| $psise.CurrentPowerShellTab.ConsolePane.Text | Set-Content -Path $env:USERPROFILE\Downloads\ps_ise_execution_log_$((get-date).tostring("yyyyMMdd")).txt |
As of 1.8, assets are stored by hash, which makes it fiddly to listen to Minecraft's amazing ambient soundtrack outside the game.
This script can be used to copy music files to appopriately-named and organised .ogg files for easier listening.
| egrep -hv '^::1 - -|"-" 408 - "-" "-"$' /var/log/httpd/access_log* | sed -e 's#\(https\?://[a-zA-Z0-9.\-]\+\)/##' | awk -F'[ "]+' '{print $4,$5","$3","$1","$6","$7}' | sed 's/\?/,/' | sed -e 's/^\[/"/' -e 's/\],/",/' | sed 's/:/","/' | egrep -hv '.png$|.jpg$|.gif$|.css$|.js$|.ico$' | egrep -hv 'OPTIONS,/fv/$|OPTIONS,HTTP/1.1$' | sort -u > /tmp/httpd_access_log_$(date +%Y%m%d).csv |
| #!/usr/bin/env python | |
| # Based on the brilliant work of Jorge which I found here: | |
| # https://jorge.fbarr.net/2017/06/11/simplehttpserver-with-ssl/ | |
| # He truly honors KISS principles. I just needed a little more automagicalness | |
| # at the cost of a little more complexity and reduced portability. | |
| # Oriented around the python 2.7 and openssl 1.1.1 world that some UNIX boxen are living in. | |
| # Should handle even Chrome's more stringent Subject AltName requirements. | |
| # Extra handy if started in a GNU screen session thus: | |
| # screen -S httpsMiniServer /usr/local/httpsminiserver/httpsminiserver.py | |
| import os.path |
| -- Quick, dirty, and incomplete. Look to dgielis/model_to_quicksql.sql for more power | |
| select table_name||chr(10)||listagg(' '||column_name||' ' | |
| ||case data_type | |
| when 'VARCHAR2' then 'vc'||to_char(data_length) | |
| when 'NUMBER' then 'num' | |
| when 'INTEGER' then 'int' | |
| when 'DATE' then 'date' | |
| when 'INTEGER' then 'int' | |
| END,chr(10)) within group (order by column_id) quicksql | |
| from all_tab_cols |
| #!/bin/bash | |
| # rapidly rattle off a bunch of eerily familiar utterances | |
| # Credit to https://a3nm.net/blog/glados_espeak.html | |
| while read LINE </dev/tty ; do | |
| TITLE=$( echo $LINE | sed 's/[^a-zA-Z0-9 ]//g; s/ \+/_/g; s/_the_//g; s/_to_//g;' ) | |
| echo $LINE | for a in `cat`; do | |
| V=$(((($RANDOM) % 100) - 50)); echo -n "<prosody pitch=\"+$V\">$a</prosody> " | | |
| sed 's/+-/-/' ; | |
| done | espeak -ven+f3 -m --stdout -p 55 -s 150 | oggenc -q1 - > GLADOS_${TITLE}.ogg | |
| done |
| #!/bin/sh | |
| #Scenario: some issuer reissues to you a renewed certificate in DER/x509 format, | |
| #but you need it in PFX/PKCS12 format (perhaps to utilize in some Windows PowerShell scripts). | |
| #quick sequence to perform the conversion and sanity check. | |
| #To extract the private key embedded in the (soon to expire) PFX: | |
| openssl pkcs12 -in old_about_to_expire.pfx -nocerts -out extracted_private_key.pem | |
| #To sanity check the incoming renewed cert: | |
| openssl x509 -inform der -in renewed_certificate_as_issued.der -noout -text | grep -v '\([a-z0-9]\{2\}:\)\{10,\}' |
| $multiple = 2 | |
| $currentNumber = 1 | |
| while ($currentNumber -lt 562949953421310) { | |
| $currentNumber = $currentNumber * $multiple | |
| $currentNumber | |
| } | |
| $vox = New-Object -com SAPI.spvoice | |
| $vox.speak("Sorry, too late. I have already reached $($currentNumber). As you can see, computers really are amazingly, blazingly fast.") |
| #!PowerShell | |
| # Assumes print logging is turned on. This is usually the case on print servers, | |
| # yet usually not the case on desktop workstations. | |
| $searchstring = Read-Host -Prompt 'Target username' | |
| $WinEventXMLFilter = ' | |
| <QueryList><Query Id="0" Path="Microsoft-Windows-PrintService/Operational"> | |
| <Select Path="Microsoft-Windows-PrintService/Operational">*[System[(Level=4 or Level=0) and (EventID=307)]]</Select> | |
| </Query></QueryList>' | |
| $PrintEvents = Get-WinEvent -FilterXml $WinEventXMLFilter -Computer $(Read-Host -prompt 'Print Server computername') |