This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cartopy.feature import NaturalEarthFeature | |
import cartopy.crs as ccrs | |
plt.figure(figsize=(6, 6)) | |
ax = plt.axes(projection=ccrs.EuroPP(), zorder=1) | |
land = NaturalEarthFeature( | |
category="cultural", | |
name="admin_0_countries", | |
scale="10m", | |
facecolor="none", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -m cProfile -o profile.pstats script.py | |
gprof2dot -f pstats profile.pstats | dot -Tsvg -o profile.svg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ubuntu network manager permission problem | |
-------------------------------------------- | |
edit: /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla | |
and change: | |
[Adding or changing system-wide NetworkManager connections] | |
Identity=unix-group:admin;unix-group:sudo | |
Action=org.freedesktop.NetworkManager.settings.mod ify.system |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libgeos-3.X.X | |
sudo apt-get install libgeos-dev | |
pip install --user https://github.com/matplotlib/basemap/archive/master.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
import time | |
#------------------------------------------------- | |
# conversions to strings | |
#------------------------------------------------- | |
# datetime object to string | |
dt_obj = datetime(2008, 11, 10, 17, 53, 59) | |
date_str = dt_obj.strftime("%Y-%m-%d %H:%M:%S") | |
print date_str |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/25191620/ | |
# creating-lowpass-filter-in-scipy-understanding-methods-and-units | |
import numpy as np | |
from scipy.signal import butter, lfilter, freqz | |
from matplotlib import pyplot as plt | |
def butter_lowpass(cutoff, fs, order=5): | |
nyq = 0.5 * fs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a set of useful scripts for mongodb | |
- batch deleting collections | |
- extract subset using fast aggregation method | |
- export query to csv (quick and dirty) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh | |
set -e | |
# Must be a valid filename | |
NAME=foo | |
PIDFILE=/var/run/$NAME.pid | |
#This is the command to be run, give the full pathname | |
DAEMON=/usr/local/bin/bar |