- Boot with a live USB stick.
- Get name of SSD by running
lsblk
- Run this command:
sudo hdparm --user-master u --security-set-pass 1234 /dev/sda &&
sudo hdparm --user-master u --sanitize-crypto-scramble 1234 /dev/sda
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from pymouse import PyMouse, PyMouseEvent | |
from threading import Thread | |
import numpy | |
class DetectMouseClick(PyMouseEvent): | |
def __init__(self): | |
PyMouseEvent.__init__(self) |
import re | |
def multisub(dict, text): | |
# Create a regular expression from the dictionary keys | |
regex = re.compile("(%s)" % "|".join(map(re.escape, dict.keys()))) | |
# For each match, look-up corresponding value in dictionary | |
return regex.sub(lambda mo: dict[mo.string[mo.start():mo.end()]], text) |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from pykeyboard import PyKeyboard | |
k = PyKeyboard() | |
def paste(): | |
# Don't do this: | |
# k.press_key(k.control_key) |
import threading | |
from queue import Queue | |
class EasyThreading(object): | |
""" | |
To Process the functions in parallel | |
""" |
import multiprocessing | |
class EasyMultiProcessing(object): | |
""" | |
To Process the functions in parallel | |
""" | |
def __init__(self, |
#!/bin/bash | |
# run under sudo | |
# script for permanently setting environment variables, found here: | |
# https://stackoverflow.com/questions/13046624/how-to-permanently-export-a-variable-in-linux | |
add_env_var() | |
{ | |
KEY=$1 | |
VALUE=$2 | |
echo "export "$KEY"="$VALUE>>~/.bashrc |
import sublime | |
import sublime_plugin | |
s = sublime.load_settings('var_share.sublime-settings') | |
def consume(): | |
num = s.get("test_var") | |
print("Consumer received: ", num) |
#!/bin/bash | |
echo watch activated | |
inotifywait -qmre modify . | while read f | |
do | |
python $1 | |
done |
>>> lst = ['a', 'a', 'a'] | |
>>> len(set(lst)) == 1 | |
True | |
>>> all(x == lst[0] for x in lst) | |
True | |
>>> lst.count(lst[0]) == len(lst) | |
True |