Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active April 7, 2025 13:55
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@tokuhirom
tokuhirom / DateTimeFormatterSample.java
Last active November 29, 2018 05:54
Java 8 Date And Time API - Sample code.
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
public class DateTimeFormatterSample {
public static void main(String[] args) {
String[][] patterns = new String[][]{
new String[]{"G", "appendText(ChronoField.ERA,"},
@kazeburo
kazeburo / nagios_web.psgi
Last active January 30, 2017 01:38
PSGI file to serving Nagios WebUI
use Plack::App::CGIBin;
use Plack::App::PHPCGIFile;
use Plack::Builder;
use Plack::Builder::Conditionals;
my $cgibin = Plack::App::CGIBin->new(
root => "/usr/local/nagios/sbin",
exec_cb => sub { my $file = shift; $file =~ m!\.cgi$! and -x $file },
)->to_app;
my $htdocs = Plack::App::PHPCGIFile->new(
@sh2
sh2 / tpcc_load_parallel.sh
Created August 25, 2012 02:14
Parallel load script for tpcc-mysql
#!/bin/bash
# Configration
MYSQL=/usr/bin/mysql
TPCCLOAD=./tpcc_load
TABLESQL=./create_table.sql
CONSTRAINTSQL=./add_fkey_idx.sql
DEGREE=`getconf _NPROCESSORS_ONLN`
@matope
matope / NoSQLデータモデリング技法.markdown
Created April 16, 2012 03:35
NoSQLデータモデリング技法

#NoSQLデータモデリング技法

原文:NoSQL Data Modeling Techniques « Highly Scalable Blog

I translated this article for study. contact matope[dot]ono[gmail] if any problem.

NoSQLデータベースはスケーラビリティ、パフォーマンス、一貫性といった様々な非機能要件から比較される。NoSQLのこの側面は実践と理論の両面からよく研究されている。ある種の非機能特性はNoSQLを利用する主な動機であり、NoSQLシステムによく適用されるCAP定理がそうであるように分散システムの基本的原則だからだ。一方で、NoSQLデータモデリングはあまり研究されておらず、リレーショナルデータベースに見られるようなシステマティックな理論に欠けている。本稿で、私はデータモデリングの視点からのNoSQLシステムファミリーの短い比較といくつかの共通するモデリングテクニックの要約を解説したい。

本稿をレビューして文法を清書してくれたDaniel Kirkdorfferに感謝したいと思う

@yuroyoro
yuroyoro / have_same_attributes.rb
Created January 28, 2012 12:14
have_same_attributes : RSpec用Custom Machter。ActiveRecord/ActiverResrouce/Hashなどをゆるふわくmatchさせる
# Rspec用のCustom Matcher
#
# attributesメソッドを持つオブジェクト同士やHashを再帰的にmatchさせる
#
# ActiveRecord/ActiveModel/ActiveResrouce/Hashなどをゆるふわく
# 一致するか調べる。例えば、StringとSymbolは区別しないし、[]や{}やnilは同一視する。
#
# it { should have_same_attributes(hash) }
# it { should have_same_attributes(:foo => 1,:bar => 2) }
#
Index: twitvim.vim
===================================================================
--- twitvim.vim (revision 250)
+++ twitvim.vim (working copy)
@@ -327,7 +327,9 @@
let true = 1
let false = 0
let null = ''
- sandbox let result = eval(a:str)
+ let str = iconv(a:str, "utf-8", &encoding)
function! s:BundleUpdate()
silent new __BUNDLE_UPDATE__
setlocal buftype=nofile
redraw
for rtp in pathogen#split(&rtp)
let path = expand(rtp, ':p')
if isdirectory(printf("%s/.git", path))
if &shellslash
let command = printf('cd ''%s'' && git pull', path)
else
___ _____ _ _ _
/ _ \ ___ _ __ ___ | ___(_)_ _____ __| | |
| | | |/ _ \| '_ \/ __| | |_ | \ \/ / _ \/ _` | |
| |_| | (_) | |_) \__ \_ | _| | |> < __/ (_| |_|
\___/ \___/| .__/|___(_) |_| |_/_/\_\___|\__,_(_)
|_|
@kamipo
kamipo / isucon_tuning1.sql
Created August 28, 2011 06:32
チームやすべえ #isucon
-- before query
EXPLAIN
SELECT a.id, a.title
FROM comment c
INNER JOIN article a ON c.article = a.id
GROUP BY a.id ORDER BY MAX(c.created_at) DESC LIMIT 10;
-- alter table
ALTER TABLE article