Skip to content

Instantly share code, notes, and snippets.

View englishm's full-sized avatar
🎯
Focusing

Mike English englishm

🎯
Focusing
View GitHub Profile
@englishm
englishm / gist:3014579
Created June 28, 2012 23:04
ext3grep --restore-file
--restore-file 'path' [--restore-file 'path' ...]
Will restore file 'path'. 'path' is relative to the
root of the partition and does not start with a '/' (it
must be one of the paths returned by --dump-names).
The restored directory, file or symbolic link is
created in the current directory as 'RESTORED_FILES/path'.
@englishm
englishm / gist:3018929
Created June 29, 2012 16:21
ext3grep --restore-all
--restore-all As --restore-file but attempts to restore everything.
The use of --after is highly recommended because the
attempt to restore very old files will only result in
them being hard linked to a more recently deleted file
and as such polute the output.
@englishm
englishm / gist:3019005
Created June 29, 2012 16:30
Restoring deleted files from the ext3 journal with ext3grep
root@datarecovery:~# ext3grep /dev/sdb3 --restore-all --after 1335555800
Running ext3grep version 0.10.1
Only show/process deleted entries if they are deleted on or after Fri Apr 27 15:43:20 2012.
Number of groups: 156
Minimum / maximum journal block: 1544 / 35884
Loading journal descriptors... sorting... done
The oldest inode block that is still in the journal, appears to be from 1335458082 = Thu Apr 26 12:34:42 2012
Journal transaction 19354469 wraps around, some data blocks might have been lost of this transaction.
Number of descriptors in journal: 30581; min / max sequence numbers: 19354439 / 19359432
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"
@englishm
englishm / gist:3092817
Created July 11, 2012 19:47
Go Go Vagrant
  • install the latest version of VirtualBox from http://virtualbox.org
  • install vagrant from the package at http://vagrantup.com (gem install is deprecated)
  • vagrant gem install vagrant-vbguest (this will automatically update the VirtualBox Guest Additions on your vagrant boxes)
  • vagrant box add precise64 http://files.vagrantup.com/precise64.box (~300MB)
  • If you have trouble downloading the base box with Vagrant just download the box and then add from that path:
    • wget http://files.vagrantup.com/precise64.box
    • vagrant add precise64.box
  • cd ~ && mkdir vagrants && cd vagrants
  • mkdir <projectname> && cd <projectname>
  • vagrant init precise64
@englishm
englishm / deploy.rb
Created August 8, 2012 20:14
cap deploy:build_version
task :build_version, :except => { :no_release => true } do
deploy_date = Time.now.strftime('%F')
build_version = "#{deploy_date} #{tag}.build+#{current_revision}"
put(build_version,"#{current_release}/BUILD_VERSION")
end
@englishm
englishm / bootstrap.sh
Created September 4, 2012 02:29 — forked from kuleszaj/bootstrap.sh
Puppet Bootstrap, CentOS
#!/bin/bash
# Update our package manager...
sudo yum check-update -y
# Install dependencies for RVM and Ruby...
sudo yum -y install gcc-c++ patch readline readline-devel zlib zlib-devel libxml2-devel libyaml-devel libxslt-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel git
# Get and install RVM
curl -L https://get.rvm.io | sudo bash -s stable
@englishm
englishm / Vagrantfile
Created September 4, 2012 18:23
Vagrantfile for base CentOS 6.3 + RVM + Ruby + Puppet
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "centos-6.3"
config.vm.box_url = "https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-centos-6.3.box"
# Execute bootstrap.sh script (from a Gist) to install RVM, Ruby, Puppet, etc.
# Read the Gist: https://gist.github.com/3615875
config.vm.provision :shell, :inline => "curl -s -L https://raw.github.com/gist/3615875/bootstrap.sh > ~/bootstrap.sh"
sudo mkdir /etc/puppet && sudo vim /etc/puppet/site.pp
exec{"install-epel":
command => "/bin/rpm -i http://linux.mirrors.es.net/fedora-epel/6/i386/epel-release-6-7.noarch.rpm",
}