Skip to content

Instantly share code, notes, and snippets.

View wanglf's full-sized avatar

wanglf wanglf

View GitHub Profile
@wanglf
wanglf / postgres_lock_monitoring.org
Last active April 11, 2017 05:13
Сombination of blocked and blocking activity
  • postgres lock monitoring 01
SELECT blocked_locks.pid     AS blocked_pid,
       blocked_activity.usename  AS blocked_user,
       blocking_locks.pid     AS blocking_pid,
       blocking_activity.usename AS blocking_user,
       blocked_activity.query    AS blocked_statement,
       blocking_activity.query   AS current_statement_in_blocking_process
 FROM  pg_catalog.pg_locks         blocked_locks
  JOIN pg_catalog.pg_stat_activity blocked_activity  ON blocked_activity.pid = blocked_locks.pid
#!/bin/sh
# Userland mode (~$USER/), (~/).
# ~/.fonts is now deprecated and that
#FONT_HOME=~/.fonts
# ~/.local/share/fonts should be used instead
FONT_HOME=~/.local/share/fonts
echo "installing fonts at $PWD to $FONT_HOME"
mkdir -p "$FONT_HOME/adobe-fonts/source-code-pro"
@wanglf
wanglf / vscode-extension-offline.md
Last active July 16, 2024 07:34
Download VS Code extensions as VSIX

How to use?

  • Copy content of vsix-bookmarklet, create a bookmark in your browser.
  • Navigate to the web page of the VS Code extension you want to install.
  • Click the bookmark you just created, then click the download button.
    download
  • After download finished, rename the file extension to *.vsix.
  • In VS Code, select Install from VSIX... in the extension context menu.
    vsc
@wanglf
wanglf / shell.org
Created January 29, 2018 01:23
Some Shell Examples

Find usage

find path_A -name '*AAA*' -exec mv -t path_B {} +
@wanglf
wanglf / youtube-dl-wrapper.sh
Last active February 10, 2018 09:23
youtube downloader wrapper
#!/usr/local/bin/bash
download_video()
{
options="-f best --proxy http://192.168.1.51:8123"
url=$1
RESULT=1
echo "options: $options"
echo "url: $url"
count=0