Skip to content

Instantly share code, notes, and snippets.

View tagrudev's full-sized avatar

Todor Grudev tagrudev

View GitHub Profile
@tagrudev
tagrudev / gist:1404157
Created November 29, 2011 09:28
Adding nvm support for zsh
vim .zshrc
#Adding nvm on loading
source ~/.nvm/nvm.sh
@tagrudev
tagrudev / gist:2006185
Created March 9, 2012 11:39
irssi configuration
Themes -> download *.theme file -> put it in ~/.irssi
Load the them by /SET theme THEME_NAME
#Auto channel stick off
/SET autostick_split_windows OFF
#Disable automatic window closing when /PARTing channel or /UNQUERYing query:
/SET autoclose_windows OFF
/SET reuse_unused_windows ON
@tagrudev
tagrudev / gist:2419453
Created April 19, 2012 07:42
Editing Android hosts file
# You need an emulator running
adb remount
# this will get the current host file
adb pull /system/etc/host .
# open it and edit it as you wish
# then push it
@tagrudev
tagrudev / gist:2426656
Created April 20, 2012 06:49
My sublime shortcuts
#Shortcuts on ubuntu submlime
# Multi edit
ctr + shift + L
#select a word and then
ctr + D - gets the next occurrence
alt + F3 - get all the words
# runs a commnad pallete
@tagrudev
tagrudev / gist:2970755
Created June 22, 2012 06:20
Installing working ruby + rails env on 12.04
Ubuntu 12.04 Ruby on Rails Development Environment
I haven't set up an install guide for the latest ubuntu release, largely because the last set of instructions worked pretty closely with the latest and greatest Ubuntu, 12.04 Precise Pangolin, however when installing today, I found that there were enough differences in the way that I configure my setup to justify an update, so here it goes. Yes, I'm late to the party, but a quick google search didn't find anything that I felt was as complete for my requirements as my previous install guides, so here I go.
As always with my install guides, I have included here is just about everything you'll need (and then some) to get started with ruby on rails development with Ubuntu 12.04 as a platform. These are my settings and preferences, and this is certainly not the only way of doing things, so keep that in mind.
Step 1: Get the repos ready and run updates.
sudo apt-get update && sudo apt-get upgrade
@tagrudev
tagrudev / gist:3698101
Created September 11, 2012 12:35
socket.io
tagrudev:socket.io-java-client/ (master) $ sudo ant jar [15:33:26]
Buildfile: /home/tagrudev/Code/socket.io-java-client/build.xml
init:
build-project:
[echo] socket.io-java-client: /home/tagrudev/Code/socket.io-java-client/build.xml
[javac] /home/tagrudev/Code/socket.io-java-client/build.xml:40: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 9 source files to /home/tagrudev/Code/socket.io-java-client/bin
[javac] /home/tagrudev/Code/socket.io-java-client/src/io/socket/WebsocketTransport.java:11: package org.java_websocket.client does not exist
tagrudev:socket.io-java-client/ (master) $ ant jar [10:08:32]
Buildfile: /home/tagrudev/Code/socket.io-java-client/build.xml
init:
build-project:
[echo] socket.io-java-client: /home/tagrudev/Code/socket.io-java-client/build.xml
[javac] /home/tagrudev/Code/socket.io-java-client/build.xml:40: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 9 source files to /home/tagrudev/Code/socket.io-java-client/bin
09-12 14:55:52.501: W/System.err(29546): Catch exception while startHandshake: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x2c1428: Failure in SSL library, usually a protocol error
09-12 14:55:52.501: W/System.err(29546): error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:683 0xad127597:0x00000000)
public void onCreate() {
Toast.makeText(getApplicationContext(), "service created", Toast.LENGTH_SHORT).show();
try {
this.socket = new SocketIO("https://mysocketserver");
SSLContext sc = SSLContext.getInstance("TLS");
sc.init(null, null, null);
SocketIO.setDefaultSSLSocketFactory(sc);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
// Making HTTP request
try {
// defaultHttpClient
HostnameVerifier hostnameVerifier = org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER;
DefaultHttpClient client = new DefaultHttpClient();
SchemeRegistry registry = new SchemeRegistry();