Skip to content

Instantly share code, notes, and snippets.


Vangelis Typaldos vtypal

  • Greece
View GitHub Profile
View Install 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
4. Install bundle
gem23 install --user-install bundler
5. Install nokogiri (or run into problems installing rails)
View pdf2text.rb
require 'rake'
require 'logger'
require 'pdf-reader'
# [1] Create a new directory and copy pdf2txt.rb in this directory.
# [2] Insert also your pdf files in this directory.
# For every pdf file in this directory, this script will create a new textfile extracting the text from your original pdf file.
# File paths nad Log paths
View gist:8416009
# Get Root
sudo su
# Download NMON archive
cd /tmp
# Install unzip if you don't have
yum install unzip
vtypal / gist:7375445
Last active Dec 27, 2015
DATA stream example
View gist:7375445
#!/usr/bin/env ruby -w
require 'date'
pos = DATA.pos"%d")
if cday == pday
count = ddata.split(";")[1].to_i
vtypal / win32-install.rb
Created Sep 24, 2013
Modified install.rb for installing Diakonos editor on WIndows
View win32-install.rb
#!/usr/bin/env ruby
require './lib/diakonos/version.rb'
require 'fileutils'
require 'pp'
require 'rbconfig'
module Diakonos
class Installer
View C#.sublime-build
// 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"
View request.rb
require 'json'
require 'net/http'
require 'net/https'
module MEGA
class Request
EAGAIN = '-3'
API_URL = ''
@@counter = rand(0x100000000)
vtypal / gist:4731080
Created Feb 7, 2013
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
View gist:4731080
C:\Users\vtypal\GitHub\MEGA.rb [master +0 ~2 -0]> ruby .\client.rb
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:799:in `connect': SSL_connect returned=1 e
rrno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
from C:/Ruby193/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from C:/Ruby193/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:799:in `connect'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:744:in `start'
vtypal / haproxy.cfg
Created Nov 16, 2012 — forked from krams915/haproxy.cfg
haproxy.cfg - Notes
View haproxy.cfg
log local0
log 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 / gist:4086922
Created Nov 16, 2012 — forked from haiyun-document/gist:2364000
sample haproxy.cfg
View gist:4086922
log local0 notice
maxconn 50000
stats socket /tmp/proxystats level admin
log global
mode http
option httplog
option dontlognull
You can’t perform that action at this time.