Skip to content
View yubikey-auth
#!/bin/sh
KEY1="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
KEY2="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
challenge=`head -c63 /dev/urandom | xxd -c 63 -ps`
response=`qvm-run -a --nogui -u root -p sys-usb "ykchalresp -2 -x $challenge"`
function yubi_auth() {
View gist:20d51d16bd6dc71abb4269c209835e4a
<?php
function mtl_to_x509($base64str) {
$raw = base64_decode($base64str);
// Parse the decoded string
$cert_length = unpack('N', chr(0).substr($raw, 12, 3))[1];
$cert_as_asn1 = substr($raw, 15, $cert_length);
return $cert_as_asn1;
}
View keybase.md

Keybase proof

I hereby claim:

  • I am mig5 on github.
  • I am mig5 (https://keybase.io/mig5) on keybase.
  • I have a public key whose fingerprint is 0E6B 7951 85FC A187 066D 339C EEA4 341C 6D97 A0B6

To claim this, I am signing this object:

View gist:a89af7d113f403521cd7
vagrant() {
if [[ $@ == "ssh" ]]; then
command vagrant ssh || command vagrant up && command vagrant ssh
else
command vagrant $@
fi
}
View gist:a5a6f194b8221263d6f9
Jul 29 09:15:07 dom0 systemd[1]: Started Qubes NetVM startup.
Jul 29 09:15:07 dom0 systemd[1]: Starting Start Qubes VM gpg...
Jul 29 09:15:07 dom0 systemd[1]: Starting Start Qubes VM yubi...
Jul 29 09:15:07 dom0 systemd[1]: Starting Start Qubes VM vpn...
Jul 29 09:15:07 dom0 qvm-start[2812]: --> Creating volatile image: /var/lib/qubes/appvms/gpg/volatile.img...
Jul 29 09:15:07 dom0 qvm-start[2814]: --> Creating volatile image: /var/lib/qubes/servicevms/vpn/volatile.img...
Jul 29 09:15:07 dom0 qvm-start[2813]: --> Creating volatile image: /var/lib/qubes/appvms/yubi/volatile.img...
Jul 29 09:15:07 dom0 kernel: loop9: p1 p2
Jul 29 09:15:07 dom0 qvm-start[2813]: Lock is already obtained.. waiting 5 seconds til we try again (attempt #1)
Jul 29 09:15:07 dom0 qvm-start[2814]: Lock is already obtained.. waiting 5 seconds til we try again (attempt #1)
View qubes-template-update.sh
#!/bin/bash
#
# Script to update template images in a big batch
#
# Get a list of templates
TEMPLATES=$(qvm-ls | grep Tpl | awk {'print $1'} |cut -d[ -f2 | cut -d] -f1)
usage()
{
View gist:3ad90f15b8189eb333fd
[miguel@dom0 ~]$ sudo tar c /var/lib/rpm /etc/yum.repos.d /etc/yum.conf 2>/dev/null | qvm-run -p "dom0-update-vm" 'tar x -C /var/lib/qubes/dom0-updates'
tar: var: Cannot mkdir: Permission denied
tar: var/lib/rpm: Cannot mkdir: No such file or directory
tar: var: Cannot mkdir: Permission denied
tar: var/lib/rpm/__db.001: Cannot open: No such file or directory
tar: var: Cannot mkdir: Permission denied
tar: var/lib/rpm/Dirnames: Cannot open: No such file or directory
tar: var: Cannot mkdir: Permission denied
View deploy.yml
---
- hosts: all
gather_facts: no
tasks:
- name: Backup database
shell: "{{ item }}"
with_items:
- mkdir -p ~jenkins/dbbackups
- drush @{{ shortname }}_{{ env }} sql-dump --skip-tables-key=common | gzip > ~jenkins/dbbackups/{{ shortname }}_{{ env }}_prior_to_{{ build }}.sql.gz
View keybase.md

Keybase proof

I hereby claim:

  • I am mig5 on github.
  • I am mig5 (https://keybase.io/mig5) on keybase.
  • I have a public key whose fingerprint is E414 4692 2E11 B8DD 0D43 80E9 5418 373D FF79 BA19

To claim this, I am signing this object:

View vcloud-vm-lookup.sh
#!/bin/bash
usage() {
cat << EOF
usage: $0 ARGUMENTS
Simple wrapper script to query the vCloud API and return a
YAML object of a specific virtual machine.
Written by mig5 July 2014
Something went wrong with that request. Please try again.