Skip to content

Instantly share code, notes, and snippets.

@Aslan
Aslan / yubikey4-ssh-macos.md
Created November 13, 2019 00:46 — forked from ixdy/yubikey4-ssh-macos.md
Setting up ssh public key authentication on macOS using a YubiKey 4

Setting up ssh public key authentication on macOS using a YubiKey 4

I largely followed Florin's blog post, but have a few notes to add regarding issues I encountered:

Basic setup notes

  1. I used a YubiKey 4, while the blog describes using a YubiKey NEO. I'm sure a YubiKey 5 would also work. I'm also running macOS 10.13.6.
  2. I installed GPGTools as recommended. However, as I'll note later, it seems that gpg-agent only automatically starts when gpg is used; for ssh, you'll need to ensure it's running.
  3. Before generating your keys, decide what key size you want to use. If you run the list command inside gpg --edit-card, look for the Key attributes line to see what is currently selected. On my YubiKey 4, it defaulted to 2048 bits for all keys:
Key attributes ...: rsa2048 rsa2048 rsa2048
@Aslan
Aslan / web-servers.md
Created May 17, 2017 05:13 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@Aslan
Aslan / gitflow-breakdown.md
Last active April 18, 2017 23:20 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

@Aslan
Aslan / gist:823396
Created February 12, 2011 01:48 — forked from xiaods/gist:337218
REE on ubuntu 9.10
# inspiration
# http://github.com/jnstq/rails-nginx-passenger-ubuntu
# sudo this sudo that bollocks
sudo -i
# system-related stuff
apt-get install htop strace sysstat
dpkg-reconfigure sysstat
apt-get install ntp
# Completely untested.
gem_package "amazon-ec2"
aws = search("aws", "main")
Gem.clear_paths
ruby_block do "register_with_elb" do
do
require 'amazon-ec2'
@Aslan
Aslan / client.rb
Created March 9, 2010 03:57 — forked from fujin/client.rb
# Chef Client Config File
# Automatically grabs configuration from ohai ec2 metadata.
require 'ohai'
require 'json'
o = Ohai::System.new
o.all_plugins
chef_config = JSON.parse(o[:ec2][:userdata])
if chef_config.kind_of?(Array)
aws_ebs_volume "my_ebs_volume" do
aws_access_key node[:aws][:aws_access_key_id]
aws_secret_access_key node[:aws][:aws_secret_access_key]
size 50
device "/dev/sdi"
volume_id node[:ebs][:volume_id]
action [ :create, :attach ]
provider "aws_ebs_volume"
end
# complain if no snapshot id provided
#
snapshot_id = node[:channels][:database][:snapshot_id] rescue nil
raise "No snapshot id specified." if snapshot_id.blank?
device = node[:channels][:database][:device] rescue nil
raise "No device specified for the database volume" if device.blank?
# mount ebs volume
#