Skip to content

Instantly share code, notes, and snippets.

View navaneeth's full-sized avatar

Navaneeth.K.N navaneeth

View GitHub Profile
@navaneeth
navaneeth / rename_keyspace.rb
Created September 8, 2017 05:34
Rename cassandra keyspace
require 'fileutils'
require 'tmpdir'
require 'optparse'
options = {}
OptionParser.new do |opts|
opts.banner = "usage: rename_keyspace --from <current-name> --to <new-name>"
opts.on("--from=name", "Current keyspace name") do |name|

Keybase proof

I hereby claim:

  • I am navaneeth on github.
  • I am navaneethkn (https://keybase.io/navaneethkn) on keybase.
  • I have a public key ASA40VMS5sQ8fGLDr4nJEIc3yfX7lrlH9Hz1ftKCHC1S9Ao

To claim this, I am signing this object:

@navaneeth
navaneeth / fork.rb
Created October 1, 2013 08:24
JRuby Fork implementation
require 'ffi'
module Exec
extend FFI::Library
ffi_lib FFI::Library::LIBC
attach_function :fork, [], :int
end
def fork
pid = Exec.fork
if pid == 0
@navaneeth
navaneeth / cs.js
Created January 16, 2013 05:38
Firefox addon-sdk - document.activeElement not available on some pages
(function() {
self.port.on('init', init);
function init(data) {
var active = document.activeElement;
if (!active) {
console.log("Failed to get activeElement");
}
if (active != document.body) {
@navaneeth
navaneeth / binding.gyp
Created September 2, 2012 06:17
libuv mutex failures
{
"targets": [
{
"target_name": "mutextest",
'type': '<(library)',
"sources": [ "mutex-test.cc" ]
}
]
}
@navaneeth
navaneeth / gist:3294356
Created August 8, 2012 11:22
Transliterating using varnamc
$ ./varnamc --symbols ml --transliterate malayalam
@navaneeth
navaneeth / gist:3294352
Created August 8, 2012 11:21
varnamrc usage
$ ./varnamc -h
Usage: varnamc [options] language_code args
-l, --library FILE Sets the varnam library
-v, --verbose Enable verbose output
-t, --transliterate TEXT Transliterate the given text
-r, --reverse-transliterate TEXT Reverse transliterate the given text
-n, --learn [TEXT] Learn given text. Use --files option together with this to learn from file
-f, --files files Reads from the specified files
-s, --symbols VALUE Sets the symbols file
-c, --compile FILE Compile symbols file