Skip to content

Instantly share code, notes, and snippets.

View chrisniael's full-sized avatar
:octocat:
Happy githubbing.

沈煜 chrisniael

:octocat:
Happy githubbing.
View GitHub Profile
@lilydjwg
lilydjwg / gh-check
Last active September 26, 2024 09:12
gh-check: speed test to known GitHub IPs
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
@davialexandre
davialexandre / gruvbox_dark.json
Created June 23, 2019 18:09
Gruvbox Dark color scheme for the new Windows Terminal
{
"background" : "#282828",
"black" : "#282828",
"blue" : "#458588",
"brightBlack" : "#928374",
"brightBlue" : "#83A598",
"brightCyan" : "#8EC07C",
"brightGreen" : "#B8BB26",
"brightPurple" : "#D3869B",
"brightRed" : "#FB4934",
@fengyuentau
fengyuentau / readme.md
Last active July 30, 2024 22:52
Enable X11 forward for ssh to load images from remote server on MacOS Mojave

Enable X11 forward to load images from remote server on MacOS Mojave

Steps

  1. Install Xquartz to get X11 support on MacOS. You can google Xquartz and download it from its official site, or install using HomeBrew.

    brew cask install xquartz
  2. Launch Xquartz. Go to Preference -> Security, click the box Allow connections from clients. NOTE: You have to lauch Xquartz with Allow connections from clients enable everytime you want to ssh to remote server with X11 forwarding support.

@jonarchist
jonarchist / Export Safari passwords.md
Last active April 13, 2023 20:00
Exporting Safari website passwords to a CSV file (1Password-compatible)

I'm a new 1Password user and recently tried to export all my passwords saved in iCloud Keychain to import them in 1Password. Unfortunately, none of the existing recipes worked for me, because moving the saved passwords from iCloud Keychain to a local keychain seems to be broken as of today (28 Aug 2018). So I came up with a different method.

This method works entirely using AppleScript, and only for website passwords (not for other kinds of logins such as file servers, etc.). Basically, the script toggles back and forth between Safari's Preferences window and TextEdit, copying each username and password combination via the clipboard.

@yougg
yougg / proxy.md
Last active September 10, 2024 13:53
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@mohnish
mohnish / Mintty.md
Last active February 23, 2024 17:03 — forked from appikonda/Mintty.md
Mintty Themes for Windows

Create .mintty folder with subfolder themes in c:\Users\< >

 Example:
 C:\Users\sandeep\.mintty\themes

Download '.minttyrc' files from https://github.com/iamthad/base16-mintty and add them to themes folder.

@hsipeng
hsipeng / Makefile
Created November 20, 2017 12:21
pandoc kindlegen 电子书生成
include_dir=build
source=chapters/*.md
title='Growth'
filename='growth'
all: html epub rtf pdf mobi
markdown:
awk 'FNR==1{print ""}{print}' $(source) > $(filename).md
@TimothyYe
TimothyYe / bench.sh
Created October 24, 2017 01:52
Bench test script
#!/usr/bin/env bash
#
# Description: Auto test download & I/O speed script
#
# Copyright (C) 2015 - 2016 Teddysun <i@teddysun.com>
#
# Thanks: LookBack <admin@dwhd.org>
#
# URL: https://teddysun.com/444.html
#
@deneschen
deneschen / 开启xterm终端256色和终端下vim 256色
Last active September 13, 2022 07:56
开启xterm终端256色和终端下vim 256色
相同的colorschema,vim和gvim的颜色差距还是很大的,因为gvim使用X的颜色,而vim只能使用终端提供的颜色,所以造成了二者的显示差异。
xterm开启256色
现在的终端模拟器早就支持256色了,不过默认可能还是8色的。
开启xterm终端,查看xterm终端支持的颜色
命令:
$ tput colors
8
@fearblackcat
fearblackcat / proxy_for_terminal.md
Last active September 7, 2024 18:43
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start