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 / keywords.sh
Created March 25, 2012 02:33
keywords.sh : extract keywords from text. Useful with freqy.sh for summarization.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-03-13
#
# _______________| keywords : extract keywords from text.
#
# Usage: keywords [file, -x, -] [postproduction]
# # clipboard^ ^stdin (default)
#
# Example: % keywords foo.txt cat
# # or try something like...
@rsvp
rsvp / soundcloud-mp3.js
Created March 9, 2012 02:54 — forked from pheuter/sc-dl.js
SoundCloud bookmarklet that generates link to download MP3
/**
2012-03-26 Forked from duncanbeevers' sc-dl.js : https://gist.github.com/2157987
**/
(function(document) {
var link = document.createElement("a"),
span = document.createElement("span"),
slug = document.querySelector("#main-content-inner img[class=waveform]").src.match(/\.com\/(.+)\_/)[1],
mp3 = document.querySelector("em").innerText + ".mp3";
@rsvp
rsvp / freqy.sh
Created February 18, 2012 15:43
freqy.sh : sort lines by their frequency count -- a very useful idiom as Linux bash script.
#!/usr/bin/env bash
# bash 3.2.25(1) Ubuntu 7.10 Date : 2012-02-15
#
# _______________| freqy : sort and order lines by frequency of appearance.
#
# Usage: freqy [optional: file(s)]
#
# Notes: Will work in a pipe.
# Does not alter the file(s) themselves.
#
@rsvp
rsvp / digy.sh
Created February 14, 2012 06:26
digy.sh : tame DNS utility dig with reasonable options. Linux bash HOWTO use dig script, get WAN public IP address, check local network status, and contact who is behind sites.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-02-17
#
# _______________| digy : tame DNS utility dig with reasonable options.
#
# Usage: digy [address] [rev|name|short|mail|all|long|longa|who]
#
# Examples: % digy friendfeed.com
# 69.63.180.52
# # default second argument is 'short'
@rsvp
rsvp / lstest.sh
Created February 8, 2012 03:41
lstest.sh : list files by type (regular, directory, symbolic link, named pipe, etc.), and optionally show detailed information unavailable via the ls command (while also properly handling dot files). Linux bash script.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-02-04
#
# _______________| lstest : list files by type, optionally show further info.
#
# Usage: lstest [test flag] [-0|-1|-A|-i|-I|-a] [--count]
#
# ^attributes
# ^terse "stat"
# ^info via "stat"
@rsvp
rsvp / country.sh
Created January 22, 2012 01:42
country.sh : look-up country name, its ISO code or foreign exchange currency symbol. Necessary data is contained within this Linux bash script, so it's very fast.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2012-01-15
#
# _______________| country : look-up country ISO code or currency symbol.
#
# Usage: country [term] ["iso"|"fx"]
# where "fx" is foreign exchange,
# "iso" is the default option,
# term is case-insensitive regular expression.
#
@rsvp
rsvp / prepend.sh
Created December 14, 2011 16:12
prepend.sh : insert text above given line number (the first by default) or pattern. Bash script.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-12-14
#
# _______________| prepend : insert text above given line number or pattern.
#
# Usage: prepend ["text"] [filename=stdin] [linenum=1 OR pattern]
#
# Example: prepend "TEST1\nTEST2" foo 3
# # insert two test lines above the third line in file foo.
# sort foo | prepend "Sorted result:"
@rsvp
rsvp / flippar.sh
Created December 10, 2011 04:17
flippar.sh : reverse the order of paragraph blocks where such blocks are delimited by two or more newlines.
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-12-10
#
# _______________| flippar : reverse order of paragraph blocks
# (delimited by two or more newlines;
# last block is exempt from this rule).
#
# Usage: flippar [filename (pipe acceptable)]
#
# Dependencies: tac (from package 'coreutils' in main)
@rsvp
rsvp / netspeed.sh
Last active May 13, 2020 15:08
netspeed.sh : check download speed rate via command line | Linux bash script
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2013-07-11
#
# _______________| netspeed : check download speed via command line.
#
# Usage: netspeed [tokyo, london, usw, use, east, west, URL]
# ^default U.S. west coast.
# [ -speed_KB/sec ]
# ^negation activates the Mbps converter.
#
@rsvp
rsvp / noise.sh
Last active April 18, 2024 14:18
noise : relaxing ambient Brown noise generator (cf. white noise) | Linux bash script using sox | CogSci notes
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2019-01-02
#
# _______________| noise : ambient Brown noise generator (cf. white noise).
#
# Usage: noise [minutes=59] [band-pass freq center=1786] [wave]
# ^minutes can be any positive integer.
# Command "noise 1" will display peak-level meter.
#
# Dependencies: play (from sox package)