Skip to content

Instantly share code, notes, and snippets.

View threez's full-sized avatar

threez

  • IONOS SE
  • Karlsruhe, Germany
View GitHub Profile
@threez
threez / exim.rb
Last active December 20, 2015 16:09
Simple rspec prototype on how to test exim with rspec
require 'spec_helper'
describe 'Exim Config' do
let!(:exim) { exim_server(config) }
context 'simple config' do
let!(:relay) { mail_server(:y) }
let(:config) { exim_config(:simple) }
let(:mail_x) { mail_fixture(:mail_x) }
@threez
threez / client.rb
Created July 24, 2013 06:33
Show that localhost can resolve to ::1 on MacOSX systems. Proven, if the client doesn't raise an error.
require 'drb/drb'
p DRb.start_service("druby://localhost:0")
server = DRbObject.new_with_uri("druby://::1:5000")
p server
p server.foo
@threez
threez / fstab.rb
Created June 3, 2013 21:11
Ruby fstab ffi implementation for unix (mac os x / bsd)
require "ffi"
module Mount
class Fstab < FFI::Struct
layout :fs_spec, :string, # block special device name
:fs_file, :string, # file system path prefix
:fs_vfstype, :string, # File system type, ufs, nfs
:fs_mntops, :string, # Mount options ala -o
:fs_type, :string, # FSTAB_* from fs_mntops
:fs_freq, :int, # dump frequency, in days
@threez
threez / psdb.rb
Created November 5, 2012 22:02
This is a small journaling multi process aware database for counting choises
require "fileutils"
# === PSDB Packed Stats Database
#
# This is a small journaling multi process aware database for counting choises.
#
# === Authors
# * dpree
# * threez
class PSDB
@threez
threez / backup_git_repos.sh
Created September 9, 2012 09:08 — forked from r10r/backup_git_repos.sh
Github backup script
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
require 'fileutils'
require 'net/smtp'
require 'net/https'
require 'uri'
BACKUP_DIR='/srv/git/repositories'
@threez
threez / dcron.rb
Created July 23, 2012 21:46
Disibuted CRON?!
# Job, Desc, Interval, Tick, updated_at
class Job
attr_reader :name
attr_accessor :task, :working
def initialize(name, interval, offset)
@name = name
@interval = interval
@offset = offset
@threez
threez / ibrute.rb
Created June 13, 2012 11:06
Bruteforce an istatd password using the istat gem
#!/usr/bin/env ruby
require "rubygems"
require "istat"
require "logger"
logger = Logger.new(STDOUT)
class Istat::Client
attr_accessor :passwd
end
@threez
threez / jruby.rake
Created April 25, 2012 18:27
A rake task to help provisioning jruby based deployments
#
# PROVISIONING OF JRUBY BASED DEPLOYMENTS
#
# Copyright (c) 2012 Vincent Landgraf
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@threez
threez / hello.cpp
Created June 30, 2011 19:52
A simple example to show cpp to my friends ;-)
#include <iostream>
template <typename MsgType>
class Greeting {
private:
MsgType m_pre;
MsgType m_post;
public:
Greeting(MsgType pre)
@threez
threez / PKGBUILD
Created May 15, 2011 19:10
istatd package description for arch linux
# Maintainer: Vincent Landgraf <vilandgr+github(at)googlemail(dot)com>
pkgname=istatd
pkgver=0.5.7
pkgrel=2
pkgdesc="Serving statistics to the iStat iPhone application from Linux, Solaris and FreeBSD."
url="https://github.com/tiwilliam/istatd"
arch=('x86_64' 'i686')
license=('MIT')
depends=('libxml2')
optdepends=()