Skip to content

Instantly share code, notes, and snippets.

View enakai00's full-sized avatar

Etsuji Nakai enakai00

View GitHub Profile
--- mm/shmem.c.orig 2013-09-14 17:53:22.000000000 +0900
+++ mm/shmem.c 2013-11-21 11:17:00.301033262 +0900
@@ -1100,6 +1100,7 @@
spin_lock_init(&info->lock);
info->flags = flags & VM_NORESERVE;
INIT_LIST_HEAD(&info->swaplist);
+ simple_xattrs_init(&info->xattrs);
cache_no_acl(inode);
switch (mode & S_IFMT) {
--- kernel.spec.orig 2013-11-21 11:33:16.194683545 +0900
+++ kernel.spec 2013-11-21 11:32:40.377181703 +0900
@@ -16,6 +16,7 @@
# by setting the define to ".local" or ".bz123456"
#
# % define buildid .local
+%define buildid .tmpfshacked
%define rhel 1
%if %{rhel}
RHEL6でtmpfsでxattrが使えるようにするやっつけの手順。当然ながら、RH non-supportです。
1. カーネルソース「kernel-2.6.32-358.23.2.el6.src.rpm」を入手する。
2. SPECファイルのパッチをダウンロードする。
# rm -f /tmp/kernel.spec.patch
# wget https://gist.github.com/enakai00/7558519/raw/79c52871e08816ab262beea4e715a6f580011c23/kernel.spec.patch -O /tmp/kernel.spec.patch
3. Kernelパッケージをビルドする
@enakai00
enakai00 / hellogluster.c
Last active December 29, 2015 14:59
The simplest libgfapi example.
#include <glusterfs/api/glfs.h>
int main (int argc, char** argv) {
glfs_t *fs = NULL;
glfs_fd_t *fd = NULL;
int ret;
char *filename = "filename";
fs = glfs_new ("volume_name");
ret = glfs_set_volfile_server (fs, "tcp", "server_address", 24007);
@enakai00
enakai00 / env_gfapi.cc
Created December 1, 2013 04:41
gfapi env module for LevelDB
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#include <deque>
#include <set>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
--- ./configure.ac.orig 2013-12-01 12:29:50.000000000 +0900
+++ ./configure.ac 2013-12-01 12:41:57.000000000 +0900
@@ -32,6 +32,15 @@
[]
)
+AC_CHECK_LIB( [gfapi], [glfs_new],
+ [
+ GFAPI_LIBS="-lgfapi"
+ AC_SUBST([GFAPI_LIBS])
#!/usr/bin/perl
#
# cdconv - Command line CD ripper and ogg-vorbis encoder
#
# 2008/09/27 ver1.1
#
use strict;
use CDDB_get qw( get_cddb get_discids );
#!/bin/sh -xe
. /reoot/keystonerc_admin
export MYSQL_ROOT_PASSWORD=$(grep CONFIG_MYSQL_PW /root/quickrdo/controller.txt | cut -f2 -d=)
export HEAT_DB_PASSWORD_OF_CHOICE=pas4heat
yum -y install "openstack-heat-*" python-heatclient
heat-db-setup rpm -y -r ${MYSQL_ROOT_PASSWORD} -p ${HEAT_DB_PASSWORD_OF_CHOICE}
sed -i "s/%ENCRYPTION_KEY%/`hexdump -n 16 -v -e '/1 "%02x"' /dev/random`/" /etc/heat/heat-engine.conf
@enakai00
enakai00 / prepare tmpfs bricks
Created November 16, 2013 02:43
Prepare Fedora GlusterFS nodes with tmpfs brick
#!/bin/bash -x
setenforce 0
curl http://download.gluster.org/pub/gluster/glusterfs/LATEST/Fedora/glusterfs-fedora.repo > /etc/yum.repos.d/gluster.repo
yum -y install glusterfs-server glusterfs-geo-replication
chkconfig glusterd on
service glusterd start
chkconfig iptables off
service iptables stop
mkdir -p /bricks/tmpfs
umount /bricks/tmpfs
@enakai00
enakai00 / gravitation.ipynb
Created June 4, 2016 03:56
Gravitation simulation with Jupyter
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.