Skip to content

Instantly share code, notes, and snippets.

@ruseel
ruseel / gist:9207538
Created February 25, 2014 11:54
find src from html
cat /dev/clipboard | ruby -n -e 'puts $1 if /img src="([^"]*)"/ =~ $_'
@ruseel
ruseel / gist:11206421
Created April 23, 2014 08:05
StrictHostKeyChecking no
ssh -o "StrictHostKeyChecking no" user@host
(apply str (repeatedly 8 #(randchar "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")))
@ruseel
ruseel / gist:a814f7b89260f3b7ac26
Last active August 29, 2015 14:03
hadoop snappy UnsatisfiedLinkError

Hadoop에서 이런 에러를 만났습니다. 검색해도 딱히 나오는 것이 없습니다. 있습니다만 별다른 답이 없는 듯 합니다.

http://stackoverflow.com/questions/22150417/hadoop-mapreduce-java-lang-unsatisfiedlinkerror-org-apache-hadoop-util-nativec

똑같은 에러를 만났는데 해결못했습니다.

"hadoop snappy"로 검색해보면 이런 저런 글들이 많은데 참으로 혼란스럽습니다. google의 snappy를 설치하라고 하는 듯 하기도 하고 hadoop-snappy를 설치하라는 듯 하기도 하고 "hadoop common"에 integration되서 이제 필요없는 듯 하기도 합니다.

그래서 저는 OSX 10.9에 cdh4.6.0을 압축을 풀어 설치하고 난 후에 대체 어찌해야 하는 걸까요?

@ruseel
ruseel / gist:f64448ed92cb45086d1b
Created July 29, 2014 08:28
parse ISO8601 with clj-time
(require '[clj-time.format :as f])
(def x "2014-07-01T14:01:03+09:00")
(f/parse x)
(f/parse (f/formatters :date-time-no-ms) x)
;; incanter
(use '(incanter core stats charts))
;; require clj-time to use f/parse
(alembic.still/distill '[clj-time])
(require '[clj-time.format :as f])
;; read dataset x.csv
(def r (read-dataset "x.csv" :header true))
sudo mount -t vboxsf -o rw,uid=500,gid=500 Downloads ~/mnt
@ruseel
ruseel / echo-server.clj
Created September 10, 2014 11:58
echo-server.clj
(ns w.clj
(:require [clojure.java.io :as io])
(:import [java.net ServerSocket]
[java.lang Integer])
(:gen-class))
(defn -main
"echo server"
[port & args]
(let [ss (new ServerSocket (Integer/parseInt port))]
@ruseel
ruseel / gist:13b0741c42dc6a5093e7
Created September 22, 2014 05:16
set vim in Cloudera VM
sudo update-alternatives --config vim
git config --global core.editor "vim"
namespace :sidekiq do
def assert_process_running(pid)
begin
if pid == Process.waitpid(pid, Process::WNOHANG) then
raise "process killed"
end
end
puts "alive"
end