Skip to content

Instantly share code, notes, and snippets.

View trinitronx's full-sized avatar
⛩️
Zazen

James Cuzella trinitronx

⛩️
Zazen
View GitHub Profile
@trinitronx
trinitronx / truecrypt_fix.bash
Last active April 27, 2023 15:45 — forked from jimjh/truecrypt_fix.bash
Fixes annoying brew doctor messages caused by Truecrypt
#!/bin/bash
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i64.2.dylib" \
"/usr/local/lib/libmacfuse_i64.2.dylib" \
"/usr/local/lib/libosxfuse_i32.la" \
"/usr/local/lib/libosxfuse_i64.la" \
"/usr/local/lib/pkgconfig/osxfuse.pc" )
@trinitronx
trinitronx / brew-p11-kit-error.out
Created April 23, 2013 00:03
Failed Homebrew build for p11-kit. Test fails: p11-kit: p11-kit initialization called recursively /bin/sh: line 1: 34495 Segmentation fault: 11 ${dir}$tst FAIL: test-init
○ → brew install -vd p11-kit
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/p11-kit.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/pkg-config.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/libtasn1.rb
/usr/local/Library/Formula/p11-kit.rb: loading /usr/local/Library/Formula/pkg-config.rb
/usr/local/Library/Formula/p11-kit.rb: loading /usr/local/Library/Formula/libtasn1.rb
/usr/local/Library/Formula/p11-kit.rb: loading /usr/local/Library/Formula/python.rb
==> Downloading http://p11-glue.freedesktop.org/releases/p11-kit-0.18.1.tar.gz
/usr/bin/curl -f#LA Homebrew 0.9.4 (Ruby 1.8.7-358; Mac OS X 10.8.3) http://p11-glue.freedesktop.org/releases/p11-kit-0.18.1.tar.gz -C 0 -o /Library/Caches/Homebrew/p11-kit-0.18.1.tar.gz.incomplete
######################################################################## 100.0%
Recipe: <Dynamically Defined Resource>
* remote_file[/var/chef/cache/ACCC4CF8.asc] action create
- Would copy file downloaded from [] into /var/chef/cache/ACCC4CF8.asc
--- /tmp/chef-tempfile20130426-16657-vgle2m 2013-04-26 19:32:36.000000000 +0000
+++ /tmp/chef-rest20130426-16657-nrwuun 2013-04-26 19:32:36.000000000 +0000
@@ -0,0 +1,42 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
describe "a simple RSpec matcher" do
true.should be_true
end
@trinitronx
trinitronx / matcher_reference_spec.rb
Created May 15, 2013 16:58
Common RSpec matcher cheatsheet
# Just a nice quick example reference of some common RSpec matchers
# References:
# https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
# http://rspec.rubyforge.org/rspec/1.1.9/classes/Spec/Matchers.html
describe "a simple RSpec matcher" do
it "should do Object Identity comparison" do
3.should be(3)
this = Array.new([1,2,3])
this.should be this
#!/usr/bin/env ruby
# encoding: utf-8
require 'rubygems'
require 'net/http'
require 'net/ping/tcp'
require 'pp'
mirrorlist_host = 'mirrors.ubuntu.com'
timeout=0.05
@trinitronx
trinitronx / mirror_filter.rb
Last active December 17, 2015 10:18
A simple script to find the fastest mirrors from ubuntu's mirrors.txt
#!/usr/bin/env ruby
# encoding: utf-8
require 'rubygems'
require 'net/http'
require 'net/ping/tcp'
# This script grabs the master mirror list file from mirrors.ubuntu.com
# And then attempts to find the fastest subset of them and writes it out to a file
# This is intended to be used with the apt mirrors method in order to get the fastest
1) cacti::server includes another_recipe
Failure/Error: chef_run.converge described_recipe
NameError:
undefined local variable or method `use_inline_resources' for #<Class:0x007ffebda870a0>
# /Users/jcuzella/src/pub/cookbooks/apt/providers/repository.rb:20:in `class_from_file'
# ./spec/cacti_server_spec.rb:6:in `block (2 levels) in <top (required)>'
@trinitronx
trinitronx / du_hsort.sh
Created June 4, 2013 21:22
Script to sort disk usage output by size
#!/bin/bash
# This line sorts first according to numerical size in bytes
# the second pass through du in the while loop converts to human readable
# format
du -s * | sort -n | cut -f 2- | while read a; do du -hs "$a"; done
ls -lR cookbooks/chef-solo-search/libraries/
total 8
drwxr-xr-x 4 jcuzella staff 136 Jun 5 15:21 search
-rw-r--r-- 1 jcuzella staff 2163 Jun 7 08:55 search.rb
drwxr-xr-x 3 jcuzella staff 102 Jun 5 15:21 vendor
cookbooks/chef-solo-search/libraries//search:
total 24
-rw-r--r-- 1 jcuzella staff 3083 Jun 5 15:21 overrides.rb
-rw-r--r-- 1 jcuzella staff 5513 Jun 5 15:21 parser.rb