Skip to content

Instantly share code, notes, and snippets.

@dedy-purwanto
dedy-purwanto / gist:11312110
Created April 26, 2014 05:00
Bulk remove iTerm2 color schemes.
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist
@xfanwu
xfanwu / xxf.zsh-theme
Last active June 14, 2024 21:45
Yet another theme for oh-my-zsh
# Copy and self modified from ys.zsh-theme, the one of default themes in master repository
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
# http://xiaofan.at
# 2 Jul 2015 - Xiaofan
# Machine name.
function box_name {
# coding=utf-8
def trunc(s, limit, coding="UTF-8", postfix="..."):
'''
works both on python2 and python3
'''
unicode_s = s.decode(coding) if type(s) == bytes else s
nums = (len(u.encode(coding)) for u in unicode_s)
sum, i = 0, 0
use_postfix = ""
@towry
towry / setup_vpn.md
Last active June 22, 2019 22:06
Installing a vps and setup vpn

Initialize the server.

  1. login as root user.
    • ssh root@server_ip_address
  2. create a new user:
    • adduser username
    • Use the usermod command to add the user to the sudo group. usermod -aG sudo username
    • Test sudo access on new user account. su - username
  3. login as new created user.