Skip to content

Instantly share code, notes, and snippets.

View mtx-z's full-sized avatar

Mtx Z mtx-z

View GitHub Profile
@mtx-z
mtx-z / [nginx] laravel remove index.php from url
Last active February 11, 2021 19:43 — forked from slow-is-fast/laravel remove index.php from url.md
[nginx] laravel remove index.php from url
# Remove index.php$
if ($request_uri ~* "^(.*/)index\.php$") {
return 301 $1;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
# Remove from everywhere index.php
if ($request_uri ~* "^(.*/)index\.php(/?)(.*)") {
Download Google Drive files with WGET
- replace FILEID with your Google Drive FILEID
- Google Drive file must have a public shared URL (file share options)
- will create a /tmp/cookies.txt to save cookies, and handle Google Drive "Big files" download verification
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt