Skip to content

Instantly share code, notes, and snippets.

@TrevorS
TrevorS / vagrant-up.log
Created November 8, 2013 21:10
The vagrant up that failed to correctly resume.
INFO global: Vagrant version: 1.3.5
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/help/plugin.rb
INFO manager: Registered plugin: help command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/init/plugin.rb
@TrevorS
TrevorS / BenchmarkSortingStrings.java
Created November 14, 2013 21:07
Benchmarking sorting Strings vs Longs.
package benchmarks;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class BenchmarkSortingStrings{
@TrevorS
TrevorS / BenchmarkSortingCollections.java
Last active December 28, 2015 08:49
Benchmarking Sorting collections (ArrayList vs TreeSet).
package benchmarks;
import java.util.*;
public class BenchmarkSortingCollections {
private static Random random = new Random();
private static long START = 0;
private static long END = 50000000000000L;
private static int MAX_SIZE = 1000000;
#!/bin/env ruby
require 'net/sftp'
# Settings
@feed = 'Commnet GGSN Pull'
@host = '127.0.0.1'
@user = 'username'
@password = 'password'
@root = '/path/to/root/directory'
@input = "#{@root}/.auto/onboard/hd-raid/records/cdr/mediation215"
@TrevorS
TrevorS / correcting_clock.sh
Last active January 2, 2016 21:29
Setting the timezone and correcting the time on a RHEL server. Example uses MTD timezone.
# Set the timezone in the system configuration.
sudo vim /etc/sysconfig/clock
# Symlink the correct timezone (in this case MDT) into /etc/localtime
sudo ln -sf /usr/share/zoneinfo/America/Denver /etc/localtime
# Correct the date/time using ntpdate.
sudo ntpdate 0.north-america.pool.ntp.org
# Make sure ntpd is running.
sudo service ntpd restart
# Configure ntpd to run at boot-up.
sudo chkconfig ntpd on
public class Test {
public static void main(String[] args) {
// Primitives
int a = 10;
int b = 10;
System.out.println("a: " + a); // 10
System.out.println("b: " + b); // 10
System.out.println("a == b: " + (a == b)); // true
Compiled from "Test.java"
public class Test {
public Test();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String[]);
Code:
@TrevorS
TrevorS / steve_on_jobs.txt
Created January 21, 2014 19:52
Steve Wozniak on Jobs
Steve WozniakAug 19, 2013+270898
Actually, the movie was largely a lie about me. I was an engineer at HP designing the iPhone 5 of the time, their scientific calculators. I had many friends and a good reputation there. I designed things for people all over the country, for fun, all the time too, including the first hotel movie systems and SMPTE time code readers for the commercial video world. Also home pinball games. Among these things, the Apple I was the FIFTH time that something I had created (not built from someone else's schematic) was turned into money by Jobs. My Pong game got him his job at Atari but he never was an engineer or programmer. I was a regular member at the Homebrew Computer Club from day one and Jobs didn't know it existed. He was up in Oregon then. I'd take my designs to the meetings and demonstrate them and I had a big following. I wasn't some guy nobody talked to, although I was shy in social settings. i gave that computer design away for free to help people who were espousing the t
@TrevorS
TrevorS / resque.rake
Created February 27, 2014 16:24
Add Resque and Resque scheduler rake tasks.
require 'resque/tasks'
require 'resque_scheduler/tasks'
def run_worker(queue, count = 1)
puts "Starting #{count} Resque worker(s) with QUEUE: #{queue}."
ops = { pgroup: true, err: [Rails.root.join('log', 'workers_error.log'), 'a'],
out: [Rails.root.join('log', 'workers.log'), 'a']}
env_vars = { 'QUEUE' => queue.to_s }
count.times do
SCRIPT /home/vagrant/.vim/bundle/syntastic/plugin/syntastic/autoloclist.vim
Sourced 2 times
Total time: 0.000126
Self time: 0.000126
count total (s) self (s)
if exists("g:loaded_syntastic_notifier_autoloclist") || !exists("g:loaded_syntastic_plugin")
1 0.000001 finish
endif
1 0.000004 let g:loaded_syntastic_notifier_autoloclist = 1