GithubHelp home page GithubHelp logo

configuration's Introduction

Configuration

Vonng's configuration files (Mostly bash)

Install

make

Install Bash 4.x in MacOS

since macOS use bash 3.x by default due to GPL issue , you may consider upgrade to bash 4.x manually.

# Step 1 : Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Step 2 : Install Bash via homebrew
brew update && brew install bash

# Step 3 : Register 4.x bash
sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'

# Step 4 : Change your default bash
chsh -s /usr/local/bin/bash

# Notice : use `#!/usr/bin/env bash` instead of `#!/bin/bash` in scripts
# Notice : Change IEDA-Settings-Terminal to use /usr/local/bin/bash

Example

Lot's of bash utils, here is exmaple of library color and log

#!/usr/bin/env bash


source ${HOME}/.shit/main

import color
import log

log_level debug
log_time_fmt datetime

log_debug '`log_level debug` `log_time_fmt datetime` debug message'
log_info info level message, now set LOG_LEVEL from debug to info

log_level info
log_warn $(color_msg r "datetime") "Warning: set log level to info, debug message will no longer displayed"
log_debug "now you can't see debug message"
log_info "but you can still see info message"

log_time_fmt t
log_info "time fmt set to short time fmt: " '`log_time_fmt time`'
log_error $(color_msg r Hello) $(color_msg blue world)

#log_fatal "fatal message will exit script directly"
log_info "So no chance you could see this"
log_warn "this time log will put to ./log file"


# switch output to file (disable color)
# LOG_PATH="./log"

And here comes the output:

Description

configuration's People

Contributors

vonng 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.