Skip to content

Instantly share code, notes, and snippets.

View timfanda35's full-sized avatar
🐻
Fly to the moon.

Bear Su timfanda35

🐻
Fly to the moon.
View GitHub Profile
@timfanda35
timfanda35 / gdump
Created September 3, 2019 02:57
Tcpdump Script - gdump
#! /bin/bash
# Usage:
# Start record: sudo gdump start
# Stop record : sudo gdump stop
#
# The cap file is under /tmp/HOSTNAME.cap
#
# Prerequire: tcpdump
# Ubuntu: sudo apt-get install tcpdump
@timfanda35
timfanda35 / getting_start.md
Last active April 14, 2019 08:19
GCP Service Broker Sample Demo
@timfanda35
timfanda35 / upload_notify.js
Created March 17, 2019 19:26
GCP Cloud Functions example - Upload Notify
const lineNotifyApiHost = 'notify-api.line.me';
const lineNotifyApiPath = '/api/notify';
const lineNotifyApiToken = process.env.ACCESS_TOKEN;
const https = require('https');
const querystring = require('querystring');
//
// Push message
//
@timfanda35
timfanda35 / echo.js
Created March 17, 2019 15:41
GCP Cloud Functions example - Telegram Chatbot echo
const botTgApiHost = 'api.telegram.org';
const botTgApiSendMessagePath = '/bot' + process.env.BOT_TOKEN + '/sendMessage';
const https = require('https');
const querystring = require('querystring');
//
// Push message
//
function pushMessage(chatId, message) {
@timfanda35
timfanda35 / snippet.md
Last active December 27, 2018 12:36
IND 虛擬化與 Docker 入門

Vagrant Live Demo

Create a Nginx VM

mkdir vagrant-test & cd vagrant-test
vagrant init hashicorp/precise64
@timfanda35
timfanda35 / install-kubeflow-on-gke.sh
Last active April 25, 2018 09:31
Snippet for installing kubeflow on GKE
#! /bin/bash
# Requirement
#
# * gcloud SDK https://cloud.google.com/sdk/downloads
# * kubectl https://kubernetes.io/docs/tasks/tools/install-kubectl/
# * ksonnet https://ksonnet.io/
#
# * Request GPU Quota in Cloud Console
#
@timfanda35
timfanda35 / Gold.md
Last active January 3, 2017 11:44 — forked from sean2121/Gold.md

Ruby Association Certified Ruby Examination Gold Sample Questions

Q1. Assume that the following code must have the stated execution result.

__(1)__
x.each_line { |line| puts line }

[Execution Result]
apple
@timfanda35
timfanda35 / aarv.sh
Created June 6, 2016 12:41
Show android .aar version informations
#!/bin/bash
xml=`unzip -p $1 AndroidManifest.xml`
echo $xml | grep -Eo "android:versionCode=\"[^\"]+\""
echo $xml | grep -Eo "android:versionName=\"[^\"]+\""
@timfanda35
timfanda35 / Rakefile
Created October 6, 2015 09:11 — forked from ream88/Rakefile
Minitest rake task
require 'rake'
require 'rake/testtask'
Rake::TestTask.new do |t|
t.test_files = Dir.glob('spec/**/*_spec.rb')
end
task(default: :test)
require 'bundler/capistrano'
set :application, "net"
set :repository, "git@githost.com:net.git"
set :scm, :git
set :default_environment, {
'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
}