Skip to content

Instantly share code, notes, and snippets.

View mazgi's full-sized avatar

Hidenori Matsuki mazgi

View GitHub Profile
@mazgi
mazgi / file0.txt
Last active April 28, 2018 14:09
JSX(Adobeの方)でスクリプトファイル自身のpathを求める ref: https://qiita.com/mazgi/items/863e9083430084e82cba
const SELF = (function(){
try {app.documents.test()}
catch(e) {return File(e.fileName)}
})();
$.writeln(SELF instanceof File);
$.writeln(SELF);
$.writeln(SELF.path);
@mazgi
mazgi / file0.txt
Created July 18, 2013 11:11
sudoのconfigureオプションを確認する ref: http://qiita.com/mazgi/items/6f5fdb239b60e6d0f314
localhost ~ # sudo -V | grep 'Configure options:'
Configure options: --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --enable-zlib=system --with-secure-path=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin --with-editor=/usr/libexec/editor --with-env-editor --without-insults --without-all-insults --with-ldap_conf_file=/etc/ldap.conf.sudo --with-ldap --enable-nls --with-pam --without-skey --without-selinux --with-sendmail --without-opie --without-linux-audit --with-timedir=/var/db/sudo --with-plugindir=/usr/lib64/sudo --docdir=/usr/share/doc/sudo-1.8.6_p7
localhost ~ # sudo -V | grep 'ldap.conf path:'
ldap.conf path: /etc/ldap.conf.sudo
@mazgi
mazgi / file0.txt
Created July 20, 2013 09:02
Adobe JSXで特定のjsxファイルが存在すれば読み込む ref: http://qiita.com/mazgi/items/439d7dccb10d9b118db4
$ tree
.
├── lib
│   └── lib1.jsx
└── main.jsx
@mazgi
mazgi / console_window.jsx
Created August 9, 2013 11:54
JSXでログコンソールっぽいものつくってみた
var dlg = new Window('dialog', 'Alert Box Builder'); dlg.msgPnl = dlg.add('panel', undefined, 'Messages');
dlg.msgPnl.titleSt = dlg.msgPnl.add('statictext', undefined, 'Alert box title:');
dlg.msgPnl.titleEt = dlg.msgPnl.add('edittext', undefined, 'Sample Alert');
dlg.msgPnl.msgSt = dlg.msgPnl.add('statictext', undefined, 'Alert message:');
var date = new Date();
// create list box with two titled columns
var list = dlg.msgPnl.add ('ListBox', [0, 0, 400, 180], 'asd', {numberOfColumns: 4, showHeaders: true, columnTitles: ['Index', 'Date', 'Function', 'Message']});
// add an item for the first row, with the label value for the first column
@mazgi
mazgi / console.log
Last active December 25, 2015 17:09
to detect missing documents.
[mazgi@Ardbeg] $ bundle exec rake outdated
docs/ja/config-file.txt : 4 days, 10 hours
docs/ja/install-by-gem.txt : 13 hours
docs/ja/out_mongo.txt : 153 days, 19 hours
docs/ja/quickstart.txt : 14 hours
Following articles not to exist in "br":
changelog.txt
config-file.txt
faq.txt
Following article not to exist in "eu":
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.36-gentoo-r5
# Sun Jan 30 02:06:39 2011
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
@mazgi
mazgi / install_playframeworks_for_playenv.sh
Last active August 29, 2015 13:57
Install Scala, sbt, PlayFramefork for {scala,sbt,play}env.
#!/bin/bash
for version in 2.2.1 2.2.0 2.1.5 2.1.4 2.1.3 2.1.2 2.1.1 2.1.0 2.0.8 2.0.7 2.0.6 2.0.5 2.0.4 2.0.3 2.0.2 2.0.1 2.0 1.2.7 1.2.6 1.2.5.3 1.2.5.2 1.2.5.1 1.2.5
do
mkdir -p ~/.playenv/versions && pushd ~/.playenv/versions > /dev/null
if [ -d play-${version} ]; then
echo "Play ${version} is already installed."
else
echo "Installing Play ${version}..."
stat=$(($(curl -LI http://downloads.typesafe.com/play/${version}/play-${version}.zip -o /dev/null -w '%{http_code}\n' -s)/100*100))
if [ 200 -eq ${stat} ]; then
@mazgi
mazgi / randomread.fio
Created April 4, 2014 04:10
fio benchmark
[global]
ioengine=libaio
direct=1
invalidate=1
group_reporting
filename=test.bin
runtime=60
[Rand-Read-4k-qd32]
readwrite=randread
@mazgi
mazgi / gist:9972940
Created April 4, 2014 11:49
HDD benchmark with fio
fio -filename=/path/to/fio.bin -direct=1 -invalidate=1 -rw=randwrite -bs=4k -size=4G -numjobs=64 -runtime=180 -group_reporting -name=file1
@mazgi
mazgi / iops.md
Last active August 29, 2015 13:58
Measure IOPSs on the Dell R420

Server

Storages & FileSystems

Gottfried ~ # fdisk -l /dev/sda

Disk /dev/sda: 599.6 GB, 599550590976 bytes, 1170997248 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes