Skip to content

Instantly share code, notes, and snippets.

View mitakeck's full-sized avatar
🌴
On vacation

mitake_ck mitakeck

🌴
On vacation
  • Aichi/Japan
View GitHub Profile
ls | awk '{print "cat " $1 " | sed -e \"s/^.*comment\\\":\\\"\\([^\\\"]*\\)\\\".*$/\\\"\\1\\\"/g\" >> ../res/" $1 }' | sh
@mitakeck
mitakeck / run.sh
Last active December 28, 2015 13:48
#!/usr/bin/bash
# OpenCV runnning without GUI
echo "make dir"
mkdir /tmp/`echo $2`
echo "compiling $1"
if [[ $1 == *.cpp ]]
then
g++ -ggdb `pkg-config --cflags opencv` -o `basename $1 .cpp` $1 `pkg-config --libs opencv`;
*filter
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allows all outbound traffic
#!/usr/bin/python
# coding:utf-8
import MeCab
# n-gram データ格納用
ngram = {}
# 出現ワードの ngram データを作成する
def count(preword, word, data=ngram):

Ruby の Shell クラス覚書

require 'shell'
 
Shell.def_system_command("pushnotice")
sh = Shell.new
sh.pushnotice("Ruby から通知!")

データベース設計

ZITEM

CREATE TABLE ZITEM (
	Z_PK INTEGER PRIMARY KEY,
	Z_ENT INTEGER, 
	Z_OPT INTEGER,
	ZPRIVATE INTEGER,
	ZCREATED_AT TIMESTAMP,

hddtemp_smartctl が動かない

root@apricot:/usr/share/munin/plugins# munin-run hddtemp_smartctl
Can't exec "-A": No such file or directory at /etc/munin/plugins/hddtemp_smartctl line 214.
sda.value U
sda.extinfo Command  -A /dev/sda on drive sda failed: -1.  The plugin needs to have read permission on all monitored devices.
[ERROR] Command  -A /dev/sda on drive sda failed: -1.  The plugin needs to have read permission on all monitored devices.
Can't exec "-A": No such file or directory at /etc/munin/plugins/hddtemp_smartctl line 214.
sdb.value U
@mitakeck
mitakeck / FeaturePoint.cs
Last active August 29, 2015 14:04
K-means でラインをクラスタリングした時のコードメモ
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;