Skip to content

Instantly share code, notes, and snippets.

@dmcrodrigues
dmcrodrigues / gist:9903878
Last active August 29, 2015 13:57
Vagrant: fix mount of shared folders
# Environment
#
# OS: Mac OS X 10.9
# Vagrant: 1.5.1
# Box: precise64
# Error
#
# Failed to mount folders in Linux guest. This is usually because
@dmcrodrigues
dmcrodrigues / gist:b70f7a4008e957ff244a
Created November 17, 2014 09:18
Nil Coalescing Operator snippet
- (NSProgress *)overallProgress {
return objc_getAssociatedObject(self, @selector(overallProgress))
?: (NSProgress *){self.overallProgress = [NSProgress progressWithTotalUnitCount:0]};
}
@dmcrodrigues
dmcrodrigues / build.xml
Created October 13, 2011 19:46
ant file to build and deploy java Web Apps [tested on Apache Tomcat]
<?xml version="1.0" ?>
<project default="build">
<property file="default.properties" />
<property name="src" location="src" />
<property name="root" location="WebContent" />
<property name="lib" location="lib" />
<property name="build" location="webapp" />
@dmcrodrigues
dmcrodrigues / sipp.sh
Last active October 4, 2015 04:48
compile sipp on ubuntu
#!/bin/sh
sudo apt-get install pcaputils libpcap-dev libncurses5-dev
wget 'http://sourceforge.net/projects/sipp/files/sipp/3.2/sipp.svn.tar.gz/download'
tar zxvf sipp.svn.tar.gz
# compile sipp
make
# compile sipp with pcapplay support
make pcapplay
@dmcrodrigues
dmcrodrigues / magic.packets.sh
Created May 10, 2012 22:01
engineer magic packets
sudo apt-get install gcc g++ build-essential
sudo apt-get install libtool automake make yasm
sudo apt-get install subversion git
# powerful tool for system monitoring
sudo apt-get install nmon
# add to .bash_profile
export NMON=cmndkt
@dmcrodrigues
dmcrodrigues / install-rvm.sh
Created June 17, 2012 20:26
install rvm on Mac OS X
# install rvm using ruby
curl -L https://get.rvm.io | bash -s stable --ruby
# add rvm function to user's profile
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"' >> ~/.bash_profile
# reload profile
source ~/.bash_profile
# install ruby and set as default
rvm install 1.9.3
rvm --default 1.9.3
@dmcrodrigues
dmcrodrigues / build.ffmpeg.sh
Created July 29, 2012 12:49
FFmpeg on OSX 10.7
#!/bin/sh
PKG_CONFIG_VERSION=0.25
YASM_VERSION=1.2.0
PARALLEL_JOBS=3
### pkg-config ########################################
echo "installing pkg-config ${PKG_CONFIG_VERSION}..."
@dmcrodrigues
dmcrodrigues / build.x264.sh
Created July 29, 2012 12:50
x264 on OSX 10.7
#!/bin/sh
PARALLEL_JOBS=3
### x264 ##############################################
echo "installing x264..."
if [ ! -d x264 ]; then
git clone git://git.videolan.org/x264.git x264
//
// UIDevice+DeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
#include <sys/types.h>
#include <sys/sysctl.h>
typedef enum {
@dmcrodrigues
dmcrodrigues / ssh.signature.sh
Last active December 16, 2015 05:19
Verify SSH key signature
ssh-keygen -lf $1 # ex: ~/.ssh/id_rsa.pub