Skip to content

Instantly share code, notes, and snippets.

View ksauzz's full-sized avatar

Kazuhiro Suzuki ksauzz

View GitHub Profile
@ksauzz
ksauzz / installing-jmx4perl.md
Created April 14, 2014 10:49
Installing jmx4perl
wget http://search.cpan.org/CPAN/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.01080605.tar.gz
wget http://pari.math.u-bordeaux.fr/pub/pari/unix/OLD/2.3/pari-2.3.5.tar.gz
tar -zxvf Math-Pari-2.01080605.tar.gz
tar -zxvf pari-2.3.5.tgz
cd Math-Pari-2.01080605
vim Makefile.PL
##Line 9: Change to $paridir = "../pari-2.3.5";
perl Makefile.PL
cpanm .
#### Contents of the preconfiguration file (for squeeze)
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string NL
#d-i debian-installer/locale string en_GB.UTF-8
# Optionally specify additional locales to be generated.
LoadPlugin "exec"
<Plugin "exec">
Exec "haproxy:haproxy" "/usr/local/bin/haproxy-stats" "-p" "10"
</Plugin>
@ksauzz
ksauzz / building-mesos-on-osx-10.9.5.md
Last active August 29, 2015 14:26
Building Mesos from source on OS X 10.9.5.

My homebew is installed into /usr/local/homebrew.

Install gcc-4.8

brew install gcc48

cd /usr/local/bin
rm cc gcc c++ g++
ln -s /usr/local/bin/gcc-4.8 cc
@ksauzz
ksauzz / sleep_sort.erl
Created July 9, 2011 05:46
sleep sort by erlang.
-module(sleep_sort).
-export([sort/1, wait/1]).
sort([]) ->
"sleep sort!!";
sort([H|T]) ->
spawn(sleep, wait, [H]),
sort(T).
wait(Time) ->
@ksauzz
ksauzz / pom.xml
Created July 26, 2011 03:18
pom.xml assembly sample. The assembled package includes dependencies and sources.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId></groupId>
<artifactId></artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name></name>
<url></url>
@ksauzz
ksauzz / IP Address to localhost
Created August 10, 2011 05:17
ファイル内のIPアドレスをlocalhostへ一括変換
gsed -i -r 's/([0-9]{1,3}\.){3}[0-9]{1,3}/localhost/' *
@ksauzz
ksauzz / ex.erl
Created August 19, 2011 14:53
お題:文字列を先頭から見て同じところまで除去 http://bit.ly/oby7HE
-module(ex).
-export([drop_starts_same/1]).
drop_starts_same([HList|[]]) ->
[HList];
drop_starts_same(NestedList) ->
ShortList=lists:last(lists:sort(fun(A, B)->length(A)>length(B)end, NestedList)),
MatchCnt=lists:min(lists:map(fun(X)->match_count(ShortList, X) end, NestedList)),
lists:map(fun(Y)-> lists:sublist(Y, MatchCnt+1, length(Y)-MatchCnt) end, NestedList).
@ksauzz
ksauzz / createpdf.py.diff
Created August 28, 2011 13:20
rst2pdfの日本語化で弄ったファイル
--- createpdf.py.org 2011-08-28 22:07:46.000000000 +0900
+++ createpdf.py 2011-08-28 21:37:18.000000000 +0900
@@ -166,11 +166,11 @@
self.basedir=basedir
self.language = language
try:
- get_language (self.language)
+ get_language (self.language, None)
except ImportError:
try:
@ksauzz
ksauzz / homework01.hs
Created September 5, 2011 11:25
第一回スタートhaskell 宿題
-- Start Haskell 01 -- Homework : http://groups.google.com/group/start-haskell/browse_thread/thread/57aeccfd1073ca6
-- problem 1
magComp :: Float -- 地震1のマグニチュード
-> Float -- 地震2のマグニチュード
-> Float -- 地震1が何倍強い
magComp x y = (magCulc x) / (magCulc y)
magCulc :: Float -> Float
magCulc m = 10 ** (4.8 + 1.5 * m)