/
.functions
executable file
·28 lines (23 loc) · 1.12 KB
/
.functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function webcam {
uvcc --vendor 1133 --product 2139 set auto_focus 0
uvcc --vendor 1133 --product 2139 set absolute_focus 1
uvcc --vendor 1133 --product 2139 set absolute_zoom 100
uvcc --vendor 1133 --product 2139 set auto_white_balance_temperature 0
uvcc --vendor 1133 --product 2139 set white_balance_temperature 5600
uvcc --vendor 1133 --product 2139 set auto_exposure_mode 1
}
function silent() {
"$@" >& /dev/null
}
function opendb () {
[ ! -f .env ] && { echo "No .env file found."; exit 1; }
DB_CONNECTION=$(grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_HOST=$(grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PORT=$(grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_DATABASE=$(grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_USERNAME=$(grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PASSWORD=$(grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_URL="${DB_CONNECTION}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_DATABASE}"
echo "Opening ${DB_URL}"
open $DB_URL
}