Skip to content

Instantly share code, notes, and snippets.

Ramiro Gómez yaph

Block or report user

Report or block yaph

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yaph
yaph / InstallSelenium.sh
Created Nov 1, 2016 — forked from tristandostaler/InstallSelenium.sh
How to install correctly python Selenium (tested on ubuntu gnome)
View InstallSelenium.sh
apt-get install ipython
apt-get install python-pip
pip install selenium
mkdir /root/bin
cd /root/bin
wget https://github.com/mozilla/geckodriver/releases/download/v0.9.0/geckodriver-v0.9.0-linux64.tar.gz
tar -xvzf geckodriver-v0.9.0-linux64.tar.gz
rm geckodriver-v0.9.0-linux64.tar.gz
chmod +x geckodriver
cp geckodriver wires
@yaph
yaph / update-python-envs.sh
Last active Aug 29, 2015
Update distribute and all Python virtualenvs in current directory
View update-python-envs.sh
sudo easy_install -U distribute
find . -type d -maxdepth 1 -exec virtualenv {} \;
@yaph
yaph / vat-reverse
Created Apr 10, 2014
Calculate initial amount from final amount for VAT calculation
View vat-reverse
no_vat = final_amount * 100 / 119
@yaph
yaph / ubuntu-printer-pains.sh
Created Apr 9, 2014
Trying to get a Brother DCP-135C to work on Ubuntu 13.10
View ubuntu-printer-pains.sh
sudo apt-get purge brother-lpr-drivers-extra
sudo apt-get autoremove
sudo dpkg -i dcp135clpr-1.0.1-1.i386.deb
sudo mkdir ls /var/spool/lpd
sudo dpkg -i dcp135ccupswrapper-1.0.1-1.i386.deb
@yaph
yaph / README.md
Last active Aug 29, 2015 — forked from mbostock/.block
Fork of mbostock's coastal counties map
View README.md

This map shows the graph distance of each county from the Pacific or Atlantic coast; it is a recreation of a map posted to /r/dataisbeautiful using TopoJSON. Coastal counties are dark blue, while counties nine or more counties away from the coast are light yellow. (I opted not to reuse the original’s cycling color scale.)

See also the underlying graph.

@yaph
yaph / arachni-basic-usage.sh
Created Jan 22, 2014
Basic arachni usage commands
View arachni-basic-usage.sh
# scan up to 1000 URLs
arachni --link-count=1000 --report=afr:outfile=domain.tld.html http://domain.tld
# convert existing afr report to html
arachni --repload=domain.tld.afr --report=html:outfile=domain.tld.html
@yaph
yaph / wikicsv.sh
Last active Dec 30, 2015
DBpedia/Wikipedia CSV manipulation
View wikicsv.sh
# DBpedia table
csvcut -c 2 Film.csv | sed -e 's/(.*)$//' > film-titles.txt
# wikitables CSV
csvcut -c 1 List_of_Academy_Award-winning_films.csv | sed -e 's/(.*)//' | sed -e 's/\"//g' > film-titles.txt
# fix names
sed -e 's/|.*}//g' -e 's/{//' -i datasets/populated-places-locations.csv
@yaph
yaph / ula2json.js
Created Oct 24, 2013
Convert an HTML ul list of links to a JSON list of objects with href and text content.
View ula2json.js
var list = [];
$('ul a').each(function(idx, item){
list.push({
href: $(item).attr('href'),
text: item.textContent
});
});
JSON.stringify(list, null, " ");
@yaph
yaph / grep-through-python.sh
Created Aug 27, 2013
More effective grepping through Python projects code
View grep-through-python.sh
grep --exclude=*.{pyo,pyc,txt} -r STRING
@yaph
yaph / monitor-server-connections.sh
Last active Dec 21, 2015
monitor server connections
View monitor-server-connections.sh
# count port 80 connections
netstat -alpen | grep -c :80
# watch connections, refresh every 5 seconds
sudo watch -n5 -d 'netstat -alpen | grep -c :'
You can’t perform that action at this time.