Skip to content

Instantly share code, notes, and snippets.

View masami256's full-sized avatar
😎
😊

Masami Ichikawa masami256

😎
😊
View GitHub Profile
@masami256
masami256 / screenshot.py
Created October 16, 2011 08:54
Take a screenshot
#!/usr/bin/env python
from subprocess import Popen, PIPE
from optparse import OptionParser
import datetime
def get_window_id():
print "Please select window which you want to take screen shot."
p = Popen("xwininfo", stdout = PIPE)
p.wait()
@masami256
masami256 / mp-test.c
Created December 16, 2011 15:42
Read multiprocessor/moutlicode data from memory.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#define MEMORY_FILE "/dev/mem"
@masami256
masami256 / ldd.py
Created January 10, 2012 12:45
Execute ldd command to find commands that depend on given library name
#!/usr/bin/env python
import sys
import os
from subprocess import Popen, PIPE
from optparse import OptionParser
def get_result(p):
stdout = p.communicate()
diff --git a/xdg-open b/xdg-open
index 02c06d7..74f77ab 100755
--- a/xdg-open
+++ b/xdg-open
@@ -610,7 +610,34 @@ open_lxde()
pcmanfm "$file"
else
- open_generic "$1"
+ # Lxde's default application setting will be in ~/.local/share/applications/mimeapps.list or
@masami256
masami256 / TestingExperience article index
Last active October 7, 2015 20:59
TestingExperienceの記事一覧
https://gist.github.com/3224427
Published: 2008/03
Title: Testing & People
* Adopt Your Local Professor:The Need for Industry and Academia to Work Together
By Patricia A. McQuaid
* Putting the ‘Analysis’ in a Test Analyst
By Mike Smith
* A Quality Manifesto
@masami256
masami256 / gcc warning
Created October 26, 2012 15:17
#if 0で囲ったところでwarning出さないで欲しいな
[masami@saga:~]$ gcc -v
Using built-in specs.
COLLECT_GCC=/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat
@masami256
masami256 / makecsv.sh
Created January 8, 2013 07:28
sarでログ取り用
#!/bin/sh
if [ $# != 4 ]; then
echo "usage: $0 filename hostname start(hh:mm:ss) end(hh:mm:ss)"
exit 0
fi
fname=$1
hname=$2
start=$3
@masami256
masami256 / sync_test.c
Created January 24, 2013 15:59
sync()にどの程度かかるか計測用
// Howto build
// $ gcc sync_test.c -lrt -lpthread -Wall
// rt for clock_gettime()
// pthread for pthread libraries
//
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <assert.h>
#include <stdlib.h>
@masami256
masami256 / report.rb
Created February 8, 2013 05:10
cucumberのhtml形式のログを読んでシナリオ数、pass数、fail数をcsv形式で出力
#!/usr/bin/env ruby
# vim:ts=4
require "find"
require "optparse"
def read_file(name, offset)
f = open(name)
str = f.read
@masami256
masami256 / use_slab_cache.patch
Last active December 15, 2015 21:59
fork時のaudit_alloc_context()でkmalloc()じゃなくてkmem_cache_alloc()を使うpatch。for 3.10-rc1
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b20b038..2eb4be2 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -94,6 +94,7 @@ extern void audit_log_session_info(struct audit_buffer *ab);
#ifdef CONFIG_AUDITSYSCALL
/* These are defined in auditsc.c */
/* Public API */
+extern int __init audit_cache_init(void);
extern int audit_alloc(struct task_struct *task);