Skip to content

Instantly share code, notes, and snippets.

View icy's full-sized avatar
🦖
Available

Ky-Anh Huynh icy

🦖
Available
View GitHub Profile
@icy
icy / rubydns_0.2.4_debug
Created July 6, 2011 14:51
rubydns 0.2.3 debug
1/ Switch to root account and make sure that I am using sytem Ruby
$ rvm info
1.8:
system:
uname: "Linux icy 2.6.39-ARCH #1 SMP PREEMPT Mon Jun 27 22:01:13 CEST 2011 i686 Genuine Intel(R) CPU U2700 @ 1.30GHz GenuineIntel GNU/Linux"
bash: "/bin/bash => GNU bash, version 4.2.10(2)-release (i686-pc-linux-gnu)"
zsh: "/bin/zsh => zsh 4.3.12 (i686-pc-linux-gnu)"
rvm:
version: "rvm 1.5.2 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]"
@icy
icy / gist:703eb4e362088b53f1e8
Last active September 20, 2016 02:32
See how nginx includes its files
#!/bin/bash
# Purpose:
# See how nginx loads/includes its configuration files
# Very useful to detect quickly where there errors come from.
# Author : Anh K. Huynh
# Date : 2015 Aug 14th
# License: MIT
# Notes :
# Some system has a different level. Here it's 3.
@icy
icy / expand.rb.md
Last active March 6, 2019 14:20
Bash-liked Curly Brace Expansion in ruby

System-call method

Use Bash to expand the brace. If you don't like this, you may look at more professional way at https://gist.github.com/ewoodh2o/3829405 This method invokes a system call to ask Bash to expand.

FIXME: This is not secure!!!

class String
@icy
icy / gist:30977d7d9ad6275ae560
Last active March 8, 2016 13:48 — forked from CrookedNumber/gist:8856939
How to create Trello Cards from the Command Line (with a ~10 minute set-up)
  1. This is quick and dirty and not terribly maintainable. But it's very useful for creating quick cards from the terminal. Requires familiarity with Trello and a basic understanding of bash.
  2. Log-in to Trello.
  3. Go to: https://trello.com/1/appKey/generate
  4. Make note of your key. Replace any mention of YourTrelloKey with this hash.
  5. Create a token. Go to https://trello.com/1/authorize?key=YourTrelloKey&name=SimpleBASHScript&expiration=never&response_type=token&scope=read,write in your browser and follow directions.
  6. Make note of the token. Replace any mention of YourTrelloToken with this looong hash.
  7. Pick a reasonable number of the most popular boards you use. Grab the URLs of those boards. At the same time, think of short, one-word, easy-to-remember names for each board (e.g., work, homeprojects, wedding).
  8. Grab the board IDs of the boards you chose. It'll be the ~8 character hash-like string in the URL. E.g., for https://trello.com/b/aWsGTrsD/work the ID is aWsGTrsD
  9. One by one, plug thos
@icy
icy / myss.sh
Last active August 23, 2017 05:00
Take screenshot with xfce4-screenshooter...
#!/bin/bash
# Purpose : Wrapper for xfce4-screenshooter
# Author : Ky-Anh Huynh
# License : Public domain
# Date : 2017-Aug-23rd
# See also https://www.gtk.org/api/2.6/glib/glib-Miscellaneous-Utility-Functions.html#g-get-tmp-dir
export TMPDIR=$HOME/df/ss/
@icy
icy / aftershot3.sh
Last active November 20, 2017 23:18
aftershot3.sh
#!/bin/bash
#
# AfterShot Pro startup script
# make symlinks to this script anywhere in your $PATH
# See also : http://forum.corel.com/EN/viewtopic.php?f=94&t=57338
FindPath()
{
if [ "`readlink "$0"`" = "" ]; then
pushd $(dirname "$0") >/dev/null
@icy
icy / aftershot2.sh
Created November 20, 2017 23:20
aftershot2.sh
#!/bin/bash
#
# AfterShot Pro startup script
# make symlinks to this script anywhere in your $PATH
# See also: http://forum.corel.com/EN/viewtopic.php?f=94&t=57338
FindPath()
{
if [ "`readlink "$0"`" = "" ]; then
pushd $(dirname "$0") >/dev/null
@icy
icy / flatten_with_path.rb
Created December 11, 2017 04:00
flatten_with_path.rb
# https://stackoverflow.com/questions/10712679/flatten-a-nested-json-object
# My Fixes
#
# Input: {"twitter":{"aliases":{"twitter_alias":{}}}}
# Old Ouput: {}
# New Input: twitter.aliases.twitter_alias: <EMPTY>
#
module Enumerable
def flatten_with_path(parent_prefix = nil)
res = {}
@icy
icy / whoisvn.sh
Created December 22, 2017 07:22
whoisvn.sh
#!/bin/bash
# Purpose: Test if a domain was registered
# Author: KyAnh <[email protected]>
# License: GPL v2
# Home: http://viettug.org/wiki/fs/whoisvn
# Source: http://github.com/icy/whoisvn
# default suffixes
WHOISVN_SUFFIX=${WHOISVN_SUFFIX:-com net org info edu biz}
@icy
icy / softethervpn-pr-327.patch
Created January 22, 2018 03:07
softethervpn-pr-327.patch
root@admin2:/home/softethervpn/dockerfiles# git diff
diff --git a/copyables/build.sh b/copyables/build.sh
index 3b3a203..f188ee6 100644
--- a/copyables/build.sh
+++ b/copyables/build.sh
@@ -7,7 +7,9 @@ yum -y update \
&& yum -y groupinstall "Development Tools" \
&& yum -y install readline-devel ncurses-devel openssl-devel iptables
-git clone --depth 1 https://github.com/SoftEtherVPN/SoftEtherVPN.git /usr/local/src/vpnserver