Skip to content

Instantly share code, notes, and snippets.

@auselen
auselen / http_response_codes.json
Created January 21, 2016 12:17
simple http response codes dictionary / json - scrapped from https://github.com/for-GET/know-your-http-well
{"1xx":"**Informational**",
"100":"Continue",
"101":"Switching Protocols",
"2xx":"**Successful**",
"200":"OK",
"201":"Created",
"202":"Accepted",
"203":"Non-Authoritative Information",
"204":"No Content",
"205":"Reset Content",
@auselen
auselen / ftpput.py
Created December 13, 2015 23:03
Simple ftp upload client using ftplib
import os
import sys
from ftplib import FTP
# python ftpput.py [server] [dir_on_server] [local_dir]
ftp = FTP(sys.argv[1])
ftp.login()
ftp.cwd(sys.argv[2])
map_osm = folium.Map(location=[45.5236, -122.6750], zoom_start=12)
map_osm
@auselen
auselen / dailymotion.sh
Last active November 11, 2015 20:45
Download dailymotion videos from one user
#!/bin/sh
videos=`curl -s "https://api.dailymotion.com/user/$1/videos?limit=100" | jq '.list|.[]|.id'`
for id in $videos;
do
id=${id#\"}
id=${id%\"}
url=`curl -s "https://api.dailymotion.com/video/$id?fields=url"|jq .url`
youtube-dl -f 1080 $url
done
@auselen
auselen / canlitvlive.sh
Created September 1, 2015 00:51
canlitvlive to kodi
#!/bin/sh
link=`curl -s "http://www.canlitvlive.org/izle/$1.html" |sed -n 's/.*file:"\(.*\)"}]}]\(.*\)/\1/p'`
livestreamer --player-external-http --player-external-http-port 8087 "hls://$link" worst
@auselen
auselen / watchfaces.sh
Created August 25, 2015 08:37
smartwatch2 polar clock face generator
#!/bin/sh
#create rings
echo creating hours ring
for i in $( seq 6 6 360 ); do convert -size 220x176 -depth 16 xc:transparent -fill none -stroke DarkOrange3 -draw "stroke-width 16 ellipse 110,88 74,74 270,$((270 + i))" polar_hours_$i.png; done
echo creating minutes ring
for i in $( seq 6 6 360 ); do convert -size 220x176 -depth 16 xc:transparent -fill none -stroke DarkOrange4 -draw "stroke-width 16 ellipse 110,88 58,58 270,$((270 + i))" polar_minutes_$i.png; done
echo creating seconds ring
for i in $( seq 6 6 360 ); do convert -size 220x176 -depth 16 xc:transparent -fill none -stroke peru -draw "stroke-width 16 ellipse 110,88 42,42 270,$((270 + i))" polar_seconds_$i.png; done
@auselen
auselen / blocket.py
Last active August 17, 2021 11:31
scrap from blocket.se
from requests import get
from lxml import html
from operator import itemgetter
citycodes = {'skane' : '23', 'lund': '23_10', 'eslov' : '23_2'}
result = []
def list(city, keyword, limit):
url = 'http://www.blocket.se/' + city + '?q=' + keyword + \
'&cg=0&w=0&st=s&ca=' + citycodes[city] + '&is=1&l=0&md=th'
@auselen
auselen / altyazi.sh
Last active October 12, 2015 19:44
altyazi.org download script
#!/bin/sh
# tested with BusyBox v1.22.1
if [ "$#" -ne 1 ]; then
echo Usage: $0 http://altyazi.org/sub/s/...html
exit 1
fi
HTML=`curl -s -c cookies.txt $1`
@auselen
auselen / maze
Last active August 29, 2015 14:14
c64 art
s=╱╲;while :;do printf ${s:RANDOM%2:1};sleep 0.001;done
#!/bin/sh
#create rings
echo creating hours ring
for i in $( seq 6 6 360 ); do convert -size 220x176 -depth 16 xc:transparent -fill none -stroke DarkOrange3 -draw "stroke-width 16 ellipse 110,88 74,74 270,$((270 + i))" polar_hours_$i.png; done
echo creating minutes ring
for i in $( seq 6 6 360 ); do convert -size 220x176 -depth 16 xc:transparent -fill none -stroke DarkOrange4 -draw "stroke-width 16 ellipse 110,88 58,58 270,$((270 + i))" polar_minutes_$i.png; done
echo creating seconds ring
for i in $( seq 6 6 360 ); do convert -size 220x176 -depth 16 xc:transparent -fill none -stroke peru -draw "stroke-width 16 ellipse 110,88 42,42 270,$((270 + i))" polar_seconds_$i.png; done