Skip to content

Instantly share code, notes, and snippets.

View cghsystems's full-sized avatar

Christopher Hedley cghsystems

  • Syntasso
  • London
View GitHub Profile
@cghsystems
cghsystems / copy_blobs.rb
Created January 8, 2014 10:15
This script will replace all soft linked Bosh blobs contained in $BOSH_RELEASE_DIR/blobs with hard links. This helps solve the issue of moving blobs from a created release to a new blobstore. After this script has run `bosh blobs` should show a set of blobs ready to be uploaded to a blobstore. Note: config/blobs will probably need removed.
require 'fileutils'
require 'find'
def cp_symlink(f)
new_file = "#{f}.new"
old_file = File.readlink(f)
FileUtils.cp(old_file, new_file)
`rm -r #{f}`
File.rename(new_file, f)
puts "Processed #{f}"
@cghsystems
cghsystems / tcpdump
Created January 17, 2014 12:20
In order to listen to network packet on a given network and port
#!/bin/bash
sudo tcpdump -A -i eth1 port 4222 -s0
#-w dumps the output out to a file