- 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
#!/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 shlex | |
from dataclasses import dataclass | |
from pathlib import Path | |
from subprocess import check_call | |
from typing import Final, Optional, Sequence | |
IMG_EXTS: Final[Sequence[str]] = ( | |
".png", | |
".jpg", | |
".svg", |
[Nemo Action] | |
Name=Open in Sublime Merge | |
Comment=Open in Sublime Merge | |
Exec=/opt/sublime_merge/sublime_merge -n %F | |
Icon-Name=sublime-merge | |
Selection=any | |
Extensions=dir | |
Quote=double |
[Nemo Action] | |
Name=Open in Sublime Text 3 | |
Comment=Open in Sublime Text 3 | |
Exec=subl -n %F | |
Icon-Name=sublime-text | |
Selection=any | |
Extensions=dir | |
Quote=double | |
Mimetypes=text/plain | |
Dependencies=subl |
#!/bin/bash | |
echo watch activated | |
inotifywait -qmre modify . | while read f | |
do | |
python $1 | |
done |
Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.
The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!
Adapted from Alen K's original transcript to Python 3.6+ syntax by myself.
Don't use a password. Generate a passphraseless SSH key and push it to your VM. | |
If you already have an SSH key, you can skip this step… Just hit Enter for the key and both passphrases: | |
$ ssh-keygen -t rsa -b 2048 | |
Generating public/private rsa key pair. | |
Enter file in which to save the key (/home/username/.ssh/id_rsa): | |
Enter passphrase (empty for no passphrase): | |
Enter same passphrase again: | |
Your identification has been saved in /home/username/.ssh/id_rsa. |
public class User | |
{ | |
public string Name { get; set; } | |
public string Email { get; set; } | |
public int Age { get; set; } | |
public DateTime CreatedAt { get; set; } | |
} | |
// creating one fake user | |
var user = new Faker<User>().Create(); |
// create new object | |
contact_existing = Mapper.Map<ContactDTO, Contact>(contact_dto); | |
// update existing object | |
contact_existing = Mapper.Map<ContactDTO, Contact>(contact_dto, contact_existing); |