-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"MD013": false, | ||
"MD033": false | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 umatare5 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# fish-my-functions | ||
|
||
Functions in my fish shell. | ||
|
||
<a href="https://fishshell.com/"> | ||
<img src="https://badgen.net/badge/fish-shell/plugin?icon=terminal" alt="fish-shell plugin"> | ||
</a> | ||
|
||
<a href="https://github.com/umatare5/fish-my-functions/blob/master/LICENSE"> | ||
<img src="https://badgen.net/github/license/umatare5/fish-my-functions" alt="license"> | ||
</a> | ||
|
||
## Prerequisite | ||
|
||
- [fish shell](https://fishshell.com/) | ||
|
||
| Name | Installation Guide | | ||
| ------------------ | ------------------------------------------------------------------------------------- | | ||
| Google Chrome | [Link](https://www.google.co.jp/chrome) | | ||
| Docker Desktop | [Link](https://www.docker.com/products/docker-desktop) | | ||
| Wireshark | [Link](https://www.wireshark.org/download.html) | | ||
| AWS CLI v2 (aws) | [Link](https://docs.aws.amazon.com/ja_jp/cli/latest/userguide/install-cliv2-mac.html) | | ||
| Cloud SDK (gcloud) | [Link](https://cloud.google.com/sdk/docs/install) | | ||
| nload | `brew install nload` | | ||
|
||
## Installation | ||
|
||
### [Fisher](https://github.com/jorgebucaran/fisher) | ||
|
||
```sh | ||
fisher install umatare5/fish-my-functions | ||
``` | ||
|
||
### [Oh My Fish](https://github.com/oh-my-fish/oh-my-fish) | ||
|
||
```sh | ||
omf install https://github.com/umatare5/fish-my-functions | ||
``` | ||
|
||
## Usage | ||
|
||
### Application | ||
|
||
| Command | Description | | ||
| ------- | ----------------- | | ||
| o | `open` wrapper | | ||
| chrome | Run Google Chrome | | ||
| wshark | Run Wireshark | | ||
|
||
### Development | ||
|
||
| Command | Description | | ||
| ------- | ------------------------------ | | ||
| dc | `docker container` wrapper | | ||
| di | `docker image` wrapper | | ||
| g | `git` wrapper | | ||
| ga | `git add` wrapper | | ||
| gb | `git branch` wrapper | | ||
| gci | `git commit --message` wrapper | | ||
| gco | `git checkout` wrapper | | ||
| gd | `git diff` wrapper | | ||
| gp | `git push origin HEAD` wrapper | | ||
|
||
### Networking | ||
|
||
| Command | Description | | ||
| ------- | ------------------------------------------- | | ||
| bcon | Show SSIDs detected on your Mac | | ||
| gip | Show your outbound global IP | | ||
| nstats | Show wireless network interface statistics | | ||
| wlan | Show the information of wireless connection | | ||
| wlog | Show logs written by wireless interface | | ||
|
||
### AWS | ||
|
||
| Command | Description | | ||
| ------- | ------------------------------ | | ||
| alogin | `aws sso login` wrapper | | ||
| atoken | Show tokens issued by `alogin` | | ||
|
||
### GCP | ||
|
||
| Command | Description | | ||
| ------- | ----------------------------------------------------------- | | ||
| glogin | `gcloud auth login` and `application-default login` wrapper | | ||
| gtoken | Show tokens issued by `glogin` | |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function alogin --wraps='aws sso login --profile' --description 'alias alogin=aws sso login --profile' | ||
aws sso login --profile $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function atoken --wraps=jq\ -r\ \'.region\ +\ \'\|\'\ +\ .expiresAt\'\ /\(ls\ -rt\ \|\ tail\ -n\ 1\) --wraps=jq\ -r\ \'.region\ +\ \"\|\"\ +\ .expiresAt\'\ /\(ls\ -rt\ \ \|\ tail\ -n\ 1\) --description alias\ atoken=jq\ -r\ \'.region\ +\ \"\|\"\ +\ .expiresAt\'\ /\(ls\ -rt\ \ \|\ tail\ -n\ 1\) | ||
set AWS_CACHE_DIR ~/.aws/sso/cache | ||
jq -r '.region + "|" + .expiresAt' /(ls -rt | tail -n 1) $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function bcon --wraps='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s' --description 'alias bcon=/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s' | ||
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function chrome --wraps='open -a /Applications/Google Chrome.app' --wraps='open -a "/Applications/Google Chrome.app"' --description 'alias chrome=open -a "/Applications/Google Chrome.app"' | ||
open -a "/Applications/Google Chrome.app" $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function dc --wraps='docker container' --description 'alias dc=docker container' | ||
docker container $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function di --wraps='docker image' --description 'alias di=docker image' | ||
docker image $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function g --wraps=git --description 'alias g=git' | ||
git $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function ga --wraps='git add' --description 'alias ga=git add' | ||
git add $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function gb --wraps='git branch' --description 'alias gb=git branch' | ||
git branch $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function gci --wraps='git commit -m' --description 'alias gci=git commit -m' | ||
git commit -m $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function gco --wraps='git checkout' --description 'alias gco=git checkout' | ||
git checkout $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function gd --wraps='git diff' --description 'alias gd=git diff' | ||
git diff $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function gip --wraps='curl https://ifconfig.io/host' --description 'alias gip=curl https://ifconfig.io/host' | ||
curl https://ifconfig.io/host $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function glogin --wraps='gcloud auth login && gcloud auth application-default login' --description 'alias glogin=gcloud auth login && gcloud auth application-default login' | ||
gcloud auth login && gcloud auth application-default login $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function gp --wraps='git push origin HEAD' --description 'alias gp=git push origin HEAD' | ||
git push origin HEAD $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function gtoken --wraps='sqlite3 ~/.config/gcloud/access_tokens.db="SELECT token_expiry,account_id FROM access_tokens;"' --wraps=sqlite3\ \~/.config/gcloud/access_tokens.db\ \'SELECT\ token_expiry,account_id\ FROM\ access_tokens\;\' --description alias\ gtoken=sqlite3\ \~/.config/gcloud/access_tokens.db\ \'SELECT\ token_expiry,account_id\ FROM\ access_tokens\;\' | ||
sqlite3 ~/.config/gcloud/access_tokens.db 'SELECT token_expiry,account_id FROM access_tokens;' $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function nstats --wraps='nload devices en0 -t 1000 -u m -U G' --description 'alias nstats=nload devices en0 -t 1000 -u m -U G' | ||
nload devices en0 -t 1000 -u m -U G $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function o --wraps=open --description 'alias o=open' | ||
open $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function wlan --wraps='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I' --description 'alias wlan=/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I' | ||
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function wlog --wraps='sudo dmesg | grep en0 | grep change | grep -e=BSSID|channel' --description 'alias wlog=sudo dmesg | grep en0 | grep change | grep -e=BSSID|channel' | ||
sudo dmesg | grep en0 | grep change | grep -e "BSSID|channel" $argv; | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function wshark --wraps='open -n /Applications/Wireshark.app/' --description 'alias wshark=open -n /Applications/Wireshark.app/' | ||
open -n /Applications/Wireshark.app/ $argv; | ||
end |