key formats


Keys have many formats when it comes to public/private keys, encryption and signing.
Extension .pem, Privacy-Enhanced Mail, means base64 encoding plus a header BEGIN to tell PKCS type.
for ssh.exe:
private key: .pem, BEGIN RSA PRIVATE KEY
public key: .pub file, SSH, marked with ssh-rsa, OpenSSH format
generation: both by ssh-keygen.exe, or openssl genrsa
for https:
private key:
PKCS#1 marked with BEGIN RSA PRIVATE KEY, or PKCS#8 BEGIN PRIVATE KEY
public key used in signing request: SSH, marked with ssh-rsa
certificate: .pem market with BEGIN CERTIFICATE
generation: openssl req -x509 -newkey, or openssl genrsa, or ssh-keygen.exe
for signing pdf file:
private key: .pfx binary file PKCS 12
generation: by Adobe Acrobat
for SASL Simple Authentication Security Layer, used by e.g Postfix
private key: .pem marked with BEGIN RSA PRIVATE KEY
generation: openssl.exe genrsa
for gpg:
private key: .pem BEGIN PGP PRIVATE KEY BLOCK
public key: .pem BEGIN PGP PUBLIC KEY BLOCK
generation: gpg –gen-key

Minimum cost of AWS


Here is the cost of running a minimum AWS server, total of $77 /year (39 + 26 + 10 + 2)
based on price of region us-west-1 North California.
ec2: $39, t3a.nano 2 vcpu, 500M RAM
ebs: $26, for 18G
root device 8G, which is minimum, adding block device 10G, which should be reasonable
total 18G, $1.4/GB-year * 18 = $26
snapshot: $10. $0.6/GB-year, for 18G. $0.6*18=$10/year.
bandwidth: $2. assuming 1G/month, $0.15/GB * 12G
Elastic IP: $0
notes: newer instance type offers higher performance and lower price,
but snapshots of older system don’t have the option to run on new instance types.

Flash memory


Flash memory types:
NOR: replacement of EPROM, random access, slow write, usually less than 100M size
XIP, eXecute In Place
NAND: no random access, for files, cheaper, many G in size. half form factor, fewer pins

	SLC: Single-Level Cell, lasts long, expensive, not error prone, low power, fast
	MLC: Multi-Level Cell, <10k writes, cheaper
	TLC: Trinary-Level Cell, 1k writes, cheapest.
	  Most PNY low end USB 2.0 memory sticks are in this category.

eMMC: NAND + controller, also protocol name

MTD Memory Technology Devices is a kernel layer on top of flash to access the memory

breakpad in Uverse


I integrated breakpad into AT&T U-verse STB crash logging system starting 2015.
breakpad is google’s open-source multiplatform crash reporting system.
pros:
1. smaller dump file. The core dump is usually hundreds of MB, hundred times larger than breakpad dump, or mini dump.
2. its minidump file follows Windows MiniDump MDMP format, standard format generating call stack for all threads.
cons: in-process reporting, but fixed by Crashpad, out-of-process reporting

Integration:
1. Establish a way to link to breakpad library and run init:
This can be done without touching the main application binary file, which is named TV2MonoClient.
start application: LD_PRELOAD=/mnt/breakpadPlusMyCode.so TV2MonoClient
we hood up breakpad with TV2MonoClient in DllMain() of breakpadPlusMyCode.so
2. tell TV2MonoClient where to save the minidump upon crash in DllMain:
c++ code: new google_breakpad::ExceptionHandler(MinidumpDescriptor, NULL, dumpCallback, NULL, true, -1);
MinidumpDescriptor has the full file name of the minidump
dumpCallback is called when the dump has been created, where we can, e.g. upload the dump.
3. parse the minidump into plain text file
all the symbol files of TV2MonoClient and .so files are needed.
Parsing was done on a windows server, and the key tool is minidump_stackwalk.exe from google, like so:
minidump_stackwalk.exe minidumpfile .\appSymbolFiles >plainStackOutput.txt 2>err.txt
plainStackOutput.txt receives the call stacks.