Skip to content

Instantly share code, notes, and snippets.

View seuros's full-sized avatar

Abdelkader Boudih seuros

  • Open Source Contributor / Time Traveller
  • Tangier, Morocco
  • X @seuross
View GitHub Profile
RUBY_GC_HEAP_FREE_SLOTS=600000
RUBY_GC_HEAP_GROWTH_FACTOR=1.25
RUBY_GC_HEAP_GROWTH_MAX_SLOTS=300000
RUBY_GC_HEAP_INIT_SLOTS=600000
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.3
RUBY_GC_MALLOC_LIMIT=64000000
RUBY_GC_OLDMALLOC_LIMIT=64000000
RUBY_HEAP_FREE_MIN=12500
RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
RUBY_HEAP_SLOTS_INCREMENT=100000
@seuros
seuros / sample.ovpn
Created March 20, 2014 19:25
Sample OpenVPN client config
client
dev tun
proto tcp
remote 192.168.1.1 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca [inline]
cert [inline]
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_objects import RGBColor
import argparse
import math
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
# Code loops around each of the windows
# that the current user has open and switches
# focus to each of them in rotation... 100 times.
100.times do |x|
windows = client.extapi.window.enumerate
windows.each do |winder|
if winder[:title] != 'Default IME'
result = client.railgun.user32.SetForegroundWindow(winder[:handle])
end
@seuros
seuros / bad unaccent
Last active January 1, 2016 12:39 — forked from thb/bad unaccent
class String
UNACCENT_HASH = {
'A' => 'ÀÁÂÃÄÅĀĂǍẠẢẤẦẨẪẬẮẰẲẴẶǺĄ',
'a' => 'àáâãäåāăǎạảấầẩẫậắằẳẵặǻą',
'C' => 'ÇĆĈĊČ',
'c' => 'çćĉċč',
'D' => 'ÐĎĐ',
'd' => 'ďđ',
'E' => 'ÈÉÊËĒĔĖĘĚẸẺẼẾỀỂỄỆ',
'e' => 'èéêëēĕėęěẹẻẽếềểễệ',
##!/bin/bash
USER=teamcity
INSTALL=/home/$USER/BuildAgent
INSTANCE=1
# -------------
SCRIPT=$INSTALL/bin/agent.sh
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto
@seuros
seuros / openvpn.md
Last active December 20, 2015 16:09 — forked from padde/openvpn.md

OpenVPN on Ubuntu 12.10 at DigitalOcean

Install OpenVPN

sudo apt-get install openvpn

Generate Server Certificates

sudo cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn/easy-rsa2

cd /etc/openvpn/easy-rsa2