Skip to content

Instantly share code, notes, and snippets.

1kastner

Block or report user

Report or block 1kastner

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
View example_folium_archiving.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@1kastner
1kastner / README.md
Created Sep 19, 2018 — forked from obscurerichard/README.md
Simulates a low bandwidth, high-latency network connection
View README.md

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default
slow modem-56k -d eth0    # Simulate a 56k modem on the eth1 device. eth0 is unchanged.
View map matching with jupyter.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View linuxify
linuxify() {
windowspath=$1
temppath="$(echo $windowspath | sed -E 's/([A-Z]):/\/mnt\/\L\1/g')" # C: -> /mnt/c, E: -> /mnt/e
temppath="$(echo $temppath | sed 's/\\/\//g')" # backslash -> forward slash
linuxpath=$temppath
echo $linuxpath
}
@1kastner
1kastner / reflect.py
Last active Aug 28, 2019 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
View reflect.py
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from http.server import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@1kastner
1kastner / simulateur.py
Last active Apr 6, 2017 — forked from PhiBabin/simulateur.py
Flappy Bird Simulator
View simulateur.py
from __future__ import division
from six import print_
import pygame, sys, random
from pygame.locals import *
class sim:
# X origin
#DELTA = 0.1
View self_drawn_tif_remains_black.py
import random
import numpy as np
from matplotlib import pyplot as plt
import rasterio
def draw_map_1():
# simplified version of what I want to do
x_size_raster = 500
View draw_small_map_with_rasterio.py
import random
import numpy as np
import rasterio
def draw_map():
x_size_raster = 500
y_size_raster = 300
raster_map = np.ones((x_size_raster, y_size_raster), np.uint8) # be careful with numpy array types, not all are supported!
View mocking_and_caching_results_in_recursion.py
import requests
import requests_mock
import requests_cache
with requests_mock.mock() as mock:
mock.get("mock://test", text="test")
requests_cache.install_cache("test_cache", backend="memory")
requests.get("mock://test")
# -> RecursionError: maximum recursion depth exceeded
@1kastner
1kastner / fixing_script.py
Created Dec 27, 2015
In case you needed to abort the downloads because of an unstable connection
View fixing_script.py
import os
import os.path
import re
import shutil
DB_BASE = "/home/marvin/projectrepository/AudioFiles/voxforge"
for f in os.listdir("."):
match = re.match("(.*)\.tgz.[0-9]", f)
if match:
You can’t perform that action at this time.