Skip to content

Instantly share code, notes, and snippets.

Sergey Panfilov sergray

Block or report user

Report or block sergray

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
sergray /
Created Dec 6, 2018
dump postgresql DB with specific pg_dump version running in Docker container
pg_version=10.5 pg_user=user db_name=db && \
docker run -it --rm -v /tmp/pgdump:/tmp/pgdump:rw --network=host postgres:$pg_version \
pg_dump -h localhost -U $pg_user -W -f /tmp/pgdump/${db_name}_$(date +%Y%m%d%H%M%S) -Fc -v $db_name
sergray /
Last active Jun 4, 2018 — forked from floehopper/
Install rtl-sdr on Raspian on Raspberry Pi
jamesmead@floehopper.local:~$ sudo dd bs=1m if=/Users/jamesmead/Downloads/2015-02-16-raspbian-wheezy.img of=/dev/disk2
pi@raspberrypi ~ $ sudo raspi-config
# Choose option 1 to "Expand Filesystem" - Ensures that all of the SD card storage is available to the OS
# Choose Finish & reboot

pi@raspberrypi ~ $ sudo apt-get update

Keybase proof

I hereby claim:

  • I am sergray on github.
  • I am sergray ( on keybase.
  • I have a public key whose fingerprint is 8D10 3889 4812 2AC6 FCE4 C2AA 72C7 36F2 8A57 BBFC

To claim this, I am signing this object:

sergray / autoscout.js
Created Feb 8, 2017
Export Autoscout24 favorites in a JSON list
View autoscout.js
var favorites = [];
link: it.attributes['data-detailpage'].value,
image: $('.listImage img', it).attr('src'),
price: $('.listItemHeaderPrice', it).text().trim(),
date: $('.listItemHeaderEZ', it).text().trim(),
mileage: $('.listItemHeaderMileage', it).text().trim(),
title: $('span.fontLoud', it).text().trim(),
address: $('span.fontSilent', it).text().trim()
sergray / PyCon2016.txt
Created Jun 8, 2016 — forked from kekssw/PyCon2016.txt
PyCon 2016 - Recommended by kekssw
View PyCon2016.txt
For me to watch:
Great speakers + interesting topics
- How I built a power debugger out of the standard library and things I found on the internet
- Glyph - Shipping Software To Users With Python - PyCon 2016
- Andrew Godwin - Reinventing Django for the Real-Time Web - PyCon 2016
sergray / gist:a7cf81e2061b0b591e8a
Last active Aug 29, 2015
Save commits from multiple GitHub pull requests into text files just in one bash line (requires Python flatdict)
View gist:a7cf81e2061b0b591e8a
$ for p in NUM1 NUM2; do curl -H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token OAUTH-TOKEN" \$p/commits | \
python -c "from flatdict import FlatDict; import json, csv, sys; rows = json.load(sys.stdin); \
writer = csv.DictWriter(sys.stdout, [u'commit:author:name', u'commit:author:date', u'commit:tree:sha', u'commit:message'], extrasaction='ignore', delimiter='\t'); writer.writerows(FlatDict(row) for row in rows)" \
> GH-PR-$p.txt; done
sergray /
Last active Jul 4, 2019
Asynchronous requests in Flask with gevent
"""Asynchronous requests in Flask with gevent"""
from time import time
from flask import Flask, Response
from gevent.pywsgi import WSGIServer
from gevent import monkey
import requests
sergray /
Last active Aug 29, 2015
Python command gico checking out the latest version of git branch by name substring
#!/usr/bin/env python
"""Checkout the latest version of git branch by name substring"""
from __future__ import print_function
import sys
from subprocess import check_output
sergray / gico
Created Sep 9, 2014
checkout git branch by substring
View gico
#!/usr/bin/env python
"Checkout git branch with name substring"
from __future__ import print_function
import sys
from subprocess import check_output
rrdtool graph power.png --vertical-label=W*h --font=DEFAULT:11:Arial -w 900 -h 600 \
DEF:apower=pcv.rrd:power:AVERAGE CDEF:whpower=apower,1000,\* LINE2:whpower#FF0000
You can’t perform that action at this time.