Skip to content

Instantly share code, notes, and snippets.

@kozy4324
kozy4324 / launchd_memo.md
Last active March 11, 2024 03:56
launchd, launchctlについて(導入編)

launchd, launchctl

man

$ man launchd
$ man launchctl
$ man launchd.plist

$ man plutil

@kozy4324
kozy4324 / bundler_memo.md
Last active May 25, 2022 01:59
Bundlerめも

bundler

install

Gemfile(or Gemfile.lock)の記述に従って依存gemをシステムにインストール.

$ bundle install
@kozy4324
kozy4324 / rc_script.md
Created June 17, 2013 10:23
rcスクリプトの書き方について

CentOS6.3でrcスクリプトを書くよ

ランレベルとは?

/etc/inittabに書いてあるので確認.

# Default runlevel. The runlevels used are:
@kozy4324
kozy4324 / seed.sh
Last active February 22, 2017 03:56
freeCodeCampをdocker-composeで動かす
# データベースへロード
docker exec $(docker ps -f name=freecodecamp_server_1 -q) node seed
@kozy4324
kozy4324 / index.html
Last active November 4, 2016 06:15
FOSS4G 2016 Tokyo hands-on
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.26.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.26.0/mapbox-gl.css' rel='stylesheet' />
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' />
<style>
@kozy4324
kozy4324 / vagrant.md
Last active September 15, 2016 06:08
Vagrantめも

Vagrant

box

OSのベースイメージ. 以下でローカルにprecise32という名前で特定URLからダウンロードして追加する.

$ vagrant box add precise32 http://files.vagrantup.com/precise32.box
@kozy4324
kozy4324 / ua.md
Last active June 15, 2016 10:57
User Agent
type Regexp
iPhone .iPhone.
iPad .iPad.
Android .Android.
Windows Phone .Windows Phone.
BlackBerry .BlackBerry.
Symbian .Symbian.
IE .Mozilla/[\d.]+ (compatible; MSIE (\d+).
Chrome .Chrome.(\d+).
@kozy4324
kozy4324 / capture.js
Last active January 2, 2016 13:59
capture script for phantomjs
if (phantom.args.length == 0) {
phantom.exit();
}
var i = 0, ua, url, clipRect = null, file, wait_ms;
if (!phantom.args[i].match(/^https?:\/\//)) {
ua = phantom.args[i++];
}
url = phantom.args[i++];
file = phantom.args[i++];
@kozy4324
kozy4324 / a.sh
Created November 28, 2013 03:48
Heap buffer overflow (CVE-2013-4164) occurs in in_http via the HTTP requests with malicious POST data.
# using ruby 2.0.0-p247
rbenv local 2.0.0-p247
# install fluentd
echo 'source "https://rubygems.org"
gem "fluentd"' > Gemfile
bundle install --path=bundle
# create fluent.conf
echo '<source>
@kozy4324
kozy4324 / a_helper.rb
Created August 9, 2013 06:13
Railsのrenderメソッドでレンダリングされる時だけulタグで括るラッパー
class AHelper
def render_ul arg
unless arg.nil? or arg.empty?
"<ul>#{render arg}</ul>".html_safe
else
""
end
end
end