Skip to content

Instantly share code, notes, and snippets.

View dmgl's full-sized avatar
🎯
Focusing

Galochkin D.D. dmgl

🎯
Focusing
  • Russia, Saint-Petersburg
View GitHub Profile
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@sh1n0b1
sh1n0b1 / ssltest.py
Created April 8, 2014 07:53
Python Heartbleed (CVE-2014-0160) Proof of Concept
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@jeffaudi
jeffaudi / tumblr-likes-downloader.py
Last active June 15, 2022 01:25
This python script downloads all the photos liked of your tumblr account. This is usually more useful than downloading the photos from a specfic blog. Updated to also download videos and store content is folders. Please, note that currently the Tumblr API only returns the first 1000 likes (https://groups.google.com/forum/#!searchin/tumblr-api/li…
import pytumblr
import os
import code
import oauth2 as oauth
from pprint import pprint
import json
import urllib
import codecs
# Number of likes to fetch in one request

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@jonschoning
jonschoning / pc.laptop
Last active October 10, 2022 11:33
/usr/share/X11/xkb/symbols/pc (swap CTRL+ALT+CAPS; ALT->CTRL, CAPS->ALT) https://github.com/jonschoning/xkb_symbols
default partial alphanumeric_keys modifier_keys
xkb_symbols "pc105" {
key <ESC> { [ Escape ] };
// The extra key on many European keyboards:
key <LSGT> { [ less, greater, bar, brokenbar ] };
// The following keys are common to all layouts.
key <BKSL> { [ backslash, bar ] };
@phrawzty
phrawzty / 2serv.py
Last active January 16, 2025 08:46
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@caiosba
caiosba / csv2table.py
Created October 16, 2015 16:30
Python script to convert from CSV to a pretty ASCii table
#!/usr/bin/python
from __future__ import print_function
import prettytable
import csv
import sys
def main(argv):
if len(sys.argv) != 3:
print('Usage: python csv2table.py [input file] [output]\n')
@mertvetsky
mertvetsky / cat.js
Last active March 21, 2016 12:02
standalone funny kitty
document.addEventListener("DOMContentLoaded", function () { //optional
if (!document.getElementById('hello_cat')) {
var p = -15;
var d = document.createElement('div');
var c = document.createElement('img');
c.src = 'data:image/gif;base64,R0lGODlh6gDIAOf/AAABAAMABgcAAAACBgEEAAMGARIAEQcECgwDEQ8DCwMJDQoHDQcJBQ4HBQsOChIMCwgPEQ8NEQ0OFxMNFxEOHBgNGw8RDg8UFhIUERcSGxMUGxYUFxoTGBUXFBkWFR4UIBgaFx0YIRsaHRobIhocGh0eHCgaKiIdJh4fJiEfIh8hHiQgHygeKyMkIiYjLCYlKCskKCcoJisnJiopLC0oMTAoLTQmODEoNiosKS0uLC8uMTItNzIzMTcyPDYzNz0yPTY3ND00RDg6Nzw4Qjw5PTs9Okk6TD4/PUI9SEE+QkFCQEg/T0s/SkdESEhET0VHRFBITUlLSExLTlBLVk1OTFZMXVBRT1pOWlZQWlVRVVZYVVlXW1xXYmJWYmFXaF1cYFxeW2FjYGRjaGhibWVnZG9kdG1odGlraGtqbXJpbnBucnVueW9xbntugX1wfXh0eXZ3dHp1gHt8eX18gIR7gYZ7jYN+iYp9ioGDgIWChoqJjYmKh5GIjY+JlJGJmo6QjZCPk5WNmZyNp5OVkpyTmZeVmZqVoJiZlqKWpqGbp5yem5+doaudq6ehraKkoaajqK2itbOhtq2kqq6otKuqrqqsqbaota2vrLWvurKxtbO0sb+xvr6yxby1wr+1u7m3u7e5tse7z8S9yL+/w77Avci71c2+zM7B1sTGw8rD0M3DycfFycnLyNDJ1c3Lz9TK3djK18
@dschep
dschep / raspbian-python3.6.rst
Last active November 21, 2024 15:10 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).
@Cimbali
Cimbali / justified_reader.css
Created January 14, 2017 18:46
Justified text in Firefox's "reader" mode
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix("about:reader") {
#moz-reader-content {
text-align: justify;
}
}