Skip to content

Instantly share code, notes, and snippets.

View ik5's full-sized avatar
🎯
Focusing

ik5 ik5

🎯
Focusing
View GitHub Profile
# run with: rvmsudo god -c /srv/phone/phonzy/current/ahn/config/god/adhearsion.god
# debug with: rvmsudo god quit && rvmsudo god -c /srv/phone/phonzy/current/ahn/config/god/adhearsion.god -D
@deploy_path = '/srv/phone/phonzy'
@shared_path = File.join @deploy_path, 'shared'
@app_path = File.join @deploy_path, 'current', 'ahn'
@log_path = File.join @shared_path, 'log'
@pid_path = File.join @shared_path, 'pids'
@pid_file = File.join @pid_path, 'adhearsion.pid'
@god_env = YAML.load_file("#{@shared_path}/config/god_environment.yml")
@ik5
ik5 / ugly :(
Last active August 29, 2015 14:09 — forked from bararchy/ugly :(
def check_s_client
server = 'Generel Settings: '
renegotiation = 'Insecure Renegotiation'.colorize(:red)
crime = 'SSL Compression Enabled <= CRIME - CVE-2012-4929'.colorize(:red)
results = %x(echo "q" | openssl s_client -host #{@server} -port #{@port} 2> /dev/null) # why ?
case results.downcase
when 'secure renegotiation is supported'
renegotiation = 'Secured Renegotiation'.colorize(:green)
when 'compression: none'
@ik5
ik5 / sshsock.rb
Last active August 29, 2015 14:10 — forked from bararchy/sshsock.rb
require 'rubygems'
require 'ffi'
module SSHSocket
extend FFI::Library
ffi_lib_flags :now, :global
ffi_lib 'libssh'
attach_function :ssh_init, [], :int
attach_function :ssh_bind_new, [], :pointer
CREATE TABLE posts (
id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(255),
title VARCHAR(255),
content VARCHAR(255),
timestamps timestamp
);
CREATE GENERATOR POSTS_SEQ;
@ik5
ik5 / exec.rb
Last active December 17, 2015 03:28 — forked from anonymous/exec.rb
Allow to execute commands using Ruby that arrives from gem and using Bundler Gemfile
$BASE_PATH = File.expand_path(File.dirname(__FILE__) + '/..')
# also find your own gem files for the executable
$LOAD_PATH.unshift($BASE_PATH + '/lib')
require 'bundler'
ENV["BUNDLE_GEMFILE"] = $BASE_PATH + '/Gemfile'
Bundler.require(:default)
@ik5
ik5 / gist:5ae5a706397b0f4e90df1101b2494f6f
Created March 12, 2019 05:34 — forked from milosgajdos/gist:9f68b1818dca886e9ae8
Add a VLAN interfaces into Docker from the host machine
package main
import (
"fmt"
"log"
"net"
"github.com/milosgajdos83/tenus"
)
@ik5
ik5 / gist:6e383127ef12b5eb1281df3948d6458f
Created March 12, 2019 05:34 — forked from milosgajdos/gist:296fb90d076f259a5b0a
Add a MAC VLAN interfaces into Docker from the host machine
package main
import (
"fmt"
"log"
"net"
"github.com/milosgajdos83/tenus"
)
@ik5
ik5 / vim_cheatsheet.md
Created April 17, 2019 16:22 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@ik5
ik5 / tmux-cheatsheet.markdown
Created June 17, 2019 05:29 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ik5
ik5 / gist:65de721ca495fa1bf451
Last active August 5, 2020 11:58 — forked from bradleypeabody/gist:185b1d7ed6c0c2ab6cec
golang, convert UTF-16 to UTF-8 string
package main
import "fmt"
import "unicode/utf16"
import "unicode/utf8"
import "bytes"
func main() {
b := []byte{