Skip to content

Instantly share code, notes, and snippets.

@xykong
xykong / k8sdump.sh
Last active January 14, 2024 15:19
Export Kubernetes cluster resource to yaml.
#!/usr/bin/env bash
readonly SCRIPT=$(basename "$0")
readonly VERSION='1.0.0'
readonly AUTHOR='xy.kong@gmail.com'
readonly SOURCE='https://gist.github.com/xykong/6efdb1ed57535d18cb63aa8e20da3f4b'
# For script running robust
set -o nounset # to exit when your script tries to use undeclared variables
set -o errexit # to make your script exit when a command fails
@xykong
xykong / convert-video-h265.sh
Last active December 31, 2017 06:46
Convert all videos in the given folder to h265 format.
#!/bin/sh
path=`pwd`
dry=0
while test $# -gt 0
do
case "$1" in
--dry)
dry=1
@xykong
xykong / Create iOS Icons.jsx
Last active March 29, 2016 02:27 — forked from twonjosh/Create iOS Icons.jsx
Photoshop Script to Create iOS Icons from a source image
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
@xykong
xykong / osx-setup.sh
Last active February 17, 2016 09:15 — forked from ptmt/macOS-arm-setup.sh
Setting up fresh OS X
# 1. Install Brew (warning: at least read install at first)
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# 2. Install Brew Cask
# -- brew install caskroom/cask/brew-cask # Important December 2015 update: Homebrew-Cask will now be kept up to date together with Homebrew
# 3. Install Oh-my-zsh (warning: at least read install.sh at first)
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
# 4. Install brew packages