This file contains 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
abcdefghijklmnopqrstuvwxyz |
This file contains 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
NOTE(as): I found this at the url below, this is a mirror | |
URL: https://android.googlesource.com/platform/external/ffmpeg/+/refs/heads/upstream-release-3.2/doc/filters.texi | |
@chapter Filtering Introduction | |
@c man begin FILTERING INTRODUCTION | |
Filtering in FFmpeg is enabled through the libavfilter library. | |
In libavfilter, a filter can have multiple inputs and multiple |
This file contains 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 github gist was recently shared with me: https://gist.github.com/KoryNunn/7d94d7e630881f99e02626b527e6fe15 | |
It contains instructions for redeeming a crypto airdrop for github user who in 2019 had | |
(1) Around 15+ followers on github | |
(2) A public key added to their github | |
It is currently valued at around $2000 USD, and can be sold on a crypto exchange, converted into crypto-currency, etc. | |
The instructions and airdrop are legitimate, but I have problems trusting third-party code with my private key. |
This file contains 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
func ffmpeg(in io.Reader) (out io.ReadCloser) { | |
// the command overwrites the output file that "already exists" | |
// actually, the output file is a reference to ffmpegs own file descriptor #3 | |
c := exec.Command("ffmpeg", "-y", "-i", "-", "-c", "copy", "-f", "mp4", "/proc/self/fd/3") | |
// standard input, buffered by us | |
c.Stdin = bufio.NewReader(in) | |
// create a memory backed temporary file using the MemfdCreate syscall | |
// the file is managed by the kernel and doesn't need to be deleted |
This file contains 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
// install the signal handler | |
sigs, sigdone := make(chan os.Signal, 2), make(chan bool) | |
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) | |
go func() { | |
<-sigs | |
close(sigdone) | |
}() | |
// install the workers | |
teardown := make(chan bool) |
This file contains 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
// NOTE(as): This is like an unordered Rabin-Karp search. We | |
// use a simple addition without carry (XOR) to (un)mix the | |
// probabilistic filter for a substring match. | |
package main | |
import ( | |
"fmt" | |
"strings" | |
) |
This file contains 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
package main | |
import "fmt" | |
func main() { | |
fmt.Println(cmp("abc", " a db c ")) | |
} | |
func cmp(a, b string) bool { | |
if len(a) < len(b) { |
This file contains 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
#!/bin/sh | |
wpa_supplicant -i wlan0 -D wext -c <(wpa_passphrase $ssid $password) 2>&1 >/var/log/wpa.log | |
dhclient || dhcpcd |
This file contains 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
# as 2019.09.06 | |
# generate a list of iptables commands to block | |
# all ip addresses assigned to facebook via the | |
# organization's autonomous system number. | |
whois -h whois.radb.net '!gAS32934' | egrep / | tr ' ' '\n' | awk '{ printf "iptables -I OUTPUT -d %s -j REJECT\n",$1 }' |
This file contains 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
// TODO(as): find a production foss program where this issue exists | |
// | |
// This trivial program generates integers and prints them to | |
// standard output until it reaches 1000 or the context is done. | |
// | |
// It contains a fix for a difficult-to-find bug caused in many | |
// Go programs written by authors at all experience levels. | |
package main | |
import ( |
NewerOlder