Skip to content

Instantly share code, notes, and snippets.

View zhiyue's full-sized avatar
🌻
just do it.

zhiyue zhiyue

🌻
just do it.
View GitHub Profile
@zhiyue
zhiyue / GitConfigHttpProxy.md
Created March 29, 2022 08:49 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@zhiyue
zhiyue / SpaceFn.json
Created November 2, 2021 06:37 — forked from tshu-w/SpaceFn.json
Karabiner Elements config to simulate SpaceLauncher
{
"title": "SpaceFN",
"rules": [
{
"description": "SpaceFN: Space enables SpaceFN mode (see: https://geekhack.org/index.php?topic=51069.0)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar"
@zhiyue
zhiyue / SpaceFn.json
Created November 2, 2021 06:37 — forked from tshu-w/SpaceFn.json
Karabiner Elements config to simulate SpaceLauncher
{
"title": "SpaceFN",
"rules": [
{
"description": "SpaceFN: Space enables SpaceFN mode (see: https://geekhack.org/index.php?topic=51069.0)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar"
@zhiyue
zhiyue / linux configuration
Created August 7, 2021 08:12 — forked from leyafo/linux configuration
Remapping Capslock to control on Linux console
# You can use set keymap on X window easily, this configuration just tell you how to remapping the Capslock to control
# it based on these two articles:
# http://www.noah.org/wiki/CapsLock_Remap_Howto
# https://wiki.archlinux.org/title/Linux_console/Keyboard_configuration
# we use loadkeys for setting.
# copy the `dumpkeys` output to our configuration file
sudo mkdir -p /usr/local/share/kbd/keymaps
@zhiyue
zhiyue / pragmatapro-font-lock-symbols-v2.el
Created June 30, 2021 08:33 — forked from DeLaGuardo/pragmatapro-font-lock-symbols-v2.el
Snippet for support ligatures from PragmataPro font in Emacs
;; Enable ligatures without prettify-symbols
(provide 'add-pragmatapro-symbol-keywords)
(defconst pragmatapro-fontlock-keywords-alist
(mapcar (lambda (regex-char-pair)
`(,(car regex-char-pair)
(0 (prog1 ()
(compose-region (match-beginning 1)
(match-end 1)
@zhiyue
zhiyue / export.sh
Created June 25, 2021 17:12 — forked from jazzqi/export.sh
Export apps installed by brew, brew cask and Mac App Store(using mas)
#!/bin/bash
echo -e '#!/bin/bash\n' > list.sh
echo -e '########### Brew Install List ###########' >> list.sh
brew leaves | sed 's/^/brew install /' >> list.sh &&
echo -e '\n########### Brew Cask Install List ###########' >> list.sh &&
brew cask list | sed 's/^/brew cask install /' >> list.sh &&
echo -e '\n########### Mac App Store Install List ###########' >> list.sh &&
@zhiyue
zhiyue / SecureCRT solarized dark
Created June 18, 2021 09:23 — forked from gtt116/SecureCRT solarized dark
solarized dark color scheme for VanDyke SecureCRT
solarized dark color scheme for VanDyke SecureCRT (c.f. http://ethanschoonover.com/solarized )
edit %appdata%\VanDyke\Config\Global.ini, find the line marked B:"ANSI Color RGB" and replace the two hex strings below it with the ones listed here:
B:"ANSI Color RGB"=00000040
07 36 42 00 dc 32 2f 00 85 99 00 00 b5 89 00 00 26 8b d2 00 d3 36 82 00 2a a1 98 00 ee e8 d5 00
00 2b 38 00 cb 4b 16 00 58 6e 75 00 65 7b 83 00 83 94 96 00 6c 71 c4 00 93 a1 a1 00 fd f6 e3 00
@zhiyue
zhiyue / PVE-host-backup.md
Created May 2, 2021 12:54 — forked from mrpeardotnet/PVE-host-backup.md
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup
@zhiyue
zhiyue / fetch-dev-secrets-from-vault.sh
Created May 2, 2021 12:10 — forked from shtratos/fetch-dev-secrets-from-vault.sh
Bash script to fetch and store secrets from Azure KeyVault
#!/usr/bin/env bash
#
# Fetch secrets for local development from Azure KeyVault
# and print them to stdout as a bunch of env var exports.
# These secrets should be added to your local .env file
# to enable running integration tests locally.
#
KEY_VAULT=$1
function fetch_secret_from_keyvault() {
@zhiyue
zhiyue / youtube-dl.sh
Created November 5, 2020 04:06 — forked from HouCoder/youtube-dl.sh
A shell script for automatic downloading your YouTube playlist.
#!/bin/bash
# Use $ which youtube-dl to get the path.
youtube_dl_path=/usr/local/bin/youtube-dl
# https://askubuntu.com/a/157787
if ps aux | grep -v grep | grep $youtube_dl_path > /dev/null
then
echo "youtube-dl is running"
exit 1