Skip to content

Instantly share code, notes, and snippets.

View Methimpact's full-sized avatar

methimpact Methimpact

View GitHub Profile
anonymous
anonymous / scrypt_password.py
Created September 26, 2013 13:54
An answer to http://stackoverflow.com/questions/13654492/how-to-use-scrypt-to-generate-hash-for-password-and-salt-in-python How to generate and check a password hash with scrypt and python.
import struct
from binascii import b2a_base64 as e64
from binascii import a2b_base64 as d64
import scrypt
import Crypto.Random
random = Crypto.Random.new().read
from passlib.utils import consteq
_PARAMS = struct.Struct("!BBBB")
@diyism
diyism / gmail filter rules.txt
Last active May 30, 2018 10:55
gmail 过滤规则
Matches: is:spam
Do this: Skip Inbox, Delete it
Matches: from:(@txt.voice.google.com) -{recovery code}
Do this: Forward to [email protected]
Matches: from:([email protected]) subject:("Twitter / diyism")
Do this: Skip Inbox, Mark as read
Matches: DeliveredTo:(trash[.-+] @diyism.com)
@sbiffi
sbiffi / putty.bat
Last active March 22, 2024 13:23
The aim of this vbs script is to launch putty using an URL like ssh://login@host directly from a browser. The .bat is almost the same than .vbs but less robust and just their for older systems.
:: This version is not as powerfull as vbs version, please prefere the other one.
:: It's just there if you need a non-visual basic way to perform this.
:: Restrictions:
:: - Password cannot contain a % or finish with @
:: - Chrome adds a / at the end of the URL, not yet managed
:: The aim of this script is to execute putty with parameters like ssh://login@host
:: Installation:
:: - Launch putty.reg to associate ssh:// and telnet:// to this script
:: - Edit the putty path in parameter below like puttyPath="C:\Program Files (x86)\putty.exe"
@MrChrisJ
MrChrisJ / 2014-11-7--World-Citizenship-Readme.md
Last active October 5, 2019 00:55
2014-11-7--World-Citizenship-Readme

World Citizenship - Creating Affordable Decentralised Passport Services Using Available Cryptographic Tools

Due to recent press coverage I’d like to remind everyone that this project is an experiment and learning exercise for experts in the field of cryptography. Use at your own risk and read Issues section before trying this yourself.

Proof of Initial Publication

See also:
The Journal
The Live Demo on Youtube
Torrent: magnet:?xt=urn:btih:885783fd23d63ab1b6a634d3bc34e43d7491c5da

@sandlbn
sandlbn / livirt
Last active October 10, 2021 23:46
How to compile libvirt on ubuntu
sudo apt-get install git build-essential xsltproc libxml-xpath-perl libyajl-dev libdevmapper-dev libpciaccess-dev libnl-dev systemtap-sdt-dev uuid-dev libtool autoconf pkg-config libxml2 libxml2-utils autopoint python-dev libnuma-dev gettext
git clone https://github.com/K1773R/numad.git
cd numad
make
sudo make install
cd ..; cd libvirt
git clone git://libvirt.org/libvirt.git
./autogen.sh
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-qemu=yes --with-dtrace --with-numad --with-storage-rbd --disable-nls
@kennethreitz
kennethreitz / pymean.py
Created May 9, 2016 03:06
Some Python I wrote in 2008
# PyMean ?2008, Kenneth Reitz
def main():
mean(GetNumbers())
def GetNumbers():
number_list = []
input_number = False
while input_number != "":
@puhitaku
puhitaku / supervisor
Last active December 29, 2024 16:00
Supervisor init script for OpenWrt (procd).
#!/bin/sh /etc/rc.common
#
# AUTHOR: Takumi Sueda <[email protected]>
#
# Start/stop/restart supervisor in OpenWrt.
START=91
USE_PROCD=0
PROG=/usr/bin/supervisord
@fardjad
fardjad / dsl-lte-auto-switch-setup.md
Last active January 17, 2024 16:11
[DSL/LTE Auto-switch Setup] #openwrt #dsl #lte #multiwan

DSL/LTE Auto-switch Setup

Synopsis

This is how I setup my home router to share a 4G/LTE connection at day and switch to a DSL connection overnight.

It also falls back to DSL connection whenever the 4G/LTE connection dies.

Why?

@jnturton
jnturton / encrypted-otps.ipynb
Last active May 30, 2018 11:38
A quick look at a modular arithmetic encryption scheme
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

The banana pi m1 works with the cheap ~$15 chinese 5 port sata multipliers.

Warning: The multipliers will get really hot and unreliable under load or if more than three drives are attached. Definitely put at least a heatsink on it.

With the official bananian distro it appears to work out of the box but it unfortunately only works with one drive at a time.

To get it working with multiple drives you need to enable the sunxi pmp support. The reason this is not enabled per default is that when it is enabled you will be unable to use the sata port without a port multiplier.

The kernel in the official bananian distro does not have sunxi pmp support compiled into it and the kernel is too old anyway.