Skip to content

Instantly share code, notes, and snippets.

View rsvp's full-sized avatar
🎧
say hi ! https://gitter.im/rsvp/pub

Adriano rsvp

🎧
say hi ! https://gitter.im/rsvp/pub
View GitHub Profile
@rsvp
rsvp / telamerica.sh
Created August 16, 2012 15:50
telamerica.sh : look-up North American region / area code within +1 | Linux bash self-contained database
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-08-11
#
# _______________| telamerica : look-up North American region / area code.
#
# Usage: telamerica [term]
# ^area code (three digits work best),
# or case-sensitive partial regional name.
#
# Examples: % telamerica Mexico
@rsvp
rsvp / telcountry.sh
Created August 16, 2012 15:47
telcountry.sh : look-up country / telephone code. | Linux bash self-contained database
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-08-11
#
# _______________| telcountry : look-up country / telephone code.
#
# Usage: telcountry [term]
# ^telephone code,
# or case-sensitive partial country name.
#
# Examples: % telcountry United
@rsvp
rsvp / tagscrape.sh
Created July 12, 2012 05:12
tagscrape.sh : scrape content between given html tag. | Linux bash script.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-07-11
#
# _______________| tagscrape : echo content(s) between html tag pair.
#
# Usage: tagscrape [tag] [file/URL]
# # Output will exclude the tag themselves.
# # Default for file is stdin, so pipe will work.
#
# Examples: % tagscrape pre foo.html
@rsvp
rsvp / jason.sh
Created June 17, 2012 03:26
jason.sh : pretty print json for key-value processing line-by-line. The goal is a readable and grepable output.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-06-16
#
# _______________| jason : pretty print json for key-value processing by line.
#
# Usage: jason [file] [ident=5] [delim='__:']
#
# Examples: % jason foo.json 0 ': '
# # ^typical json key-value separator.
# # ^ident of 0 for just newline.
@rsvp
rsvp / sto.sh
Created April 23, 2012 00:28
sto.sh : interim temporary storage with tee, pager, format, diff. Fast quintessential command-line management between three storage units. Linux bash script.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-04-10
#
# _______________| sto : interim tmp storage with tee, pager, format, diff.
# There are THREE storage units.
#
# Usage: sto [ input: i, j, k output: oi, oj, ok diff: d??
# append: I, J, K xclip: x, y, z shift: s
# format: f, g, h addclip: X, Y, Z accumulate: a
# copy: ci, cj, ck [new prefix] cat: c
@rsvp
rsvp / linecol.sh
Created April 1, 2012 23:49
lincol.sh : convert regex delimited lines into single column. E.g. linecol foo.csv ', *' #-- so each item on a CSV line will be on its own line.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-04-06
#
# _______________| linecol : convert regex delimited lines into single column.
#
# Usage: linecol [filename] [delimiter regex]
#
# Examples: % linecol foo.csv ', *'
# # ^use single quotes for regex.
# # Each item on a CSV line will be on its own line.
@rsvp
rsvp / locat.sh
Created March 25, 2012 19:48
locat.sh : locate files much more quickly and precisely than find -- with glob and colored extended regex.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-03-20
#
# _______________| locat : find files with glob and colored extended regex.
#
# Usage: locat [extended regex] [glob pattern]
#
# Examples: % locat pdf$
# # pdf files stemmed under present working directory,
# # ^so seemingly recursive.
@rsvp
rsvp / argin.sh
Created March 25, 2012 03:14
argin.sh : universal xargs properly handled from ANY standard input. Plus parallelization is activated by default. (No more hassles with the null character :-) argin.sh converts lines from stdin into arguments to build and execute a command individually.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-03-22
#
# _______________| argin : xargs properly handled from ANY standard input.
# xargs converts stdin into arguments in order
# to build and execute a command individually.
#
# Usage: argin [options] command [{} as placeholder if necessary]
#
# Examples: % argin -t echo {} < foo.txt 2> argin-done.txt
@rsvp
rsvp / quotel.sh
Created March 25, 2012 02:58
quotel.sh : quote lines using prefix and suffix strings. By default, those are double quotes.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-03-23
#
# _______________| quotel : quote lines using prefix and suffix strings.
#
# Usage: quotel [filename] [prefix string] [suffix string]
# # stdin and double quotes are defaults.
# # Use '~' to represent an empty string.
#
# Dependencies: sed
@rsvp
rsvp / colline.sh
Created March 25, 2012 02:45
colline.sh : convert column to line with optional delimiter string.
#!/usr/bin/env bash
# bash 3.2.25(1) Ubuntu 7.10 Date : 2012-03-25
#
# _______________| colline : convert column to line with optional delimiter.
#
# Usage: colline [file] [delimiter]
# ^space as default; string is acceptable.
# ^assuming each line represents one column.
#
# Dependencies: awk, sed