Simple and safe random getters to copy-paste
string randomBytes( int $length )
int randomInt ( int $min , int $max )
string randomUuid ( void )| _ =r"""A(W//2,*M(3*G | |
| *G*V(2*J%P),G,J,G)+((M((J-T) | |
| *V((G-S)%P),S,T,G)if(S@(G,J))if(W% | |
| 2@(S,T)))if(W@(S,T);H=2**256;import&hash | |
| lib&as&h,os,re,binas cii&as&k;J$:int(k.b2 | |
| a_hex(W),16);C$:C(W// 58) +[W%58]if(W@[];X | |
| =h.new("ripemd1 60 ");Y$:h.sha256(W). | |
| digest();I$d=32: I(W//256,d-1)+bytes | |
| ([W%256])if(d>0@b""; U$:J(k.a2b_base6 | |
| 4(W));f=J(os.urandom (64))% (H-U(b"AUVRIxlQ |
| # First install tmux | |
| brew install tmux | |
| # For mouse support (for switching panes and windows) | |
| # Only needed if you are using Terminal.app (iTerm has mouse support) | |
| Install http://www.culater.net/software/SIMBL/SIMBL.php | |
| Then install https://bitheap.org/mouseterm/ | |
| # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
| // | |
| // Script.swift | |
| // Buildasaur | |
| // | |
| // Created by Honza Dvorsky on 12/05/15. | |
| // Copyright (c) 2015 Honza Dvorsky, dotzero. All rights reserved. | |
| // | |
| import Foundation |
Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
| #!/bin/bash | |
| # PiTFT Resistive 2.8" (PID 1601) or Capacitive 2.8" (PID 1983) setup script or Resistive 3.5" (PID 2097) or 2.2" No-Touchscreen setup script! | |
| set -e | |
| function cleanup() { | |
| if [ "${mountpoint}" != "/" ] | |
| then | |
| sudo -n umount "${mountpoint}/boot" 2> /dev/null |