Skip to content

Instantly share code, notes, and snippets.

View kofemann's full-sized avatar
Working on the next great thing....

Tiramisu Mokka kofemann

Working on the next great thing....
View GitHub Profile
@kofemann
kofemann / code-guideline.md
Last active August 9, 2017 10:28
dCache code guideline

dCache code guideline

Spaces vs Tabs

dCache projects uses four (4) spaces indention. Some historic code still have mixed style. However, the newly written code must stick to spaces.

@kofemann
kofemann / hand-on-git.md
Last active July 31, 2017 15:57
Git tutorial for beginners

Hands on GIT

Get started

create your own fork and clone newly created repo:

$ git clone https://github.com/kofemann/dcache.git
@kofemann
kofemann / BadCookie.java
Created May 27, 2017 09:50
btrace script to print error message passes to BadCookieException constructor
import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;
import org.dcache.nfs.status.BadCookieException;
import org.dcache.nfs.status.AccessException;
@BTrace public class BadCookie {
@OnMethod(
@kofemann
kofemann / dcache-ceph.md
Last active January 11, 2017 14:01
dCache with CEPH

Using CEPH as a backend for dCache pools

dCache pool -> CEPH releation

dCache pools are mapped one-to-one with CEPH pools, e.g. CEPH pool is used by a single dCache pool. To store files in CEPH, dCache uses RBD interface. For eache file in dCache pool a sigle RBD image is created.

@kofemann
kofemann / PnfsManagerTrace.java
Created May 18, 2016 11:19
btrace script to trace db interracions
import com.sun.btrace.annotations.*;
import com.sun.btrace.aggregation.Aggregation;
import com.sun.btrace.aggregation.AggregationKey;
import com.sun.btrace.aggregation.AggregationFunction;
import com.sun.btrace.AnyType;
import static com.sun.btrace.BTraceUtils.*;
@BTrace
public class PnfsManagerTrace {
@kofemann
kofemann / dcache-namespace.md
Last active January 27, 2016 16:20
dCache namespace requirements

dCache namespace requirements

Introduction

####This document describes requirements for dCache's namespace (directory) service. It's heavily biased on current chimera implementation.

The main role of namespace in dCache is to provide a hierarchical structure to manage and file system objects, collection of objects, aka directories, and provide an access to the metadata associated with them. Every data file in dCache has an associated object in the namespace. Typically a change of object in the namespace, like changing the object name or changing objects ownership, does not changes the state of the data file in dCache. Each object in the namespace has a unique objID. We expect that objIDs are permanent, e.q. there objID will always point to the same data file independent from it location, state in the dCache and existence. The objIDs can’t be recycled and reused for new objects after deletion. Every object has a set of associated attributes. Some attributes are

@kofemann
kofemann / NetorkInterfaceFtracer.java
Last active January 12, 2016 15:40
btrace script
import com.sun.btrace.annotations.*;
import com.sun.btrace.aggregation.Aggregation;
import com.sun.btrace.aggregation.AggregationKey;
import com.sun.btrace.aggregation.AggregationFunction;
import static com.sun.btrace.BTraceUtils.*;
/**
* run as:
* $ su dcache -c "/opt/btrace/bin/btrace <pid> NetorkInterfaceFtracer.java"
*/
@kofemann
kofemann / dcache-on-linux.md
Last active April 8, 2022 01:09
dtrace on linux

#Get started with DTrace on linux ####(with CentOS7/SL7/RHEL7)

  1. add YUM repo
$ cd /etc/yum.repos.d
$ wget http://public-yum.oracle.com/public-yum-ol7.repo
$ rpm --import http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7
@kofemann
kofemann / histo.py
Last active August 25, 2018 20:24
A python script to print a histogram
#!/usr/bin/env python
"""
Print a histogram of word distribution. Takes single word per line from stdin
and prints dtrace output like histogram:
$ echo "some text with some text fields as text" | tr -s '[:space:]' '\n' | ./histo.py 10
text | 3 | ##################################################
some | 2 | #################################
with | 1 | ################
@kofemann
kofemann / 10G-sysctl.conf
Last active January 18, 2025 16:00
sysctl configuration for 10GE ethernet
#
# Based on info providef at http://fasterdata.es.net/
#
# allow testing with buffers up to 64MB
net.core.rmem_max = 67108864
net.core.wmem_max = 67108864
# Enable memory auto tuning
net.ipv4.tcp_moderate_rcvbuf = 1