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
<# | |
.SYNOPSIS | |
Port forwarding from Windows Host environment to WSL2 environment. | |
.DESCRIPTION | |
A simple wrapper windows command 'netsh'. | |
Requires administrator privileges to run. | |
.PARAMETER FromPort | |
Specifies the port in the Windows Host environment for port forwarding. |
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 | |
# nco.sh | |
# checkout next/prev commit on current git repository | |
# Usage: | |
# nco [next|prev] | |
# use only on detached HEAD branch | |
if [[ ! -e .git ]]; then | |
echo "$PWD is not git repository." |
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/sh | |
#################################################################################################################### | |
# Upload by FTP | |
# NAME: | |
# send_ftp.sh | |
# SYNOPSIS: | |
# send_ftp.sh [FTP SERVER NAME] [FTP USER] [FTP PASSWORD] [SEND FILE PATH] [SEND REMOTE DIR] | |
#################################################################################################################### |
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
# append for .bash_profile | |
# bash-completion for ssh | |
function _compreply_ssh(){ | |
COMPREPLY=(`cat ~/.ssh/config | grep -i -e '^host' | cut -d " " -f 2 | grep -E "$2"`) | |
} | |
complete -F _compreply_ssh ssh |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
) | |
func main() { | |
sc := bufio.NewScanner(os.Stdin) |
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/sh | |
if [ $# != 1 ]; then | |
echo "Usage: $0 [binary name]" | |
exit 0 | |
fi | |
GOOS=linux GOARCH=amd64 go build -o ./bin/linux64/$1 | |
GOOS=linux GOARCH=386 go build -o ./bin/linux386/$1 |
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
/* | |
* Cプログラムの行数を数え, | |
* コメントを印字するプログラム | |
*/ | |
/* ここから定義部 */ | |
/* Cと同じ記法でここはコメントになります */ | |
/* yaccと連携するためのmain関数を出力しないオプション */ |