Let’s Encrypt + Amazon AMI

Download certbot


$ wget https://dl.eff.org/certbot-auto
$ chmod a+x certbot-auto

Generate Certificates


sudo ./certbot-auto --debug -v --server https://acme-v01.api.letsencrypt.org/directory certonly -d YOUR_WEBSITE_HERE

Auto Renew Script:


sudo crontab -e
0 1,13 * * * /home/ec2-user/certbot-auto renew

Source Here

LLDB + Xcode 8 Kung Fu

Printing Arrays

parray  number pointer
poarray number pointer

Reading Method Parameters

register read $arg1 $arg2
memory read $arg1

Printing Objects in Swift

expr -O --language objc -- 0x1003183e0

Disassembling the current frame

disassemble --frame

Module Image

image list ModuleName

UIStackView inside UISScrollView

1. Disable tAMIC

scrollView.translatesAutoresizingMaskIntoConstraints = false
stackView.translatesAutoresizingMaskIntoConstraints = false

2. Pin the ScrollView

NSLayoutConstraint.activate([
  scrollView.leadingAnchor.constraint(equalTo: leadingAnchor),
  scrollView.trailingAnchor.constraint(equalTo: trailingAnchor),
  scrollView.topAnchor.constraint(equalTo: topAnchor),
  scrollView.bottomAnchor.constraint(equalTo: bottomAnchor)
  ])

3. Pin the StackView to the ScrollView corners. Include minimum width + padding:

let padding = CGFloat(10)
NSLayoutConstraint.activate([
  stackView.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor, constant: padding),
  stackView.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor, constant: -padding),
  stackView.topAnchor.constraint(equalTo: scrollView.topAnchor),
  stackView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor),
  stackView.heightAnchor.constraint(equalTo: scrollView.heightAnchor),
  stackView.widthAnchor.constraint(greaterThanOrEqualTo: scrollView.widthAnchor, constant: -2 * padding)
])