Skip to content

Instantly share code, notes, and snippets.

View cyc115's full-sized avatar

Mike Chen cyc115

  • Chicago, IL
  • 14:02 (UTC -12:00)
View GitHub Profile
@cyc115
cyc115 / pluralsight-course-dl.rb
Created March 1, 2020 19:37
Download a list of pluralsight courses
#! ruby
require 'optparse'
require 'fileutils'
# Usage: pluralsight-course-dl.rb --input file.txt --output ~/Videos -u username -p password
# file.txt contains a list of urls that youtube-dl can donwload.
Options = {}
@cyc115
cyc115 / gist:d5d886f19f3d0b90410ce357ad6f559d
Last active November 11, 2017 22:29
debugging AWS bastion connectivity issue
# debugging AWS bastion connectivity issue
Sat. Nov 11 2017
Today I was setting up a public subnet bastion server to access instances on my private subnet. I was able to ssh on to the bastion server but was unable to establish ssh connection from the bastion instance to the private instance.
Any suggestions? And what could I do to improve or facilitate debugging similar problems in the future?
Here's my setup in a concise form:
@cyc115
cyc115 / notary-deployment
Last active December 27, 2017 21:15
Notary guideline
[TOC]
> additional important docs: [config references](https://github.com/docker/notary/tree/master/docs/reference)
## 0) Setting up DB(s)
1. Simply boot up two database instances (`i1` for server and `i2` for signer).
2. create a database named `notaryserver` on `i1` and create `notarysigner` on `i2`.
3. run SQL commands from [here](https://github.com/docker/notary/tree/master/migrations)
4. later configure the database urls in the `server-config.json` and `signer-config.json`
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjeWNtb3RvIiwiaWF0IjoxNDk2NzY2OTM5LCJleHAiOjE1MjgzMDI5MzUsImF1ZCI6IiIsInN1YiI6IiIsImp0aSI6ImZNYUpKd0h2VlBhVnN0SDdnUGU0In0.MQoVc45jLFxxnM8xeXUwc_bpMuNX6eidw2iJshlkXWY",
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjeWNtb3RvIiwiaWF0IjoxNDk2NzY2OTM5LCJleHAiOjE1MjgzMDI5MzUsImF1ZCI6IiIsInN1YiI6IiIsImp0aSI6ImZNYUpKd0h2VlBhVnN0SDdnUGU0In0.MQoVc45jLFxxnM8xeXUwc_bpMuNX6eidw2iJshlkXWY",
"issued_at": "2017-06-06T16:34:56.875816886Z"
}
@cyc115
cyc115 / shortenerKiller.py
Created April 16, 2016 03:02
see what people are posting to goo.gl the url shortener service
import random
import string
import urllib.request
import time
class UrlGen :
def __init__(self, max = 1000, prefix = "" , charLen = 6):
self.max = max
self.current = 0
@cyc115
cyc115 / MainActivity.java
Last active August 29, 2015 14:24 — forked from libinbensin/MainActivity.java
pop up window on Android
public class MainActivity extends
private PopupWindow popWindow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@cyc115
cyc115 / clone.js
Created May 1, 2015 20:47
javascript clone
//clone
var clone = function (old) {
var my = {}, key ;
for (key in old){
my[key] = old[key];
}
return my ;
}
@cyc115
cyc115 / privateVariable.js
Created May 1, 2015 20:25
js private memeber variable
//javascript private variable
var counterCreater = function() {
// constructor
function Counter () {
var count = 0 ; // private
this.inc = function () {
count++;
console.log("inc:" + count);
}
this.get = function(){
@cyc115
cyc115 / FingerPrint.cs
Created April 5, 2015 21:15
Generates a 16 byte Unique Identification code of a computer. Example: 4876-8DB5-EE85-69D3-FE52-8CF7-395D-2EA9
using System;
using System.Management;
using System.Security.Cryptography;
using System.Security;
using System.Collections;
using System.Text;
namespace Security
{
/// <summary>
/// Generates a 16 byte Unique Identification code of a computer
@cyc115
cyc115 / designer.html
Last active August 29, 2015 14:14
designer
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>