Skip to content

Instantly share code, notes, and snippets.

View s5unty's full-sized avatar

Sun Wuan s5unty

View GitHub Profile
@joulgs
joulgs / terminal.txt
Last active April 25, 2024 06:59
How install libssl1.1 on ubuntu 22.04
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
@merlinmann
merlinmann / wisdom.md
Last active April 17, 2024 21:52
Merlin's Wisdom Project (Draft)

Merlin's Wisdom Project

Or: “Everybody likes being given a glass of water.”

By Merlin Mann.

It's only advice for you because it had to be advice for me.

@kborovik
kborovik / How to use a GPG key for SSH authentication
Created October 8, 2020 12:28
How to use a GPG key for SSH authentication
# How to use a GPG key for SSH authentication
# Tested on Ubuntu 20.04 LTS
# Enable SSH support in gpg-agent:
echo enable-ssh-support > ~/.gnupg/gpg-agent.conf
# Cache GPG & SSH passwords for 24 hours (the reboot will clear the password cache)
echo max-cache-ttl 86440 >> ~/.gnupg/gpg-agent.conf
echo max-cache-ttl-ssh 86440 86440 >> ~/.gnupg/gpg-agent.conf
echo default-cache-ttl 86440 >> ~/.gnupg/gpg-agent.conf
@fanlushuai
fanlushuai / surfingkeys-config.txt
Last active March 31, 2024 03:32
surfingkeys-config
//=========================enjoy !!!=============================================
// 1. 输入流畅理念。修改F键的导航功能,按键生成策略。采用左边前两排+v,b的字符。保证不会生成rx,一些让手指弯曲过度的组合按键。使得输入更加流畅
// 2. 高频快速直达理念。搜索,使用独立的s关键字,使用最少的按键,来处理最高频的功能。同理,最直达的逻辑优化。h,直达历史,以及内置的b书签。通过原始的o前缀虽然也挺快,但是,还是处在一种没有优先级的状态。
// 3. 添加快速搜索的能力(可以抛弃一键切换插件)(注:xx可以表达为,域名的缩写,比如,github-gh,google-gg。自己可以改配置,加搜索引擎):
// a. ";+xx",携带当前关键字,切换搜索引擎进行搜索】(独有扩展)
// b. ";;+xx", 使用当前选中的内容,进行浏览器的搜索(内置,使用s+。这种更加易于,减轻快捷键的记忆负担。)
// c. ";;;+xx", 使用用户输入,在当前页面打开输入框,进行搜索(内置,使用s+,这种减轻记忆负担。同时因为在使用频率上,也就s频率高。所以,单独抽取了一个s键)
// d. "alt+s",快速的自动切换搜索引擎,按照顺序进行搜索
// e. "oa+xx",使用关键字,同时打开相同类型的搜索引擎,进行搜索。比如,一个关键字将同时打开,google,baidu。
// 4. 添加导航的功能,使用"m+xx"的方式,直接跳转到目标网站(独有扩展。可以抛弃导航插件了)
@mayneyao
mayneyao / notion2blog.js
Last active February 29, 2024 18:01
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 25, 2024 06:45
国内的 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+

@mcattarinussi
mcattarinussi / gpg-ssh-setup.md
Last active April 9, 2024 02:09
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@posener
posener / go-table-driven-tests-parallel.md
Last active April 4, 2024 19:45
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@napramirez
napramirez / ConvertLetsPemToPfx.sh
Created December 18, 2017 04:43
Convert LetsEncrypt Certificates to PFX
#!/bin/sh
#
# Copy of https://gist.githubusercontent.com/arichika/b1a1413b554734ae964f/raw/e657ad2dc4ddab60750d26e87add61f9b988d887/ConvertLetsPemToPfx.sh
#
pemsdir='/etc/letsencrypt/archive' # default search PEMs
pfxspath='/share/letsencrypt/archive' # dest of the PFXs
passfile='/share/letsencrypt/pass.txt' # password to be applied to the PFX file
for cnvifull in `find "${pemsdir}" -name 'cert*.pem' -o -name '*chain*.pem'`
@akash1233
akash1233 / pre-receive.sh
Last active April 16, 2024 02:38
pre-receive git hooks for checking the commit message
#!/bin/bash
#
# check commit messages for pivotal tracker issue numbers formatted as [#stort-id]along with commit message
REGEX="\[#[0-9]*\]"
ERROR_MSG="[POLICY] The commit doesn't reference a PIVOTAL tracker issue"
while read OLDREV NEWREV REFNAME ; do
for COMMIT in `git rev-list $OLDREV..$NEWREV`;
do
MESSAGE=`git cat-file commit $COMMIT | sed '1,/^$/d'`