Skip to content

Instantly share code, notes, and snippets.

View vladalive's full-sized avatar
🏳️
voice for peace

Vlad Alive vladalive

🏳️
voice for peace
View GitHub Profile
@vladalive
vladalive / gdrive_download.md
Created May 16, 2019 14:38
Download Google Drive files from linux terminal via wget

Setup:

  1. Add this code to your ~/.bash_aliases file.
function gdrive_download () {
  CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
  wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
  rm -rf /tmp/cookies.txt
}
text.gsub(/\w+/){ |w| a = w.split(/^(.)(.*)(.+)$/); a[2] = a[2] && a[2].split(//).shuffle; a.join}