Skip to content

Instantly share code, notes, and snippets.

View vtypal's full-sized avatar

Vangelis Typaldos vtypal

View GitHub Profile
@vtypal
vtypal / Install Rails on OpenBSD 5.9
Created September 8, 2018 09:27 — forked from desnudopenguino/Install Rails on OpenBSD 5.9
Setting up rails on OpenBSD 5.9
1. Install Ruby
pkg_add ruby
- I chose 2.3.0
2. Install gems
pkg_add ruby-gems
3. Add ~/.gem/ruby/2.3/bin to PATH
PATH="~/.gem/ruby/2.3/bin:"$PATH
4. Install bundle
gem23 install --user-install bundler
5. Install nokogiri (or run into problems installing rails)
# Get Root
sudo su
# Download NMON archive
cd /tmp
wget http://nmon.sourceforge.net/docs/MPG_nmon_for_Linux_14a_binaries.zip
# Install unzip if you don't have
yum install unzip
{
// This build system will build your cs file to exe file and will run it
"cmd": ["del ${file/\\.cs/\\.exe/} 2>NUL", "& csc /nologo /out:${file/\\.cs/\\.exe/} $file", "& ${file/\\.cs/\\.exe/}"],
"file_regex": "^(...*?)[(]([0-9]*),([0-9]*)[)]",
// By default csc is not in your PATH, so add it to your path
// or uncomment "path" and check that it has correct value
//"path": "C:/Windows/Microsoft.NET/Framework64/v4.0.30319/",
"shell": true, // Without this sublime has hard times to parse "&" in out command line
"selector": "source.cs"
}
@vtypal
vtypal / haproxy.cfg
Created November 16, 2012 12:28 — forked from krams915/haproxy.cfg
haproxy.cfg - Notes
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#Adds a global syslog server. Up to two global servers can be defined. They
#will receive logs for startups and exits, as well as all logs from proxies
#configured with "log global". An optional level can be specified to filter
#outgoing messages. By default, all messages are sent.
#An IPv4 address optionally followed by a colon and a UDP port. If
#no port is specified, 514 is used by default (the standard syslog port).
@vtypal
vtypal / gist:4086922
Created November 16, 2012 12:27 — forked from haiyun-document/gist:2364000
sample haproxy.cfg
global
log 127.0.0.1 local0 notice
maxconn 50000
daemon
stats socket /tmp/proxystats level admin
defaults
log global
mode http
option httplog
option dontlognull
@vtypal
vtypal / gist:3691705
Created September 10, 2012 15:55 — forked from hileon/gist:1311735
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Windows)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing

@vtypal
vtypal / kannel.conf
Created August 29, 2012 16:17 — forked from miclovich/kannel.conf
kannel (adopted from daveycrokett's kannel conf file)
#
group = core
admin-port = 13000
smsbox-port = 13001
admin-password = maw
status-password = maw
admin-allow-ip = "127.0.0.1"
log-level = 1
box-allow-ip = "*.*.*.*"
@vtypal
vtypal / sequel_multiple_unique_key.rb
Created August 21, 2012 07:56 — forked from kimoto/sequel_multiple_unique_key.rb
Ruby Sequel: Multiple Unique foreign key sample
class DailyFriendList < Sequel::Model
many_to_one :player
set_schema do
primary_key :id
foreign_key :player_id, :players
foreign_key :friend_id, :players
date :date
index [:player_id, :friend_id, :date], :unique => true
end
@vtypal
vtypal / install-sqlite.sh
Created April 11, 2012 13:32 — forked from fabrizioc1/install-sqlite.sh
Installing sqlite3 in CentOS for use with ruby-sqlite3
# The YUM package is too old for use with ruby-sqlite3, use the autoconf package from www.sqlite.org
cd /opt
wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
tar xvzf sqlite-autoconf-3070701.tar.gz
ln -s /opt/sqlite-autoconf-3070701 /opt/sqlite3
cd /opt/sqlite3
./configure --prefix=/opt/sqlite3
make
make install
# Shared library will be installed in /usr/local/lib.
@vtypal
vtypal / gist:1390410
Created November 24, 2011 01:15 — forked from tmm1/gist:329682
EM Chat Server Demo
require 'rubygems'
require 'eventmachine'
require 'em-http' # gem install em-http-request
require 'yajl' # gem install yajl-ruby
class String
def bold
"\033[1m#{self}\033[0m"
end
end