Skip to content

Instantly share code, notes, and snippets.

View fkztw's full-sized avatar
📺
Hello World!

Frank Zheng fkztw

📺
Hello World!
  • Taiwan
  • 00:52 (UTC +08:00)
View GitHub Profile
  • Turn The Ship Around
  • Five Dysfunctions of a Team
  • Leading Snowflakes
  • High-Output Management
  • Slack: Getting Past Burnout
  • The Year Without Pants
  • Creativity, Inc.
  • Start With Why
  • Crucial Conversations
  • Drive: The Surprising Truth About What Motivates Us
@so0k
so0k / kubectl.md
Last active February 4, 2025 17:16
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@wonderbeyond
wonderbeyond / graceful_shutdown_tornado_web_server.py
Last active October 23, 2024 16:13 — forked from mywaiting/graceful_shutdown_tornado_web_server.py
The example to how to shutdown tornado web server gracefully...
#!/usr/bin/env python
"""
How to use it:
1. Just `kill -2 PROCESS_ID` or `kill -15 PROCESS_ID`,
The Tornado Web Server Will shutdown after process all the request.
2. When you run it behind Nginx, it can graceful reboot your production server.
"""
import time
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import subprocess
import argparse
def main(work_dir, target_ext, from_encoding, to_encoding):
for current_dir, dirnames, fnames in os.walk(work_dir):
@bsdlme
bsdlme / vagrant-bhyve.md
Last active December 4, 2024 21:35
Setting up vagrant-bhyve on FreeBSD

Using bhyve with vagrant

The following describes how to set up bhyve with Vagrant using the vagrant-bhyve plugin.

Prerequisites

@tlasica
tlasica / photo-enhance.sh
Created September 25, 2016 15:48
enhance photos using imagemagick
mkdir enhanced
for sp in *.jpg; do
echo "Converting Image: $sp"
convert -auto-gamma -auto-level -normalize $sp "enhanced/$sp"
done
# from http://superuser.com/questions/370920/auto-image-enhance-for-ubuntu
@ShantanuJoshi
ShantanuJoshi / compressMe.py
Last active April 29, 2022 18:15
Python Image Compress
#run this in any directory add -v for verbose
#get Pillow (fork of PIL) from pip before running --> pip install Pillow
import os
import sys
from PIL import Image
def compressMe(file, verbose=False):
filepath = os.path.join(os.getcwd(), file)
oldsize = os.stat(filepath).st_size
@ericclemmons
ericclemmons / example.md
Last active September 20, 2024 12:46
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@devStepsize
devStepsize / slack_webhook_post.py
Last active December 14, 2024 22:20
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests
@rauchg
rauchg / README.md
Last active April 13, 2025 04:29
require-from-twitter