Skip to content

Instantly share code, notes, and snippets.

View krzysztofjablonski's full-sized avatar

Krzysztof Jablonski krzysztofjablonski

  • Siepomaga.pl
  • Poznań
View GitHub Profile
@davidpaulhunt
davidpaulhunt / excon_openssl.md
Last active November 6, 2016 09:20
Unable to verify certificate fix re: excon, openssl, and fog

Ran into the excon/openssl error certificate verify failed (OpenSSL::SSL::SSLError) Unable to verify certificate.

After reading through a few posts, trying different solutions, here are the steps that resolved the issue with regards to my particular needs. Final main source at the bottom.

brew doctor
brew update openssl

rvm get stable
rvm install ruby-2.1.9 --with-openssl-dir=`brew --prefix openssl`
@pcreux
pcreux / Gemfile
Last active December 11, 2023 20:24
Fast Rails + Heroku Configuration
group :production do
gem 'unicorn'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
end
@krzysztofjablonski
krzysztofjablonski / gist:5700562
Last active December 18, 2015 00:59 — forked from kurisuchan/gist:1262135
Ramdisk for mysql
# Tweaked from http://tomislavsantek.iz.hr/2011/03/moving-mysql-databases-to-ramdisk-in-ubuntu-linux
# Log in as root
# Mount ramdisk folder in RAM
mkdir /tmp/ramdisk
mount -t tmpfs -o size=128M tmpfs /tmp/ramdisk/
# Move MySQL data
mv /var/lib/mysql /tmp/ramdisk/mysql
ln -s /tmp/ramdisk/mysql/ /var/lib/mysql
@ruliana
ruliana / bootstrap-chef-solo.sh
Last active December 14, 2015 11:28
Bootstrap Chef Solo for Ruby-2.0.0-p0 (run it with "sudo" because it installs ruby in "/usr/local")
#!/usr/bin/env bash
# Pre-requisites
apt-get -y update
sudo apt-get --no-install-recommends -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev
# Download and compile Ruby 2.0.0-p0
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xvzf ruby-2.0.0-p0.tar.gz
@krzysztofjablonski
krzysztofjablonski / run.sh
Last active October 4, 2015 06:38
Chef runner
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev git-core
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xvzf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0/
./configure --prefix=/usr/local
make
make install
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@krzysztofjablonski
krzysztofjablonski / regex.irb
Created March 1, 2012 15:06 — forked from fguillen/regex.irb
Non Greedy Regex match
# By default ReGex will match the bigest occurrence:
ruby-1.9.2-p180 > "_one_ two _three_".scan(/_(.+)_/)
=> [["one_ two _three"]]
# But we can tell it to match all the smallest ones:
ruby-1.9.2-p180 > "_one_ two _three_".scan(/_(.+?)_/)
=> [["one"], ["three"]]
@kurisuchan
kurisuchan / gist:1262135
Created October 4, 2011 16:43
Moving MySQL databases to ramdisk on Ubuntu
# Tweaked from http://tomislavsantek.iz.hr/2011/03/moving-mysql-databases-to-ramdisk-in-ubuntu-linux
# Log in as root
# Mount ramdisk folder in RAM
mkdir /tmp/ramdisk
mount -t tmpfs -o size=128M tmpfs /tmp/ramdisk/
# Move MySQL data
mv /var/lib/mysql /tmp/ramdisk/mysql
ln -s /tmp/ramdisk/mysql/ /var/lib/mysql