Skip to content

Instantly share code, notes, and snippets.

Hardening the USB Armory

As a good crypto nerd, I usually use an entirely encrypted linux FS: / but also /boot using grub LUKS support. It's a good setup but it's not perfect, the BIOS and the bootloader are not protected.

I recently got a USBArmory and I wanted to apply the same (or a better) setup.

I found some useful links but no clear howto. So this is my setup.

@jasondenning
jasondenning / meta-tags.md
Created June 10, 2017 01:03 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@jasondenning
jasondenning / gist:d544cc33652013c9b347ac986e83ab7f
Created May 31, 2017 20:30 — forked from drkarl/gist:739a864b3275e901d317
Ask HN: Best Linux server backup system?

Linux Backup Solutions

I've been looking for the best Linux backup system, and also reading lots of HN comments.

Instead of putting pros and cons of every backup system I'll just list some deal-breakers which would disqualify them.

Also I would like that you, the HN community, would add more deal breakers for these or other backup systems if you know some more and at the same time, if you have data to disprove some of the deal-breakers listed here (benchmarks, info about something being true for older releases but is fixed on newer releases), please share it so that I can edit this list accordingly.

  • It has a lot of management overhead and that's a problem if you don't have time for a full time backup administrator.

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

@jasondenning
jasondenning / fix_github_https_repo.sh
Created May 31, 2017 10:00 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@jasondenning
jasondenning / iterm2.zsh
Created May 31, 2017 09:59 — forked from wadey/iterm2.zsh
Change iTerm2 tab color when using SSH
# Usage:
# source iterm2.zsh
# iTerm2 window/tab color commands
# Requires iTerm2 >= Build 1.0.0.20110804
# http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
echo -ne "\033]6;1;bg;blue;brightness;$3\a"
@jasondenning
jasondenning / .bashrc_ssh
Created May 31, 2017 09:58 — forked from mzedeler/.bashrc_ssh
bashrc snippet for initializing ssh agent and adding ssh key
#!/bin/bash
# Set up ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initializing new SSH agent..."
touch $SSH_ENV
chmod 600 "${SSH_ENV}"
/usr/bin/ssh-agent | sed 's/^echo/#echo/' >> "${SSH_ENV}"
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts
# Scan known hosts
ssh-keygen -f /etc/ssh/ssh_known_hosts -H -F github.com
@jasondenning
jasondenning / README.md
Created May 31, 2017 09:54 — forked from m4dz/README.md
OS X Fresh (Re)Install

OS X ENV (re)Install

This is my personal guide to restore my configuration and setup my system for a fresh install. I use it and keep it updated frequently. Hope it will inspire you on your own way =].

Backup

Before a fresh reinstall, don't forget to backup many things. A regular ghost made with CarbonCopyCloner or Clonezilla is a good solution, but if you can't, you should save the following: