Unverified Commit 8c95c523 authored by Kozlov Alexander's avatar Kozlov Alexander Committed by GitHub
Browse files

Merge branch 'master' into master

parents dd30cf10 3d8f2bda
alias n='nanoc'
alias na='nanoc autocompile'
alias nco='nanoc compile'
alias nci='nanoc create_item'
alias ncl='nanoc create_layout'
alias ncs='nanoc create_site'
alias ncs='nanoc create-site'
alias nd='nanoc deploy'
alias np='nanoc prune'
alias nv='nanoc view'
alias nw='nanoc watch'
ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get github-pages:deploy gh-pages:deploy h help i init install lint make-this-awesome new s serve server set t test v version -h --help'
ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get github-pages:deploy gh-pages:deploy h help i init install lint make-this-awesome new s serve server set t test update v version -h --help'
_ng_completion () {
local words cword opts
......@@ -55,6 +55,10 @@ _ng_completion () {
t | test )
opts='--browsers --colors --config-file --environment --filter --host --launch --log-level --module --path --port --query --reporter --server --silent --test-page --test-port --watch -H -c -cf -e -f -m -r -s -tp -w'
;;
update )
opts='--all --dryRun --force --from --migrate-only --next --registry --to -d'
;;
v | version )
opts='--verbose'
......
......@@ -13,20 +13,20 @@
# -O - enable OS detection
# -sA - TCP ACK scan
# -F - fast scan
# --script=vulscan - also access vulnerabilities in target
# --script=vuln - also access vulnerabilities in target
alias nmap_open_ports="nmap --open"
alias nmap_list_interfaces="nmap --iflist"
alias nmap_slow="nmap -sS -v -T1"
alias nmap_fin="nmap -sF -v"
alias nmap_full="nmap -sS -T4 -PE -PP -PS80,443 -PY -g 53 -A -p1-65535 -v"
alias nmap_check_for_firewall="nmap -sA -p1-65535 -v -T4"
alias nmap_slow="sudo nmap -sS -v -T1"
alias nmap_fin="sudo nmap -sF -v"
alias nmap_full="sudo nmap -sS -T4 -PE -PP -PS80,443 -PY -g 53 -A -p1-65535 -v"
alias nmap_check_for_firewall="sudo nmap -sA -p1-65535 -v -T4"
alias nmap_ping_through_firewall="nmap -PS -PA"
alias nmap_fast="nmap -F -T5 --version-light --top-ports 300"
alias nmap_detect_versions="nmap -sV -p1-65535 -O --osscan-guess -T4 -Pn"
alias nmap_check_for_vulns="nmap --script=vulscan"
alias nmap_full_udp="nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443,3389 "
alias nmap_traceroute="nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute "
alias nmap_detect_versions="sudo nmap -sV -p1-65535 -O --osscan-guess -T4 -Pn"
alias nmap_check_for_vulns="nmap --script=vuln"
alias nmap_full_udp="sudo nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443,3389 "
alias nmap_traceroute="sudo nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute "
alias nmap_full_with_scripts="sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all "
alias nmap_web_safe_osscan="sudo nmap -p 80,443 -O -v --osscan-guess --fuzzy "
# node plugin
To use it, add `node` to the plugins array of your zshrc file:
```zsh
plugins=(... node)
```
This plugin adds `node-docs` function that open specific section in [Node.js](https://nodejs.org) documentation (depending on the installed version).
For example:
```zsh
# Opens https://nodejs.org/docs/latest-v10.x/api/fs.html
$ node-docs fs
# Opens https://nodejs.org/docs/latest-v10.x/api/path.html
$ node-docs path
```
## npm plugin
The npm plugin provides completion as well as adding many useful aliases.
To use it, add npm to the plugins array of your zshrc file:
```
plugins=(... npm)
```
## Aliases
| Alias | Command | Descripton |
|:------ |:-----------------------------|:----------------------------------------------------------------|
| `npmg` | `npm i -g` | Install dependencies globally |
| `npmS` | `npm i -S` | Install and save to dependencies in your package.json |
| `npmD` | `npm i -D` | Install and save to dev-dependencies in your package.json |
| `npmE` | `PATH="$(npm bin)":"$PATH"` | Run command from node_modules folder based on current directory |
| `npmO` | `npm outdated` | Check which npm modules are outdated |
| `npmV` | `npm -v` | Check package versions |
| `npmL` | `npm list` | List installed packages |
| `npmL0` | `npm ls --depth=0` | List top-level installed packages |
| `npmst` | `npm start` | Run npm start |
| `npmt` | `npm test` | Run npm test |
| `npmR` | `npm run` | Run npm scripts |
| `npmP` | `npm publish` | Run npm publish |
| `npmI` | `npm init` | Run npm init |
(( $+commands[npm] )) && {
__NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion"
__NPM_COMPLETION_FILE="${ZSH_CACHE_DIR:-$ZSH/cache}/npm_completion"
if [[ ! -f $__NPM_COMPLETION_FILE ]]; then
npm completion >! $__NPM_COMPLETION_FILE 2>/dev/null
......@@ -51,4 +51,7 @@ alias npmt="npm test"
alias npmR="npm run"
# Run npm publish
alias npmP="npm publish"
\ No newline at end of file
alias npmP="npm publish"
# Run npm init
alias npmI="npm init"
......@@ -11,7 +11,21 @@ This plugin automatically registers npx command-not-found handler if `npx` exist
plugins=(.... npx)
```
- Globally install npx binary (you need node.js installed too!)
- Globally install npx binary (npx will be auto installed with recent versions of Node.js)
```bash
sudo npm install -g npx
```
\ No newline at end of file
```
## Note
The shell auto-fallback doesn't auto-install plain packages. In order to get it to install something, you need to add `@`:
```
➜ jasmine@latest # or just `jasmine@`
npx: installed 13 in 1.896s
Randomized with seed 54385
Started
```
It does it this way so folks using the fallback don't accidentally try to install regular typoes.
# nvm plugin
This plugin adds autocompletions for [nvm](https://github.com/creationix/nvm) — a Node.js version manager.
It also automatically sources nvm, so you don't need to do it manually in your `.zshrc`.
To use it, add `nvm` to the plugins array of your zshrc file:
```zsh
plugins=(... nvm)
```
......@@ -6,16 +6,23 @@
local -a _1st_arguments
_1st_arguments=(
'help:show help'
'install:download and install a version'
'--version:print out the latest released version of nvm'
'install:download and install a version in <node|iojs|node version number>'
'uninstall:uninstall a version'
'use:modify PATH to use version'
'run:run version with given arguments'
'use:modify PATH to use <version>. Uses .nvmrc if available'
'exec:run <command> on <version>. Uses .nvmrc if available'
'run:run `node` on <version> with <args> as arguments. Uses .nvmrc if available'
'current:list installed versions'
'ls:list installed versions or versions matching a given description'
'version:resolve the given description to a single local version'
'version-remote:resolve the given description to a single remote version'
'ls-remote:list remote versions available for install'
'deactivate:undo effects of NVM on current shell'
'deactivate:undo effects of `nvm` on current shell'
'alias:show or set aliases'
'unalias:deletes an alias'
'copy-packages:install global NPM packages to current version'
'reinstall-packages:reinstall global `npm` packages contained in <version> to current version'
'unload:unload `nvm` from shell'
'which:display path to installed node version. Uses .nvmrc if available'
)
_arguments -C '*:: :->subcmds' && return 0
......@@ -23,4 +30,4 @@ _arguments -C '*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "nvm subcommand" _1st_arguments
return
fi
\ No newline at end of file
fi
# Nyan plugin
This plugin adds a command to display [Nyan Cat](https://en.wikipedia.org/wiki/Nyan_Cat) right inside your terminal.
**Plugin is deprecated**. Check [official repo](https://github.com/klange/nyancat) for more information.
\ No newline at end of file
if [[ -x `which nc` ]]; then
alias nyan='nc -v nyancat.dakko.us 23' # nyan cat
fi
print -Pn '%F{yellow}'
cat >&2 <<-EOD
nyan plugin:
The nyancat server used by this plugin was shut down due to increased
bandwidth costs, so the nyan plugin no longer works. You can get the
same functionality in some distributions by installing the nyancat package,
or you can compile it yourself.
See https://github.com/klange/nyancat for more information.
EOD
print -Pn '%f'
......@@ -42,19 +42,20 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## Commands
| Command | Description |
| :-------------- | :----------------------------------------------- |
| `tab` | Open the current directory in a new tab |
| `split_tab` | Split the current terminal tab horizontally |
| `vsplit_tab` | Split the current terminal tab vertically |
| `ofd` | Open the current directory in a Finder window |
| `pfd` | Return the path of the frontmost Finder window |
| `pfs` | Return the current Finder selection |
| `cdf` | `cd` to the current Finder directory |
| `pushdf` | `pushd` to the current Finder directory |
| `quick-look` | Quick-Look a specified file |
| `man-preview` | Open a specified man page in Preview app |
| `showfiles` | Show hidden files |
| `hidefiles` | Hide the hidden files |
| `itunes` | Control iTunes. User `itunes -h` for usage details |
| `spotify` | Control Spotify and search by artist, album, track and etc.|
| Command | Description |
| :-------------- | :-------------------------------------------------- |
| `tab` | Open the current directory in a new tab |
| `split_tab` | Split the current terminal tab horizontally |
| `vsplit_tab` | Split the current terminal tab vertically |
| `ofd` | Open the current directory in a Finder window |
| `pfd` | Return the path of the frontmost Finder window |
| `pfs` | Return the current Finder selection |
| `cdf` | `cd` to the current Finder directory |
| `pushdf` | `pushd` to the current Finder directory |
| `quick-look` | Quick-Look a specified file |
| `man-preview` | Open a specified man page in Preview app |
| `showfiles` | Show hidden files |
| `hidefiles` | Hide the hidden files |
| `itunes` | Control iTunes. Use `itunes -h` for usage details |
| `spotify` | Control Spotify and search by artist, album, track… |
| `rmdsstore` | Remove .DS\_Store files recursively in a directory |
......@@ -209,7 +209,7 @@ if [[ ! -z "$playlist" ]]; then
opt="play"
else
opt="stop"
fi
fi
else
opt="set allPlaylists to (get name of every playlist)"
fi
......@@ -241,7 +241,7 @@ if [[ ! -z "$playlist" ]]; then
case "$state" in
on|off)
# Inspired by: http://stackoverflow.com/a/14675583
# Inspired by: https://stackoverflow.com/a/14675583
osascript 1>/dev/null 2>&1 <<-EOF
tell application "System Events" to perform action "AXPress" of (menu item "${state}" of menu "Shuffle" of menu item "Shuffle" of menu "Controls" of menu bar item "Controls" of menu bar 1 of application process "iTunes" )
EOF
......@@ -282,3 +282,8 @@ source ${ZSH}/plugins/osx/spotify
# Show/hide hidden files in the Finder
alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hidefiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Remove .DS_Store files recursively in a directory, default .
rmdsstore() {
find "${@:-.}" -type f -name .DS_Store -delete
}
......@@ -408,7 +408,7 @@ while [ $# -gt 0 ]; do
uri=`osascript -e 'tell application "Spotify" to spotify url of current track'`;
remove='spotify:track:'
url=${uri#$remove}
url="http://open.spotify.com/track/$url"
url="https://open.spotify.com/track/$url"
if [ "$2" = "" ]; then
cecho "Spotify URL: $url"
......
......@@ -6,11 +6,17 @@
# Brian Mattern <rephorm@rephorm.com>
# Jason A. Donenfeld <Jason@zx2c4.com>.
# All Rights Reserved.
#
# This file is licensed under the GPLv2+.
# Please visit http://git.zx2c4.com/password-store/tree/COPYING for more information.
# Please visit https://git.zx2c4.com/password-store/tree/COPYING for more information.
# If you use multiple repositories, you can configure completion like this:
#
# Oh my zsh plugin maintainer: Santiago Borrazás <sanbor@gmail.com>
# compdef _pass workpass
# zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass"
# workpass() {
# PASSWORD_STORE_DIR=$HOME/work/pass pass $@
# }
_pass () {
......@@ -117,8 +123,9 @@ _pass_cmd_show () {
}
_pass_complete_entries_helper () {
local IFS=$'\n'
local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
_values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort):-""}
local prefix
zstyle -s ":completion:${curcontext}:" prefix prefix || prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
_values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#' | sort):-""}
}
_pass_complete_entries_with_subdirs () {
......
# pep8 plugin
This plugin adds completion for [pep8](https://pep8.readthedocs.io/en/release-1.7.x/#), a tool to check your Python code against some of the style conventions in [PEP 8](http://www.python.org/dev/peps/pep-0008/).
To use it, add pep8 to the plugins array of your zshrc file:
```
plugins=(... pep8)
```
......@@ -4,13 +4,13 @@
Per directory history for zsh, as well as global history, and the
ability to toggle between them with ^G.
This is a implementation of per directory history for zsh, some
implementations of which exist in bash[1][],[2][]. It also implements
a per-directory-history-toggle-history function to change from using the
directory history to using the global history. In both cases the history is
always saved to both the global history and the directory history, so the
toggle state will not effect the saved histories. Being able to switch
between global and directory histories on the fly is a novel feature as far
This is a implementation of per directory history for zsh, some
implementations of which exist in bash[1][],[2][]. It also implements
a per-directory-history-toggle-history function to change from using the
directory history to using the global history. In both cases the history is
always saved to both the global history and the directory history, so the
toggle state will not effect the saved histories. Being able to switch
between global and directory histories on the fly is a novel feature as far
as I am aware.
This is a standalone repository for the script, however it is also included in
......@@ -34,7 +34,7 @@ Usage
Configuration
-------------------------------------------------------------------------------
* HISTORY_BASE a global variable that defines the base directory in which the
* HISTORY_BASE a global variable that defines the base directory in which the
directory histories are stored
* per-directory-history-toggle-history is the function to toggle the history
......@@ -42,14 +42,14 @@ Configuration
History
-------------------------------------------------------------------------------
The idea/inspiration for a per directory history is from [Stewart MacArthur][1]
and [Dieter][2], the implementation idea is from [Bart Schaefer][3]. The
The idea/inspiration for a per directory history is from [Stewart MacArthur][1]
and [Dieter][2], the implementation idea is from [Bart Schaefer][3]. The
implementation is by [Jim Hester][5] in September 2012.
[1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html
[2]: http://dieter.plaetinck.be/per_directory_bash
[3]: http://www.zsh.org/mla/users/1997/msg00226.html
[3]: https://www.zsh.org/mla/users/1997/msg00226.html
[4]: https://github.com/robbyrussell/oh-my-zsh
[5]: http://jimhester.com
[6]: http://github.com/jimhester/per-directory-history
[6]: https://github.com/jimhester/per-directory-history
......@@ -26,7 +26,7 @@
#
# [1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html
# [2]: http://dieter.plaetinck.be/per_directory_bash
# [3]: http://www.zsh.org/mla/users/1997/msg00226.html
# [3]: https://www.zsh.org/mla/users/1997/msg00226.html
#
################################################################################
#
......
## percol
Provides some useful function to make [percol](https://github.com/mooz/percol) work with zsh history and [jump plugin](https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/jump/jump.plugin.zsh)
### Requirements
```shell
pip install percol
```
And [jump](https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/jump/jump.plugin.zsh) for `oh-my-zsh` is a optional requirement.
### Usage
For default
- `^-r` bind to `percol_select_history`.You can use it to grep your history with percol.
- `^-b` bind to `percol_select_marks`.You can use it to grep your bookmarks with percol.
if which percol &> /dev/null; then
function percol_select_history() {
local tac
which gtac &> /dev/null && tac="gtac" || { which tac &> /dev/null && tac="tac" || { tac="tail -r" } }
BUFFER=$(fc -l -n 1 | eval $tac | percol --query "$LBUFFER")
CURSOR=$#BUFFER
zle -R -c
}
zle -N percol_select_history
bindkey '^R' percol_select_history
if which marks &> /dev/null; then
function percol_select_marks() {
BUFFER=$(marks | percol --query "$LBUFFER" | awk '{print $3}')
CURSOR=$#BUFFER # move cursor
zle -R -c # refresh
}
zle -N percol_select_marks
bindkey '^B' percol_select_marks
fi
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment