- ssh
- host1 - (FW) - host2 - host3
- host2, 3 は同じネットワークにあるが host1 からは host2 しか見えない
- host1:2034 に host3 の22をつなげる(host2 を経由)。 host1 で以下を実行する
- ssh -i <キーのパス> -f -o ServerAliveInterval=60 -g -L 2034(ローカルのポート):host3:22 <host2 のユーザ>@host2
- mysql にも使えます
- ssh -N -i <キーのパス> -f -o ServerAliveInterval=60 -g -L 2306:host3:3306 <host2 のユーザ>@host2
- host3 から host1 にログインする host1 の .ssh/config Host 2ndProxy Hostname Host3
- host1 - (FW) - host2 - host3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace DataRenovationBundle\Util; | |
use ArrayObject; | |
/** | |
* DataRenovationBundle\Utils\ArrayUtil | |
* | |
* 配列に関わるユーティリティ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"" options {{{1 ------------------------------------------------------------------------------------ | |
" indent | |
set autoindent | |
set expandtab | |
set shiftwidth=4 | |
set smarttab | |
set tabstop=4 | |
" search |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# | |
# with-subcommand.zsh | |
# | |
# Description: | |
# | |
# Add custom subcomand into any command | |
# | |
# Installation: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# http://tech.naviplus.co.jp/2014/01/09/tmuxで複数サーバの同時オペレーション/ | |
# | |
if [ -n "$SESSION_NAME" ];then | |
session=$SESSION_NAME | |
else | |
session=multi-ssh-`date +%s` | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
sub checkPhp { | |
my ($file) = @_; | |
return if ($file !~ /\.php$/); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>ページのタイトルと URL をコピーするブックマークレット</h1> | |
<a href= | |
"javascript:void(window.clipboardData.setData('text', '[' + document.title+']('+document.location + ')'))"> | |
URLコピー</a> | |
<a href= | |
"javascript:window.prompt('','['+ document.title +']('+ location.href + ')');void(0);"> | |
URLコピーMarkdown</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MODx.on('ready', function() { | |
var toolBar = Ext.getCmp('modx-action-buttons'); | |
toolBar.insertButton(3, buttons); | |
toolBar.addButton(buttons); | |
toolBar.doLayout(); | |
} |
- stash で untracked なファイルを save する
- git stash save --include-untracked
- git stash save -u
- stash にメッセージをつける
- git stash save "つけたい名前"
- 一つ前にいたブランチに移動
- git checkout -
- ログを発掘する
- git reflog show develop
- 新規ブランチ作成
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function withOutputBuffer() | |
{ | |
$args = func_get_args(); | |
$func = array_shift($args); | |
ob_start(); | |
$ret = call_user_func_array($func, $args); | |
$out = ob_get_contents(); | |
ob_end_clean(); |
NewerOlder