Skip to content

Instantly share code, notes, and snippets.

@karnauskas
karnauskas / gist.rb
Created November 27, 2012 15:41 — forked from mbj/gist.rb
Poor mans RA with dm-1
class Foo
property :id, Seriaal
property :name, STring
has n, :bar
# Enumerate bar with name
#
# @return [self]
# if block given
#
@karnauskas
karnauskas / gist:4371306
Created December 25, 2012 01:39
broken vagrant package @ Fedora17
# yum localinstall vagrant_x86_64.rpm
Loaded plugins: langpacks, presto, refresh-packagekit
Examining vagrant_x86_64.rpm: 1:vagrant-1.0.6-1.x86_64
Marking vagrant_x86_64.rpm as an update to vagrant-1.0.5-1.x86_64
Resolving Dependencies
--> Running transaction check
---> Package vagrant.x86_64 0:1.0.5-1 will be updated
---> Package vagrant.x86_64 1:1.0.6-1 will be an update
--> Finished Dependency Resolution
#!/usr/bin/env ruby
# quick and dirty thin init script
#
# path for thin
thin = "/home/someuser/.rvm/gems/ruby-1.8.7-p72@global/bin/thin"
config = "config/config.ru"
# which dir to run from
path = "/srv/thisapp"
$ irb --version
irb 0.9.6(09/06/30)
$ ruby --version
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
$ irb
irb(main):001:0> {'a' : 10}
SyntaxError: (irb):1: syntax error, unexpected ':', expecting tASSOC
{'a' : 10}
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "debian-wheezy"
boxes = {
:puppet => {
:hostname => "puppet.dhoppe.lan",
:ip => "192.168.56.10",
@karnauskas
karnauskas / tmuxrc
Created September 3, 2013 13:13 — forked from eculver/tmuxrc
# command prefix (like screen)
set -g prefix C-a
bind C-a send-prefix
# basic settings
set-window-option -g mode-keys vi # vi key
set-option -g status-keys vi
set-window-option -g utf8 on # utf8 support
set-window-option -g mode-mouse off # disable mouse
#!/usr/bin/env python
"""
Recipe for creating and updating security groups programmatically.
"""
import collections
import boto
<opml version="1.1">
<head>
<title>NewsBlur Feeds</title>
<dateCreated>2013-05-08 14:38:06.132359</dateCreated>
<dateModified>2013-05-08 14:38:06.132359</dateModified>
</head>
<body>
<outline text="CS : Ruby" title="CS : Ruby">
<outline htmlUrl="http://afreshcup.com/home/" text="A Fresh Cup" title="A Fresh Cup" type="rss" version="RSS" xmlUrl="http://afreshcup.com/home/rss.xml"/>
<outline htmlUrl="http://ruby.awsblog.com/blog/feed/recentPosts.rss" text="AWS Ruby Blog" title="AWS Ruby Blog" type="rss" version="RSS" xmlUrl="http://ruby.awsblog.com/blog/feed/recentPosts.rss"/>
@karnauskas
karnauskas / gist:8982544
Created February 13, 2014 19:53
cookbook test
language: ruby
bundler_args: --without development integration
rvm:
- 1.9.3
- 2.0.0
before_install:
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
before_script:
- bundle exec berks install
script:
@karnauskas
karnauskas / gist:8994766
Created February 14, 2014 02:27
mock centos-6-x86_64.cfg
# coding=utf-8
config_opts['root'] = 'centos-6-x86_64'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
#config_opts['chroot_setup_cmd'] = 'groupinstall buildsys-build'
config_opts['chroot_setup_cmd'] = 'install bash bzip2 coreutils cpio diffutils findutils gawk gcc gcc-c++ grep gzip info make patch redhat-release redhat-release-server redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux-ng which xz redhat-rpm-config pkgconfig'
config_opts['dist'] = 'el6' # only useful for --resultdir variable subst
config_opts['yum.conf'] = """
[main]