I hereby claim:
- I am himura2la on github.
- I am himura (https://keybase.io/himura) on keybase.
- I have a public key ASD5ZI3tpOcl-caQlSaudadLWq9To5Jdt6sAov_wJ7wrBAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| # ... | |
| def wake_pc(value): | |
| if value: | |
| return wol.wake() | |
| def ping_pc(value): | |
| return wol.ping() | |
| def main(): |
| @if "%~1" == "" ( | |
| @echo Drop a *.ps1 file onto this script. | |
| ) else ( | |
| @echo --- launching %~1 --- | |
| @powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~1'; echo ""--- %~1 returned $LastExitCode ---""" | |
| ) | |
| @pause |
| Copy-Item -FromSession (New-PSSession remote-server-hostname) -Path "C:\DataDir" -Destination "D:\Backpus\DataDir" -Recurse |
| docker run --rm \ | |
| -v volume-name:/data \ | |
| -v ~/backups:/bkp \ | |
| alpine \ | |
| tar cf /bkp/volume-bkp.tar /data |
| public static string StringRunner(string s) { | |
| var output = new StringBuilder(); | |
| for(int i = 0; i < s.Length; i++) { | |
| char prevCh = i > 0 ? s[i - 1] : '\0'; | |
| char thisCh = s[i]; | |
| char nextCh = i < s.Length - 1 ? s[i + 1] : '\0'; | |
| switch(thisCh) { | |
| // Do the replacements | |
| default: | |
| output.Append(thisCh); |
| Get-AppxPackage | Select PackageFamilyName, InstallLocation | |
| # Run command: shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App |
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Text.RegularExpressions; | |
| namespace LowLevelReplace { | |
| class Program { | |
| static readonly Regex template = new Regex(@"({(.*?)})", RegexOptions.Compiled); | |
| static readonly Dictionary<string, string> values = new Dictionary<string, string>() { | |
| { "meow", "nya" }, |
| qwinsta /server:ServerName |
| sudo apt-get update | |
| sudo apt-get install -y wget gnupg apt-transport-https lsb-release | |
| wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - | |
| echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-$(. /etc/os-release && echo $ID)-$(lsb_release -sc)-prod $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/microsoft.list | |
| sudo apt-get update | |
| sudo apt-get install -y powershell |