Skip to content

Instantly share code, notes, and snippets.

@PitBeast
PitBeast / brctl_show.sh
Created May 13, 2020 07:21
brforward convertion
brctl_showmacs () {
cat /sys/class/net/$1/brforward > /tmp/brforward ;
printf "port no\tmac addr\t\tis local?\tageing timer\n" ;
hexdump -v -e '5/1 "%02x:" /1 "%02x" /1 " %x" /1 " %x" 1/4 " %i" 1/4 "\n"' /tmp/brforward | awk '{ islocal = $3 ? "yes" : "no" ; printf "%3i\t%s\t%s\t\t%8.2f\n",$2,$1,islocal,$4/100 } ' ;
}
@reegnz
reegnz / README.md
Last active April 23, 2024 18:36
Implementing a jq REPL with fzf

Implementing a jq REPL with fzf

Update: I created jq-zsh-plugin that does this.

One of my favourite tools of my trade is jq. It essentially enables you to process json streams with the same power that sed, awk and grep provide you with for editing line-based formats (csv, tsv, etc.).

Another one of my favourite tools is fzf.

@lyhourchhen
lyhourchhen / OSSU-CS.md
Created December 22, 2019 07:47
The gitst for display on Notion.so

Open Source Society University (OSSU)

Open Source Society University

Path to a free self-taught education in Computer Science!

Awesome

@brianmed
brianmed / async-ioloop.001
Last active January 28, 2020 10:16
Hopefully a fun read about asynchronous, non-blocking operations in Mojolicious with concurrent events via Mojo::IOLoop
use Mojo::Base -strict;
use Mojo::IOLoop;
use Mojo::IOLoop::Delay;
say("Starting");
Mojo::IOLoop::Delay->new->steps(
sub {
my $delay = shift;
@CMCDragonkai
CMCDragonkai / data_science_at_the_commandline.md
Last active March 10, 2024 21:52
CLI: Data Science at the Command Line

Data Science at the Command Line

On the Unix command line, the message boundary is orchestrated in this manner: Files -> Lines -> Tab Separated Fields. Note that the Tab can be replaced by other characters, but by default it's a Tab.

Almost every tool expects a file as a collection of messages (lines), and that each line may be further separated in fields using a delimiter. The moment you want to get out of this message boundary architecture, is when things get complicated, and you start needing multiline regex... etc.

It's unfortunate that we haven't made use of ASCII FS nor ASCII RS nor ASCII US. It would make ASCII delimited text easier to parse, as these characters are not ever going to be used in actual text. See: https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text

The focus of data science tools on the command line, are basically tools that encourage one-liners or support one-liner use case.