As configured in my dotfiles.
start new:
tmux
start new with session name:
*.acn | |
*.acr | |
*.alg | |
*.aux | |
*.bak | |
*.bbl | |
*.bcf | |
*.blg | |
*.brf | |
*.bst |
from Crypto.Cipher import AES | |
from bitstring import BitArray, Bits | |
(key, m) = (BitArray(hex='00112233445566778899AABBCCDDEEFF'), BitArray(hex='00000000000000000000000000000000')) | |
const_rb = BitArray(hex='00000000000000000000000000000087') | |
k0 = BitArray(hex=AES.new(key.bytes).encrypt(m.bytes).encode('hex')) | |
As configured in my dotfiles.
start new:
tmux
start new with session name:
import imaplib, serial, struct, time | |
class Mail(): | |
def __init__(self): | |
self.user= 'USER' | |
self.password= 'PASS' | |
self.ser = serial.Serial('/dev/tty.usbmodem621', 9600) | |
self.M = imaplib.IMAP4_SSL('imap.gmail.com', '993') | |
self.M.login(self.user, self.password) | |
import android.content.Context; | |
import android.content.pm.PackageInfo; | |
import android.content.pm.PackageManager; | |
import android.content.pm.PackageManager.NameNotFoundException; | |
import android.content.pm.Signature; | |
public class TamperCheck { | |
//we store the hash of the signture for a little more protection | |
private static final String APP_SIGNATURE = "1038C0E34658923C4192E61B16846"; |
def encrypt_RSA(public_key_loc, message): | |
''' | |
param: public_key_loc Path to public key | |
param: message String to be encrypted | |
return base64 encoded encrypted string | |
''' | |
from Crypto.PublicKey import RSA | |
from Crypto.Cipher import PKCS1_OAEP | |
key = open(public_key_loc, "r").read() | |
rsakey = RSA.importKey(key) |
def sign_data(private_key_loc, data): | |
''' | |
param: private_key_loc Path to your private key | |
param: package Data to be signed | |
return: base64 encoded signature | |
''' | |
from Crypto.PublicKey import RSA | |
from Crypto.Signature import PKCS1_v1_5 | |
from Crypto.Hash import SHA256 | |
from base64 import b64encode, b64decode |
def verify_sign(public_key_loc, signature, data): | |
''' | |
Verifies with a public key from whom the data came that it was indeed | |
signed by their private key | |
param: public_key_loc Path to public key | |
param: signature String signature to be verified | |
return: Boolean. True if the signature is valid; False otherwise. | |
''' | |
from Crypto.PublicKey import RSA | |
from Crypto.Signature import PKCS1_v1_5 |
#!/bin/bash | |
# use this following line in the keyboard shortcut entry: | |
# xfce4-terminal --drop-down --command=/path/to/dwimux.sh | |
tm=$(tmux list-session) | |
if [ "$tm" ]; then | |
tmux a | |
else |