Skip to content

Instantly share code, notes, and snippets.

View ilaipi's full-sized avatar
🇨🇳

杨亚梦 ilaipi

🇨🇳
  • 上海~静安
View GitHub Profile
@Ta180m
Ta180m / WSL 2 GNOME Desktop.md
Last active April 25, 2024 13:11
Set up a GNOME desktop environment on WSL 2

WSL 2 GNOME Desktop

NOTE: If you want the ultimate Linux desktop experience, I highly recommend installing Linux as your main OS. I no longer use Windows (except in a VM) so I will not be maintaining this guide anymore.

Think Xfce looks dated? Want a conventional Ubuntu experience? This tutorial will guide you through installing Ubuntu's default desktop environment, GNOME.

GNOME is one of the more complex — and that means more difficult to run — desktop environments, so for years people couldn't figure [o

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 25, 2024 14:57
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@binura-g
binura-g / single-line-cert.sh
Last active April 20, 2024 00:09
Convert Certificates ( .pem, / .crt / etc ) into single-line strings for JSON payloads
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem
@wkliwk
wkliwk / btt.sh
Last active March 30, 2024 15:22
BTT reset trial time
# BetterTouchTool reset trial time
# ** All preference will reset
echo "remove ~/Library/Preferences/com.hegenberg.BetterTouchTool.plist"
rm -rf ~/Library/Preferences/com.hegenberg.BetterTouchTool.plist
echo "Done"
echo "remove ~/Library/Application\ Support/BetterTouchTool/"
rm -rf ~/Library/Application\ Support/BetterTouchTool/
echo "Done"
@mpneuried
mpneuried / postgres_add_json_sub_array_unique.sql
Last active April 5, 2023 11:35
Add and remove elements unique to a Postgres jsonb sub key: Short a Set implemetation
UPDATE public.mytable SET
jsonfieldname = jsonb_set( jsonfieldname, '{json_obj_key}', array_to_json(
ARRAY(
SELECT DISTINCT( UNNEST( ARRAY(
SELECT json_array_elements_text( COALESCE( jsonfieldname::json->'json_obj_key', '[]' ) )
) || ARRAY['Element to add'] ) )
)
)::jsonb )
WHERE id = 23
RETURNING *;
@j-jith
j-jith / howto-compile-vim.md
Last active November 6, 2023 17:30
How to compile and install Vim 8.0 on Ubuntu

Install build dependencies

$ sudo apt-get build-dep vim

Clone git repo

$ git clone https://github.com/vim/vim.git

Change to src directory

@katopz
katopz / install-docker-exp.sh
Last active December 19, 2020 11:41
Install Docker on Ubuntu 14.04.4 x64
# Install Docker on Ubuntu 14.04.4 x64
# Ref https://docs.docker.com/engine/installation/linux/ubuntulinux/
# No interactive for now.
export DEBIAN_FRONTEND=noninteractive
# Update your APT package index.
sudo apt-get -y update
# Update package information, ensure that APT works with the https method, and that CA certificates are installed.
sudo apt-get -y install apt-transport-https ca-certificates
# Add the new GPG key.
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 18, 2024 18:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@gosukiwi
gosukiwi / .vimrc
Last active February 24, 2020 06:01
.vimrc
" ---------------------- USABILITY CONFIGURATION ----------------------
" Basic and pretty much needed settings to provide a solid base for
" source code editting
" don't make vim compatible with vi
set nocompatible
" turn on syntax highlighting
syntax on
" and show line numbers
@denji
denji / nginx-tuning.md
Last active April 24, 2024 19:39
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.