Skip to content

Instantly share code, notes, and snippets.

node.js:63
throw e;
^
Error: No module symbol found in module.
at Module._loadObjectSync (node.js:360:13)
at Module.loadSync (node.js:336:12)
at loadModule (node.js:283:14)
at require (node.js:411:14)
at Object.<anonymous> (/usr/local/lib/node/.npm/pcap/0.2.1/package/pcap.js:8:18)
@shaneog
shaneog / update_acl.rb
Created August 30, 2011 16:20
Capifony Task to Set ACLs on Symfony2 app/cache and app/logs directories as per http://symfony.com/doc/current/book/installation.html
# Change ACL on the app/logs and app/cache directories
after 'deploy', 'deploy:update_acl'
# This is a custom task to set the ACL on the app/logs and app/cache directories
namespace :deploy do
task :update_acl, :roles => :app do
shared_dirs = [
app_path + "/logs",
@shaneog
shaneog / es.sh
Created September 6, 2011 17:04 — forked from aaronshaf/es.sh
Install ElasticSearch on Ubuntu 11.04
cd ~
sudo apt-get install unzip
sudo apt-get install python-software-properties -y
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.7.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
@shaneog
shaneog / gist:1198248
Created September 6, 2011 17:12
elasticsearch ubuntu 11.04
cd ~
# Install the required JDK
sudo apt-get install openjdk-6-jre-headless
# Download, extract and move ElasticSearch
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.6.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
@shaneog
shaneog / gist:2876091
Created June 5, 2012 16:31
PHP Floating Point weirdness
<?php
$a = 35.55;
echo $a.PHP_EOL;
$b = 100;
echo $a * $b.PHP_EOL;
@shaneog
shaneog / hostname.sh
Created July 13, 2012 16:06
Change Ubuntu hostname on startup based on vCloud Director machine name
#!/bin/bash
### BEGIN INIT INFO
# Provides: hostname
# Required-Start:
# Required-Stop:
# Should-Start: glibc
# X-Start-Before: networking
# Default-Start: S
# Default-Stop:
# Short-Description: Sets the hostname based on the vCloud Director OVF details
@shaneog
shaneog / soap.xml
Created September 13, 2012 14:47
SOAP XML Request
<?xml version="1.0"?>
<s:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ServiceRequest xmlns="http://tempuri.org/">
<rqst xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Credentials xmlns="">
<Password>XXXXXX</Password>
<UserName>XXXXXXX</UserName>
</Credentials>
<RequestType xmlns="">Login</RequestType>
require 'savon'
HTTPI.log = false
username = "XXXXXXX"
password = "XXXXXXX"
Savon.configure do |config|
# The XML logged by Savon can be formatted for debugging purposes.
@shaneog
shaneog / assets.py
Created February 22, 2013 19:09
A Python script to generate a Twig template file for a folder full of images. I use this so that my CSS can use the notation url('ing/name.png') and this does not get rewritten to url('../../Resources/public/img/name.png') I want all my image asset files to be relative to my web path, but I want to keep them located in my bundles
#!/usr/bin/env python
import os
import argparse
parser = argparse.ArgumentParser(description='Create Assetic Twig image file list')
parser.add_argument('-b','--bundle', help='Bundle name', required=True)
parser.add_argument('-f','--folder', help='Image folder')
parser.add_argument('-s','--search', help='The location to recursively search & list')
@shaneog
shaneog / GruntBridge.php
Created February 25, 2013 11:40
A simple bridge class to run grunt from within Composer Shamelessly copied from https://github.com/eloquent/composer-npm-bridge
<?php
namespace SOG\Composer;
use Symfony\Component\Process\ExecutableFinder;
use Symfony\Component\Process\Process;
use Symfony\Component\Process\ProcessBuilder;
use RuntimeException;