Skip to content

Instantly share code, notes, and snippets.

@orivee
orivee / .zshrc
Created July 27, 2019 08:29 — forked from zserge/.zshrc
autoload -U compinit colors vcs_info
colors
compinit
REPORTTIME=3
HISTFILE=~/.zhistory
HISTSIZE=5000
SAVEHIST=5000
setopt INC_APPEND_HISTORY
setopt EXTENDED_HISTORY
@orivee
orivee / tutorial.md
Created November 10, 2018 07:29 — forked from Hengjie/tutorial.md
How to passthrough SATA drives directly on VMWare ESXI 6.5 as RDMs

How to passthrough SATA drives directly on VMWare EXSI 6.5 as RDMs

There aren't many tutorials about this, the only tutorials I've found were about passing through entire PCIe cards to VMs, or refered to old ESXI versions (below 6.5) that used a more comprehensive desktop client instead of the web app. In v6.5, the web app was introduced and the desktop client was deprecated. You used to be able to setup RDMs in the desktop client, but with the introduction of the web console, this is no longer the case. This tutorial shows you how to pass SATA HDDs to the virtual machine on VMWare ESXI 6.5. This tutorial is partially based on VMWare's own KB and the now deprecated Forza IT blog post.

Summary

We attach the SATA HDDs as a RDM (Raw Device Mapper) into an existing virtual disk in the command line, then on the web app

@orivee
orivee / archlinux-virtualbox.sh
Created August 8, 2018 02:36 — forked from GabLeRoux/archlinux-virtualbox.sh
Virtualbox archlinux notes
# sudo /sbin/rcvboxdrv -h
# Unloading modules:
# Loading modules: modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxnetflt not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxpci not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.4.3-1-ARCH
# Solution
# from https://forum.antergos.com/topic/818/can-t-run-my-vitualbox/4
@orivee
orivee / gist:f55556aa80f4758812c452d858915b7d
Created August 4, 2018 10:02 — forked from romainl/gist:9970697
How to use Tim Pope's Pathogen

How to use Tim Pope’s Pathogen

I’ll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/ with $HOME\vimfiles\ and forward slashes with backward slashes.

The idea

Vim plugins can be single scripts or collections of specialized scripts that you are supposed to put in “standard” locations under your ~/.vim/ directory. Syntax scripts go into ~/.vim/syntax/, plugin scripts go into ~/.vim/plugin, documentation goes into ~/.vim/doc/ and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.

This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/, where each directory simulates the standard structure of your ~/.vim/ directory.

@orivee
orivee / socks_proxy_2_http_proxy.md
Created July 19, 2018 05:26
How to convert SOCKS proxy (e.g Shadowsocks) to HTTP proxy

How to convert SOCKS proxy (e.g Shadowsocks) to HTTP proxy

Step 1

Install Privoxy

brew install privoxy
@orivee
orivee / unzip3_gbk.py
Created June 6, 2018 05:17 — forked from wangjiezhe/unzip3_gbk.py
解决zip文件中文乱码问题
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
unzip3_gbk.py: Deal with zip files using encoding GB2312/GBK/GB18030
"""
import os
# import sys
import argparse
import zipfile
@orivee
orivee / OpenWithSublime.bat
Created November 18, 2017 10:36 — forked from jcppkkk/OpenWithSublime.bat
Add context menu to allow user open file or folder with Sublime as User (or as Admin).
@echo off
:: Path to Sublime Text installation dir.
SET stPath=%~dp0sublime_text.exe
SET stPathOnly=%~dp0
:: Key name for the registry entries.
SET UserEntry=Sublime Text
SET AdminEntry=Sublime Text As Admin
:: Context menu texts.
SET "UserMenuText=Open with Sublime(&-)"
SET "AdminMenuText=Open with Sublime As Admin(&+)"
@orivee
orivee / extend.sh
Created November 12, 2017 02:07 — forked from wvengen/extend.sh
Extend non-HiDPI external display above HiDPI internal display
#!/bin/sh
# extend non-HiDPI external display on DP* above HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1`
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'`
@orivee
orivee / vimrc
Created August 21, 2017 12:32 — forked from keelii/vimrc
vimrc for window
" ------------------------------
" Name: vimrc for windows
" Author: keelii
" Email: keeliizhou@gmail.com
" ------------------------------
" Startup {{{
filetype indent plugin on
augroup vimrcEx
@orivee
orivee / gist:863ebd0b36a98e99f48bb5eed2c10b3e
Created August 13, 2017 01:57 — forked from rpuntaie/gist:8510218
Build VIM on MinGW/MSYS with support for all interpreters

I recently had to make myself comfortable on a Windows box, which meant installing VIM and python. And being at compiling VIM I compiled it with support for other interpreters as well.

I made a gvim74.exe installation file, like the one you get from http://www.vim.org/download.php, but with the newest batches and the interpreter versions of my choice.

Preparations