Skip to content

Instantly share code, notes, and snippets.

View amjltc295's full-sized avatar

Ya-Liang Chang (Allen) amjltc295

View GitHub Profile
@vithalreddy
vithalreddy / gd-drive-file-download.sh
Last active September 17, 2019 08:20
Shell Script To Download Google Drive Files from terminal
#!/bin/bash
read -p "Enter File Id: " fileid
read -e -p "Enter File Dir: " "path_to_download_dir" dir #replce with your download dir path ~/Downloads
cd ~/$dir
echo "File will be downloaded in dir: ~/{$dir}"
curl -c ./$fileid -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
@tanyuan
tanyuan / fcitx-chewing.png
Last active February 26, 2023 14:20
Ubuntu: fcitx + chewing 新酷音輸入法
fcitx-chewing.png
@d2s
d2s / install-go-to-with-bash-script.md
Last active May 10, 2023 22:45
Installing Go with command line

NOTE: This is heavily outdated Gist snippet from 2017.


Install Go language with a Bash script

Another alternative to installing Go is to use a simple Bash script. It will download and install Go language under of your own user account.

Note that a system-wide installation might be better for some things

@pkuczynski
pkuczynski / parse_yaml.sh
Last active June 15, 2024 20:30
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}