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
| ./single.ps1 bob paris | |
| ./private.ps1 steve newyork | |
| ./private.ps1 greg seattle | |
| ./private.ps1 emma newyork | |
| <# | |
| Will create | |
| a wireguard tunnel to paris using bob's credentials in the init [non-]namespace, | |
| a tunnel to seattle with the interface name "seattle" using greg's config under the namespace "greg", | |
| and two tunnels to newyork (interfaces both called 'newyork') using options from steve and emma (under namespaces of the same name respectively) |
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
| #top for networking | |
| sudo iftop -P -B | |
| #shows connexions going through listened port | |
| sudo tcptrack -i eno1 port 8080 | |
| #get process listening on port | |
| sudo netstat -tulpn | ag 8080 | |
| #top for disks |
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
| # |
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
| cd $env:LOCALAPPDATA | |
| ( | |
| 'Ubisoft*', | |
| 'Grip', | |
| 'Evil*', | |
| 'ride3', | |
| 'Squad*', | |
| 'Remnant', | |
| 'Mordhau', | |
| 'Dead*', |
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
| class RC { | |
| hidden $type = $NULL | |
| hidden $code = $NULL | |
| hidden $size = $NULL | |
| hidden RC($type) { | |
| $this.type = $type | |
| $this.size = $type::New(1)[0]::MaxValue + 1 | |
| } | |
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
| try { | |
| Switch ($args[0]) { | |
| #entrypoint | |
| $NULL { | |
| if (!(Start-Process ` | |
| -FilePath 'PsExec' ` | |
| -ArgumentList ( | |
| '-s', | |
| '-nobanner', | |
| '-accepteula', |
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
| //go to one of your lists, eg https://superuser.com/users/saves/241800 | |
| $('.s-block-link.js-unsave').click() | |
| //NO NEED TO USE THIS | |
| (async (links) => { | |
| const request = { | |
| body : 'fkey=' + localStorage['se:fkey'].replace(/,.*$/, ''), | |
| method : 'POST', |
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
| $from = $from | gi | |
| $to = ($to | gi).FullName | |
| $from ` | |
| | Get-ChildItem -File -Recurse ` | |
| | &{ | |
| Begin { | |
| $from = '^' + [Regex]::Escape($from.FullName) | |
| } | |
| Process { |
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
| while ((Get-CimInstance Win32_Battery).EstimatedChargeRemaining -gt 55) { sleep 60 } shutdown -s -t 0 |
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
| //leaves only the unique elements in two sorted arrays | |
| function diff(bob, steve) { | |
| for (let b = 0, s = 0; b < bob.length && s < steve.length; ++b, ++s) { | |
| if (bob[b] < steve[s]) | |
| --s; | |
| else if (bob[b] > steve[s]) | |
| --b; | |
| else { | |
| bob.splice(b--, 1); | |
| steve.splice(s--, 1); |