Skip to content

Instantly share code, notes, and snippets.

View infinitylx's full-sized avatar
🤠
CDD - Cowboy Driven Development

Wladislaw infinitylx

🤠
CDD - Cowboy Driven Development
View GitHub Profile
@infinitylx
infinitylx / file_list_downloader.py
Created April 3, 2014 10:23
Download files from file with list of urls.
import os
import urllib2, posixpath, urlparse
DOWNLOADS_DIR = './mp3'
# For every line in the file
for url in open('list.urls'):
resp = urllib2.urlopen(url)
# Split on the rightmost / and take everything on the right side of that
name = urllib2.unquote(posixpath.basename(urlparse.urlsplit(resp.url).path))
@infinitylx
infinitylx / pysyslog.py
Last active December 13, 2021 12:23 — forked from marcelom/pysyslog.py
Tiny Python3 Syslog Server
#!/usr/bin/env python3
## Tiny Syslog Server in Python3.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'