Skip to content

Instantly share code, notes, and snippets.

View releu's full-sized avatar
🕶️
I may be slow to respond.

Jan Bernacki releu

🕶️
I may be slow to respond.
View GitHub Profile
@releu
releu / Gemfile
Created March 22, 2012 06:17 — forked from krisleech/README.md
State Validator for ActiveModel
source 'http://rubygems.org'
gem 'activemodel', '>= 3.0.0', :require => 'active_model'
gem 'state_machine', '>= 1.0.0'
gem 'rspec', '~> 2.8.0'
@releu
releu / gist:2169237
Created March 23, 2012 10:11 — forked from vadv/gist:1725277
munin resque
#!/usr/bin/env ruby
require 'rubygems'
require 'resque'
require 'resque-cleaner'
HOST = ENV['host'] ||= 'db1.kupikupon.ru'
PORT = ENV['port'] ||= '6379'
Resque.redis = [HOST, PORT].join(':')
@releu
releu / mailer_spec.rb
Created April 26, 2012 15:40 — forked from thechrisoshow/mailer_spec.rb
Testing email delivery in Rails 3
it 'should send confirmation email' do
review = build(:review)
mailer = mock; mailer.should_receive(:deliver)
ReviewMailer.should_receive(:confirmation).with(review).and_return(mailer)
review.save
end
@releu
releu / sqlite2pg.sh
Created May 26, 2012 05:30 — forked from eclubb/sqlite2pg.sh
Script to import SQLite3 database into PostgreSQL
#!/bin/sh
# This script will migrate schema and data from a SQLite3 database to PostgreSQL.
# Schema translation based on http://stackoverflow.com/a/4581921/1303625.
# Some column types are not handled (e.g blobs).
SQLITE_DB_PATH=$1
PG_DB_NAME=$2
PG_USER_NAME=$3
@releu
releu / mountainlion.sh
Created July 25, 2012 11:59 — forked from AriX/mountainlion.sh
Script to check for Mac OS X 10.8 Mountain Lion
#!/bin/bash
while true; do
if curl -silent -A "iMacAppStore/1.0.1 (Macintosh; U; Intel Mac OS X 10.6.7; en) AppleWebKit/533.20.25" 'http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewMultiRoom?fcId=489264329&mt=12&s=143461' | grep -i "mountain lion" ; then
echo "Hello, Kitty"
say "MOUNTAIN LION IS AVAILABLE"
break
else
echo "Nope"
fi
sleep 120
@releu
releu / es.sh
Created December 2, 2012 07:03
Install ElasticSearch on Ubuntu 12.04
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.11.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
Gem::Specification.new do |s|
s.name = 'openssh-key-checker'
s.version = '0.1.0'
s.platform = Gem::Platform::RUBY
s.author = 'Jan Bernacki'
s.email = '[email protected]'
s.summary = 'OpenSSH checker'
s.description = 'OpenSSH checker with system tools'
s.files = ['openssh-key-checker.rb']