Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# does not use keypairs yet (see https://discourse.chef.io/t/test-kitchen-ssh-key-for-use-with-vagrant/7892)
# so you will be prompted for the password ('vagrant') once as we add our
# public key to the list of authorized keys.
cat ~/.ssh/id_rsa.pub | ssh -p 2222 vagrant@localhost "cat >> .ssh/authorized_keys"
scp -P 2222 /Users/dtenenba/chef-repo/encrypted_data_bag_secret vagrant@localhost:/tmp
ssh -p 2222 vagrant@localhost "sudo rm -f /etc/chef/encrypted_data_bag_secret && sudo mkdir -p /etc/chef && sudo mv /tmp/encrypted_data_bag_secret /etc/chef/ && sudo chown root /etc/chef/encrypted_data_bag_secret && sudo chmod 0400 /etc/chef/encrypted_data_bag_secret"
#!/usr/bin/env ruby
# to deregister an ami AND remove its associated snapshot
if ARGV.empty?
puts "usage: #{$0} <ami-id>"
exit
end
require 'aws-sdk'
{
"variables": {
},
"builders": [{
"type": "virtualbox-ovf",
"source_path": "AndrewDyrga_default_1453408916495_90329.ova",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"shutdown_command": "sudo halt"
}],
require 'aws-sdk'
require 'time'
require 'yaml'
require 'httparty'
Aws.config.update({region: 'us-east-1', credentials: Aws::Credentials.new('access_key', 'secret_key')})
ec2 = Aws::EC2::Client.new(region: 'us-east-1')
def get_amis(ec2)
# for the release announcement, a list of new package names and their Description fields
# start with 'pkgs' which is a vector of new package names
# manually generate this by diffing the last 2 manifests
f <- function(pkg) {
desc <- sprintf("%s/DESCRIPTION", pkg)
dcf <- read.dcf(desc)
desc <- dcf[,'Description']
names(desc) <- pkg
desc
# first set of machines
machine1:
image: "dtenenba/cytoscape3"
ports:
- "9291:1234"
machine2:
image: "dtenenba/cytoscape3"
ports:
- "9292:1234"
machine3:
source("https://bioconductor.org/biocLite.R")
biocLite(c("AnnotationHub", "rtracklayer"))
library(AnnotationHub)
ah <- AnnotationHub()
ah <- subset(ah, species == "Homo sapiens")
qhs <- query(ah, "RefSeq")
genes <- qhs[qhs$genome == "hg19" & qhs$title == "RefSeq Genes"]
genes <- qhs[[1]]
#!/usr/bin/env ruby
require 'pp'
if ARGV.length != 1
puts "usage: #{$0} manifest_file"
exit
end
lines = File.readlines(ARGV.first)
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
system('ssh-keygen -t rsa -C "[email protected]" -N "" -f ~/.ssh/id_rsa')
system("cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys")