Skip to content

Instantly share code, notes, and snippets.

@ihor-nahuliak
ihor-nahuliak / import_meso.py
Created October 1, 2018 03:12 — forked from stepps00/import_meso.py
Import script to add mesoshapes to WOF
#!/usr/bin/env python
# run original SHP file thru MapShaper to add label position (mps_y, mps_x) columns
#
# first add label position via mapshaper:
# mapshaper input.shp encoding=utf8 -each 'mps_x=$.innerX, mps_y=$.innerY' -o import_via_mapshaper.shp
# full example:
# mapshaper /usr/local/mapzen/countries/Chile/Admin_2/Chile_admin2.shp encoding=utf8 -each 'mps_x=$.innerX, mps_y=$.innerY' -o chile_adm2_via_mapshaper.shp
#
# now convert that SHP to GeoJSON format, which is easier to load into Python
@ihor-nahuliak
ihor-nahuliak / tfidf.py
Created September 29, 2018 19:32 — forked from sloria/tfidf.py
import math
from text.blob import TextBlob as tb
def tf(word, blob):
return blob.words.count(word) / len(blob.words)
def n_containing(word, bloblist):
return sum(1 for blob in bloblist if word in blob)
def idf(word, bloblist):
@ihor-nahuliak
ihor-nahuliak / README.md
Created April 24, 2018 13:19 — forked from Arignir/README.md
HoleyBeep exploit

HoleyBeep

This is an exploit for HoleyBeep.

To use it, place any command you want root to execute in /tmp/x.

$ cat /tmp/x
echo PWNED $(whoami)