Skip to content

Instantly share code, notes, and snippets.

View xja's full-sized avatar

xja

View GitHub Profile
@martinrusev
martinrusev / imap-search
Last active November 4, 2024 12:46
IMAP Search criteria
@stbuehler
stbuehler / bma2otp.rb
Created January 25, 2014 14:10
Decode the Battle.net Mobile Authenticator (android) secret data into an otpauth url. Requires a way to access the private data of the application (i.e. a rooted android).
#!/usr/bin/ruby
# REQUIRES:
# * rooted android, as otherwise you can't read the applications private data
# * to display the qr code "qrencode" (http://fukuchi.org/works/qrencode/)
# and "display" from ImageMagick
# This script "decrypts" the token from the internal state of the
# Battle.net Mobile Authenticator on android application, converting
# it into an "otpauth" url (https://code.google.com/p/google-authenticator/wiki/KeyUriFormat)
@Squab
Squab / redis-mass-insert.md
Last active November 15, 2022 13:07
Prepares data for Redis Mass Insertion with the redis-cli --pipe command

redis-mass-insertion

Lightweight Python script to prepare Redis commands for mass insertion.

Code

#!/usr/bin/env python
"""
    redis-mass.py
@jamescaldow
jamescaldow / nginx.conf
Created August 21, 2016 17:50
Nginx config file with SSL/TLS, security, speed and Cloudflare optimisations. (Work in progress)
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
@BravoTango86
BravoTango86 / Base32.cs
Created September 20, 2016 22:03
Base32 Encoding and Decoding in C#
/*
* Derived from https://github.com/google/google-authenticator-android/blob/master/AuthenticatorApp/src/main/java/com/google/android/apps/authenticator/Base32String.java
*
* Copyright (C) 2016 BravoTango86
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@nrollr
nrollr / nginx.conf
Last active October 23, 2024 00:49
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@corona6
corona6 / README.md
Last active November 15, 2024 15:54
delete unused resources/revisions/tags for Joplin https://github.com/corona6/joplinclean
@thomaswieland
thomaswieland / gist:3cac92843896040b11c4635f7bf61cfb
Created February 17, 2018 13:56
Python: IMAP IDLE with imaplib2
import imaplib2, time
from threading import *
# This is the threading object that does all the waiting on
# the event
class Idler(object):
def __init__(self, conn):
self.thread = Thread(target=self.idle)
self.M = conn
self.event = Event()
@jackdesert
jackdesert / gist:3015200944599fe2f13853287ad4e670
Created July 10, 2018 14:00
pip install uwsgi - python3_plugin.so no found
# Install System-wide
sudo apt install -y uwsgi-core uwsgi-plugin-python3
# Run system uwsgi: this works!
$ cd ~/myproject
$ uwsgi --ini production.ini
[uWSGI] getting INI configuration from production.ini
# Install uwsgi via pip
@likeablob
likeablob / 01-yet-another-minicap-python3-client.md
Last active May 8, 2024 08:54
A simple minicap client with python3

minicap-python3-client

minicap installation

Plan A: Use minicap-prebuilt

$ npm init -y
$ npm i -S minicap-prebuilt
$ ls node_modules/minicap-prebuilt/prebuilt/