Skip to content

Instantly share code, notes, and snippets.

@windsting
windsting / nginx-stat-failed-13-permission-denied.md
Last active January 24, 2025 18:08
fix: Nginx: stat() failed (13: permission denied)

Nginx: stat() failed (13: permission denied)

from https://stackoverflow.com/questions/25774999/nginx-stat-failed-13-permission-denied

Nginx operates within the directory, so if you can't cd to that directory from the nginx user then it will fail (as does the stat command in your log). Make sure the www-user can cd all the way to the /username/test/static. You can confirm that the stat will fail or succeed by running

sudo -u www-data stat /username/test/static
@windsting
windsting / use-vi-mode-in-tmux.md
Last active December 31, 2017 17:47
Use vi-mode in Tmux

Use vi-mode in Tmux

Reason

  • The default copy-mode in tmux vary from one to another operating system
  • The emacs-mode set Start selection to C-Space, which always been used by OS as Switch Input Method between ...

How

  1. Add this line in the config file, i.e: ~/.tmux.conf:
@windsting
windsting / replace_the_spaces_in_filenames_with_underscore.md
Created December 31, 2017 06:05
How to replace the spaces in filenames with underscore

How to replace the spaces in filenames with underscore

TL;DR

for name in *; do mv "$name" "${name// /_}"; done

Source

@windsting
windsting / grab_google_image_urls.md
Last active June 29, 2020 06:52
grab image urls from google

execute these JavaScript snippet in a google image result page, you'll get those urls in a file named urls.txt:

// pull down jquery into the JavaScript console
var script = document.createElement('script');
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(script);

// grab the URLs
var urls = $('.rg_di .rg_meta').map(function(){return JSON.parse($(this).text()).ou;});
@windsting
windsting / Tmux -- Desktop of CLI
Last active November 28, 2017 15:37
Tmux -- Desktop of CLI
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="keywords" content="remark,remarkjs,markdown,slideshow,presentation" />
<meta name="description" content="A simple, in-browser, markdown-driven slideshow tool." />
<title>Remark</title>
<style>
@import url(https://fonts.googleapis.com/css?family=Droid+Serif);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@windsting
windsting / how-to-list-installed-font-families-on-windows.md
Created November 24, 2017 05:42
How to list installed font families on Windows

Run this command in PowerShell window:

[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
(New-Object System.Drawing.Text.InstalledFontCollection).Families
@windsting
windsting / useful_git_commands.md
Last active November 16, 2017 04:10
Useful git command

Useful git command

  1. git checkout for Remote Branches
    $ git checkout --track origin/newsletter
    Branch newsletter set up to track remote branch newsletter from origin.
    Switched to a new branch 'newsletter'
@windsting
windsting / useful_docker_commands.md
Created October 28, 2017 09:10
Docker commands

Useful docker commands

Remove dangling docker images

docker image prune

Remove old Docker containers

docker container prune
@windsting
windsting / list-repository-on-private-docker-registry-v2.md
Created August 11, 2017 07:30
List repository on private docker registry v2.
@windsting
windsting / Use_tmux_on_Windows.md
Last active September 7, 2017 03:14
Use tmux on windows -- A quick way

Use tmux on Windows -- A quick way (在 Windows 上使用 tmux —— 捷径)

  • Read the language you prefer, they have the same cotent.
    挑你习惯的语言看,内容是一样的。
  • TL;DR
    捞干的
  1. Download zip file -- Official link.
    下载 压缩包 -- 官方链接
  2. Unzip it, and run the install.bat inside.
    解压缩,运行里面的 install.bat