References:
From man page: man apt_preferences
From: http://everythingsysadmin.com/2016/03/two-github-accounts.html | |
Someone recently commented that with Github it is "a pain if you want to have a work and personal identity." | |
It is? I've had separate work and personal Github accounts for years. I thought everyone knew this trick. | |
When I clone a URL like git@github.com:TomOnTime/tomutils.git I simply change github to either github-home or github-work. Then I have my ~/.ssh/config file set with those two names configured to use different keys: | |
# TomOnTime | |
Host home-github.com | |
HostName github.com |
# log from ipython as I played with the pricing api | |
#index.json from https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json | |
# Per http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html#download-the-offer-index | |
# But this may no longer be supported as it (EC2) is not part of the parent index of all services any longer | |
import json | |
with open('index.json', 'r') as foo: | |
data = json.read(foo) | |
with open('index.json', 'r') as foo: |
#!/bin/sh | |
cat > lifecycle.json <<EOF | |
{ | |
"Rules": [ | |
{ | |
"Expiration": { | |
"Days": 7 | |
}, | |
"ID": "Expire, delete, and cancel", |
# HVM EBS-SSD | |
aws ec2 describe-regions --output text --query 'Regions[*].[RegionName]' --region us-east-1 | while read region; do echo -e "$region "; aws --region $region ec2 describe-images --owners 099720109477 --filters Name=root-device-type,Values=ebs Name=architecture,Values=x86_64 Name=name,Values='*hvm-ssd/ubuntu-xenial-16.04*' --query 'sort_by(Images, &Name)[-1].ImageLocation'; done; | |
# HVM Instance-store | |
aws ec2 describe-regions --output text --query 'Regions[*].[RegionName]' --region us-east-1 | while read region; do echo -e "$region "; aws --region $region ec2 describe-images --owners 099720109477 --filters Name=root-device-type,Values=instance-store Name=architecture,Values=x86_64 Name=name,Values='*hvm-instance/ubuntu-xenial-16.04*' --query 'sort_by(Images, &Name)[-1].ImageLocation'; done; | |
# PV EBS-SSD | |
aws ec2 describe-regions --output text --query 'Regions[*].[RegionName]' --region us-east-1 | while read region; do echo -e "$region "; aws --region $region ec2 describe-images --owners 0997201094 |
REPO_LINE="deb https://${LP_USER}:${PPA_PASSWORD}@${PRIVATE_PPA_URL} ${SUITE} main" | |
REPO_KEY_FINGERPRINT=832749327429CADB77842973ED72947203471037 | |
# Add the private ppa to the system | |
env DEBIAN_FRONTEND=noninteractive chroot "${MOUNTPOINT}" apt-add-repository "${REPO_LINE}" | |
env DEBIAN_FRONTEND=noninteractive chroot "${MOUNTPOINT}" apt-key adv --keyserver keyserver.ubuntu.com --recv ${REPO_KEY_FINGERPRINT} | |
env DEBIAN_FRONTEND=noninteractive chroot "${MOUNTPOINT}" apt-get update | |
# Install from private PPA HERE | |
env DEBIAN_FRONTEND=noninteractive chroot "${MOUNTPOINT}" apt-get install -qqy awesome_package_but_super_secret |
## Install trusty desktop on an NVMe device (with uefi) | |
sudo apt-get install ovmf zsync | |
qemu-img create nvme.img 10G | |
zsync http://cdimage.ubuntu.com/daily-live/current/trusty-desktop-amd64.iso.zsync | |
# copy OVMF.fd to use "-pflash" option and thus have persistent nvram storage | |
cp /usr/share/ovmf/OVMF.fd . |
References:
From man page: man apt_preferences
#!/usr/bin/env python3 | |
""" | |
Watch the clipboard for URLs and open them in the browser (on Linux) | |
""" | |
import subprocess | |
import time | |
import pyperclip # Requires xclip to be apt installed |
#!/bin/bash | |
cat <<EOF > meta-data | |
instance-id: iid-local01 | |
local-hostname: cloudimg | |
EOF | |
cat <<EOF > user-data | |
#cloud-config | |
ssh_import_id: [ yourlaunchpadid ] |