Skip to content

Instantly share code, notes, and snippets.

View webee's full-sized avatar
🎯
Focusing

webee.yw webee

🎯
Focusing
View GitHub Profile
@webee
webee / _Magento2_DeleteTestData.md
Created July 11, 2021 06:42 — forked from leek/_Magento2_DeleteTestData.md
Magento 2 - Delete All Test Data

These set of scripts are for Magento 2. For Magento 1, see this Gist.

@webee
webee / ubuntu_adding_ca_certs.md
Created May 10, 2021 17:59 — forked from leommoore/ubuntu_adding_ca_certs.md
Ubuntu - Adding CA Certs

#Ubuntu - Adding CA Certs

To add new Certificate Authority (CA) certs:

  1. Create a directory (ie extra) in the ca-certs to hold the new certs

    sudo mkdir /usr/share/ca-certificates/extra

  2. Copy or move the certs into the new directory

@webee
webee / .ssh_config
Created May 8, 2021 19:50 — forked from andyvanee/.ssh_config
Fix unix_listener too long for Unix domain socket
Host *
ControlPath ~/.ssh/control/%C
ControlMaster auto
@webee
webee / .gitignore
Created December 16, 2018 05:11 — forked from chichunchen/.gitignore
Git ignore binary files
# Ignore all
*
# Unignore all with extensions
!*.*
# Unignore all dirs
!*/
### Above combination will ignore all files without extension ###
@webee
webee / postgres_queries_and_commands.sql
Created March 22, 2018 03:25 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@webee
webee / pathmunge
Created April 6, 2017 15:59
pathmunge
function pathmunge {
if echo $PATH | /usr/bin/egrep -q "(^|:)$1($|:)";then
a=${1//\//\\\/}
PATH=$(echo $PATH|/usr/bin/sed -e "s/\([:^]*\)$a\([$:]*\)/\1\2/g")
PATH=$(echo $PATH|/usr/bin/sed -e 's/::/:/g'|/usr/bin/sed -e 's/^://g'|/usr/bin/sed -e 's/:$//g')
fi
if [ "$2" = "after" ];then
PATH=$PATH:$1
else
PATH=$1:$PATH
@webee
webee / mytmux.sh
Created April 6, 2017 15:56
mytmux.sh
#!/bin/bash
if [ "$1" == '.' ];then
shift;
exec tmux $*
exit 0
fi
name=$1
n=$2
if [ "$name" == "" ];then
@webee
webee / .vimrc
Created April 6, 2017 15:52
vim configs.
" vimrc
"
" Maintainer: webee.yw <webee.yw@gmail.com>
" Last change: 2013.11
"
" 使用vim的配置,必须放在最前面,会对其它设置产生影响
set nocompatible
let mapleader = ","
@webee
webee / .tmux.conf
Created January 17, 2017 12:50
my tmux config.
set -g prefix ^a
unbind ^b
bind a send-prefix
set -g mode-keys vi
set -g status-utf8 on
setw -g utf8 on
# window select.
bind-key -n F1 previous-window