Skip to content

Instantly share code, notes, and snippets.

View iomonad's full-sized avatar
🍋
λ

iomonad iomonad

🍋
λ
  • Lutetia Parisiorum
View GitHub Profile
@iomonad
iomonad / irc.md
Created February 19, 2018 21:03 — forked from xero/irc.md
irc cheat sheet

#IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

##The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
@iomonad
iomonad / factorial-recursive.lisp
Created March 3, 2018 15:18 — forked from manishym/factorial-recursive.lisp
Factorial in lisp recursive process
(defun fact(n)
(if (<= n 1)
1
(* n (fact (- n 1)))))
SICP3> (fact 10)
0: (FACT 10)
1: (FACT 9)
2: (FACT 8)
3: (FACT 7)
4: (FACT 6)
/** Emulate `cmd1 | cmd2 | more` pipeline using recursion.
http://stackoverflow.com/questions/20434124/recursive-piping-in-unix-environment
*/
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@iomonad
iomonad / awk_netstat.sh
Created March 22, 2018 11:52 — forked from staaldraad/awk_netstat.sh
AWK to get details from /proc/net/tcp and /proc/net/udp when netstat and lsof are not available
# Gawk version
# Remote
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}'
# Local
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}'
# No Gawk
# Local
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){
@iomonad
iomonad / introrx.md
Created March 25, 2018 08:22 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@iomonad
iomonad / syntax.s
Created May 15, 2018 07:30 — forked from mishurov/syntax.s
AT&T assembly syntax and IA-32 instructions
# --------
# Hardware
# --------
# Opcode - operational code
# Assebly mnemonic - abbreviation for an operation
# Instruction Code Format (IA-32)
# - Optional instruction prefix
# - Operational code
@iomonad
iomonad / bonsai
Created May 22, 2018 12:18 — forked from angusjf/bonsai
prints a color text image of a bonsai tree. not mine but i can't remember where i found it
#!/bin/bash
#prints a color text image of a bonsai tree
echo -e " &&"
echo -e " &&&&&"
echo -e " &&&\/& &&&"
echo -e " &&|,/ |/& &&"
echo -e " &&/ / /_& &&"
echo -e " \ { |_____/_&"
echo -e " { / / &&&"
echo -e " .\`. \\{___\________\/_\}"
@iomonad
iomonad / make.conf
Created May 25, 2018 08:07 — forked from moschlar/make.conf
Run Gentoo Portage in a cpu cgroup
PORTAGE_IONICE_COMMAND="/usr/local/sbin/portage-cgroup \${PID}"
@iomonad
iomonad / bash-colors.md
Created May 30, 2018 13:37 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@iomonad
iomonad / ascii.cheatsheet
Created May 31, 2018 14:46 — forked from xero/ascii.cheatsheet
box drawing cheat sheet for ascii art
╓─────[ box drawing cheat sheet ]
╙────────────────────────────────────── ─ ─
─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ┌ ┍ ┎ ┏
┐ ┑ ┒ ┓ └ ┕ ┖ ┗ ┘ ┙ ┚ ┛ ├ ┝ ┞ ┟
┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫ ┬ ┭ ┮ ┯