Skip to content

Instantly share code, notes, and snippets.

View kjk's full-sized avatar

Krzysztof Kowalczyk kjk

View GitHub Profile
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"bytes"
"fmt"
"io"
"log"
"os"
// :glot
// allow error
package main
func main() {
// :show start
ch := make(chan int)
close(ch)
ch <- 5 // panics
// :show end
// :glot
// allow error
package main
func main() {
// :show start
ch := make(chan string)
close(ch)
close(ch)
// :show end
// :glot
package main
import (
"fmt"
)
func main() {
// :show start
ch := make(chan int)
// :glot
package main
import (
"fmt"
)
func main() {
// :show start
ch := make(chan string)
// :glot
package main
import (
"fmt"
"time"
)
func main() {
// :show start
@kjk
kjk / check default program windows.txt
Created April 9, 2020 03:02
checking / setting default programs on windows (made with https://codeeval.dev)
Source code examples:
* https://grep.app/search?q=IApplicationAssociationRegistration&filter[lang][0]=C%2B%2B
* https://github.com/QupZilla/qupzilla/blob/master/src/lib/other/registerqappassociation.cpp
* https://github.com/mpc-hc/mpc-hc/blob/master/src/mpc-hc/FileAssoc.cpp
* https://github.com/syndicodefront/infekt/blob/master/src/win32/default_app_win7.cpp
* https://github.com/syndicodefront/infekt/blob/master/src/win32/default_app_win8.cpp
In gecko-dev source code:
* Telemetry.cpp
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"fmt"
"os/exec"
)
func checkExeExists(exe string) {
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"fmt"
"log"
"os"
"os/exec"
)
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"bytes"
"compress/bzip2"
"fmt"
"io"
"io/ioutil"