Giter VIP home page Giter VIP logo

bifzf's Introduction

bash implementation of fuzzy finder

This is for a poor target machine or temporary .bashrc setting login environment.

how to use

ls | bifzf

seq 1 30 | BIFZF_MAX_LINE=20 bifzf

e.g.

function docker-exec () {
  local container_id=$(docker ps | bifzf | awk '{print $1}')
  [[ -z $container_id ]] && return
  docker exec -it $container_id /bin/bash
}

BLACK=$'\e[30m' RED=$'\e[31m' GREEN=$'\e[32m' YELLOW=$'\e[33m' BLUE=$'\e[34m' PURPLE=$'\e[35m' LIGHT_BLUE=$'\e[36m' WHITE=$'\e[37m' GRAY=$'\e[90m' DEFAULT=$'\e[0m'

# kubectl log fzf
function klf() {
  clear
  local kpod_line=$(kubectl get pods -A | BIFZF_MAX_LINE=30 fzf)
  [[ -z $kpod_line ]] && return
  local namespace=$(echo $kpod_line | awk '{print $1}')
  local name=$(echo $kpod_line | awk '{print $2}')
  echo kubectl logs pods/$name -n $namespace
  echo "${GREEN}kubectl logs pods/$name -n $namespace ${DEFAULT}"
}

# kubectl describe fzf
function kdf() {
  clear
  local kpod_line=$(kubectl get pods -A | BIFZF_MAX_LINE=30 fzf)
  [[ -z $kpod_line ]] && return
  local namespace=$(echo $kpod_line | awk '{print $1}')
  local name=$(echo $kpod_line | awk '{print $2}')
  kubectl describe pods/$name -n $namespace
  echo "${GREEN}kubectl describe pods/$name -n $namespace ${DEFAULT}"
}

bifzf's People

Contributors

umaumax avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.