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)
require 'rake'
require 'logger'
require 'pdf-reader'
#Usage
# [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
# 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
@vtypal
vtypal / gist:7375445
Last active December 27, 2015 19:09
DATA stream example
#!/usr/bin/env ruby -w
require 'date'
pos = DATA.pos
cday=DateTime.now.strftime("%d")
ddata=DATA.readline.to_s
pday=ddata.split(";")[0]
if cday == pday
count = ddata.split(";")[1].to_i
@vtypal
vtypal / win32-install.rb
Created September 24, 2013 04:38
Modified install.rb for installing Diakonos editor on WIndows
#!/usr/bin/env ruby
require './lib/diakonos/version.rb'
require 'fileutils'
require 'pp'
require 'rbconfig'
module Diakonos
class Installer
{
// 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"
}
require 'json'
require 'net/http'
require 'net/https'
module MEGA
class Request
EAGAIN = '-3'
API_URL = 'https://eu.api.mega.co.nz/cs'
@@counter = rand(0x100000000)
@vtypal
vtypal / gist:4731080
Created February 7, 2013 13:59
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
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
::SSL::SSLError)
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
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