EExcel 丞燕快速查詢2

EExcel 丞燕快速查詢2
EExcel 丞燕快速查詢2 https://sandk.ffbizs.com/
顯示具有 shell 標籤的文章。 顯示所有文章
顯示具有 shell 標籤的文章。 顯示所有文章

ethereum docker geth shell for geth attach and tail log

Help use docker geth for geth attach and watch log. Geth Command line path need to change for yourself env.



#!/bin/sh
IFS=$'\n'
echo $1
echo $2

case $2 in
    attach) docker exec -it $(docker ps -a --no-trunc  | grep $1 | awk '{print $1}') geth attach --datadir=/root/.ethereum/devchain
        ;;
    log) docker exec -it $(docker ps -a --no-trunc  | grep $1 | awk '{print $1}') tail -n 30 -f /root/geth.log
        ;;
    sh) docker exec -it $(docker ps -a --no-trunc  | grep $1 | awk '{print $1}') sh
        ;;
    bash) docker exec -it $(docker ps -a --no-trunc  | grep $1 | awk '{print $1}') bash
        ;;
    *)  echo "command parms1: docker container name"
        echo "command parms2: attach (geth attach) or log (tail -n 30 -f) or sh or bash"
esac

linux .bashrc


# General Aliases
    alias apk='apk --progress'
    alias ll="ls -ltan"

    alias hosts='cat /etc/hosts'
    alias ..="cd .."
    alias ...="cd ../.."
    alias ....="cd ../../.."
    alias untar="tar xzvkf"
    alias mv="mv -nv"
    alias cp="cp -i"
    alias ip4="ip -4 addr"
    alias ip6="ip -6 addr"

    COL_YEL="\[\e[1;33m\]"
    COL_GRA="\[\e[0;37m\]"
    COL_WHI="\[\e[1;37m\]"
    COL_GRE="\[\e[1;32m\]"
    COL_RED="\[\e[1;31m\]"

    # Bash Prompt
    if test "$UID" -eq 0 ; then
        _COL_USER=$COL_RED
        _p=" #"
    else
        _COL_USER=$COL_GRE 
        _p=">"
    fi
    COLORIZED_PROMPT="${_COL_USER}\u${COL_WHI}@${COL_YEL}\h${COL_WHI}:\w${_p} \[\e[m\]"
    case $TERM in
        *term | rxvt | screen )
            PS1="${COLORIZED_PROMPT}\[\e]0;\u@\h:\w\007\]" ;;
        linux )
            PS1="${COLORIZED_PROMPT}" ;;
        * ) 
            PS1="\u@\h:\w${_p} " ;;
    esac