Skip to content

Instantly share code, notes, and snippets.

View ikuwow's full-sized avatar
🏠
Working from home

Ikuo Degawa ikuwow

🏠
Working from home
View GitHub Profile
@ikuwow
ikuwow / file0.txt
Created February 6, 2016 13:47
osx_defaultsモジュール (from Ansible 2) でMacのプロビジョニングが簡単になってすごい便利 ref: http://qiita.com/ikuwow/items/86dd11b111640cfee3f0
- name: Check Dock
shell: "defaults read com.apple.dock | grep autohide > /dev/null && test `defaults read com.apple.dock autohide` -eq 1; echo $?"
register: is_autohide
changed_when: is_autohide.stdout != '0'
- name: Autohide Dock
shell: "defaults write com.apple.dock autohide -int 1"
notify: Restart Dock
when: is_autohide.stdout != '0'
@ikuwow
ikuwow / file0.txt
Created February 21, 2016 02:48
fluentdのread_from_headでログの欠損が治ったパターン ref: http://qiita.com/ikuwow/items/ea300af9d0ff2d90d69c
log-2016-02-01-00.log
log-2016-02-01-01.log
...
log-2016-02-01-22.log
log-2016-02-01-23.log
log-2016-02-02-00.log
@ikuwow
ikuwow / file0.txt
Last active March 16, 2016 14:20
sshした先に.bashrcや.vimrcを持って行きたい人のためのsshrc ref: http://qiita.com/ikuwow/items/ba4ca57fd67c06fd1b19
$ brew install sshrc
<?php
$input = 'hoge00';
$trials = 100000;
$tic = microtime(true);
for ($i = 0; $i < $trials; $i++) {
preg_match("/^[0-9]+$/", $input);
}
echo (string)(microtime(true) - $tic) . "\n";
#!/bin/bash
# re-allocate shards of node "Wildboys" (ip=10.252.1.114)
variable=$(curl -X GET 10.252.1.114:9200/_cat/shards | grep UNASSIGNED | awk -v OFS=, '{print $1,$2,$3}')
for shard in $variable; do
index=$(echo $shard | cut -d, -f1)
snum=$(echo $shard | cut -d, -f2)
pr=$(echo $shard | cut -d, -f3)
echo
@ikuwow
ikuwow / file2.txt
Created April 25, 2016 10:52
Macでpyenv使ってPythonの環境設定をするansible playbook ref: http://qiita.com/ikuwow/items/4a1d784876f70a1abd74
if [ `which pyenv` ]; then
eval "$(pyenv init - --no-rehash)" # adding --no-rehash makes this faster
fi
@ikuwow
ikuwow / brewdoctorの出力
Last active May 9, 2016 05:10
phpbrew @ Mac で複数バージョンのphpの環境構築するAnsible Playbook ref: http://qiita.com/ikuwow/items/58d5e36913266d441557
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
#!/bin/bash
WORKDIR=~/Desktop/untitled
OUTPUTDIR=~/Desktop/pdfed
[[ ! -d $OUTPUTDIR ]] && mkdir $OUTPUTDIR
echo $WORKDIR
for FOLDER in $WORKDIR/*; do
<?php
/**
* teratail - Q&A community for every thinking engineer
*
* @author Leverages Co. Ltd. Technology Media Lab.
* @since 2014/07/16
*/
function teratail(ThinkingEngineer $you)
{
$question = new Question($you->problems);
@ikuwow
ikuwow / this_is_teratail2.php
Created June 13, 2016 07:21
this_is_teratail2.php
<?php
/**
* teratail
*
* by Leverages Co. Ltd. Technology Media Lab
*/
function teratail(AwesomeEngineer $you) {
if (!isset($you->problems)) {
return "I am always happy.";