Skip to content

Instantly share code, notes, and snippets.

View enakai00's full-sized avatar

Etsuji Nakai enakai00

View GitHub Profile
@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
#!/usr/bin/perl
#
# podgetter.pl
#
# Podcast downloader exclusively for BBC Radio
#
# 2014/04/11 v1.0
# 2014/06/10 v1.1
#
#!/bin/bash -x
LANG=C
basepass="XXXXXXXX"
reposerver="xxx.xxx.xxx.xxx"
function prep_network {
set -x
yum -y update
yum -y groupinstall "Gnome Desktop"
@enakai00
enakai00 / perceptron.py
Last active August 29, 2015 14:12
Perceptron emulation
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas import Series, DataFrame
import pandas.io.data as web
from numpy.random import randint, randn, rand, multivariate_normal
def run_perceptron(axes):
n1 = randint(40,80)
@enakai00
enakai00 / isingmodel.py
Last active January 4, 2023 08:35
Gibbs Sampling Emulation of 2D Ising Model
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas import Series, DataFrame
from numpy.random import randint, randn, rand
Size = 50
J = 1
H = 0.0
Temp = 0
@enakai00
enakai00 / perceptron_sample.py
Created January 12, 2015 00:49
Perceptron Simulation Sample
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas import Series, DataFrame
from numpy.random import randint, randn, rand, multivariate_normal
def run_perceptron(ax):
n1 = 60
n2 = 40
@enakai00
enakai00 / classifier.py
Created January 24, 2015 01:49
Multivalue classifier from PRML chapter4
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas import Series, DataFrame
from numpy.random import randint, randn, rand, multivariate_normal
K = 3 # Number of classes (2 or 3)
N = 50 # Number of training data
HR = 200 # Heatmap resolution