Skip to content

Instantly share code, notes, and snippets.

View asssaf's full-sized avatar

Assaf Berg asssaf

View GitHub Profile
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.103 15].[11.134 57]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.104 15].[11.134 57]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.105 15].[11.134 57]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.107 15].[11.134 57]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.109 15].[11.134 57]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.109 29].[11.109 44]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.174 3].[11.179 13]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.176 3].[11.179 13]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.177 3].[11.179 13]>
/~zod/home/~2017.6.14..18.23.05..c35f/arvo/hoon:<[11.178 5].[11.178 47]>
:: Uptime monitor
!:
|%
++ move {bone card}
++ card
$% {$wait wire @da}
{$poke wire [* term] * action}
==
++ action
$% {$state $~}
@asssaf
asssaf / _etc_fstab
Created February 23, 2017 19:26
zram swap through udev
/dev/zram0 none swap defaults 0 0
/dev/zram1 none swap defaults 0 0
@asssaf
asssaf / apple-sysrq
Created February 22, 2017 21:59
setup magic sysrq on macbookpro5,5 using the eject button
#!/usr/bin/env bash
# enable all sysrq functions
echo 1 > /proc/sys/kernel/sysrq
# map eject key to SysRq
echo "786616 99" | keyfuzz -s -d /dev/input/by-id/usb-Apple_Inc._Apple_Internal_Keyboard___Trackpad-event-kbd
@asssaf
asssaf / javaexec.md
Last active January 22, 2017 22:22
Bash script for executing java one liners

It saves you from writing the boiler plate class file, compiling and executing it yourself (and is lighterweight than installing groovy/bsh).

Examples:

$  echo 'System.out.println("hello");' | ~/bin/javaexec 
hello

$ echo 'String.format("%02d", 5)' | ~/bin/javaexec -p
05
@asssaf
asssaf / ffsplit.sh
Created November 28, 2016 19:21
a quick-and-dirty media splitter shell script using FFmpeg
#!/bin/bash
# **ffsplit** is a quick-and-dirty media splitter using FFmpeg
# It takes an input media file, extracts the audio and splits it to constant-length segments
# enable exit on error
set -e
#/ Usage: ffsplit <input>
#/
#/ <input> media file to split
@asssaf
asssaf / usage.sh
Created November 10, 2016 21:06
bash: self grepping usage
#!/bin/bash
# (from shocco.sh):
# There's a lot of different ways to do usage messages in shell scripts.
# This is my favorite: you write the usage message in a comment --
# typically right after the shebang line -- *BUT*, use a special comment prefix
# like `#/` so that its easy to pull these lines out.
#/ Usage foobar [option]
#/

Keybase proof

I hereby claim:

  • I am asssaf on github.
  • I am aberg (https://keybase.io/aberg) on keybase.
  • I have a public key whose fingerprint is 6A4B 9BB7 74F8 0A11 AAB5 EAF1 FE57 7FBC 6DC2 82EE

To claim this, I am signing this object: