Skip to content

Instantly share code, notes, and snippets.

@tg123
tg123 / README.markdown
Last active May 16, 2023 14:13
test all pod to pod tcp conn on all nodes

Usage

kubectl apply -f https://gist.githubusercontent.com/tg123/16e2fcc4e97222c95c8143858c8a5faf/raw/8e01fb743d4f6563303b9fb163fcf9b63a6aa825/podping.yaml
kubectl get -n podping po

# check if any pod failure
@tg123
tg123 / gist:aebe24169d2b696a89c74b5141c7499a
Created January 13, 2022 02:27
Auto accept Docker Desktop EULA
pwsh -Command {
& "C:\Program Files\Docker\Docker\Docker Desktop.exe"
Add-Type -Path "C:\Program Files\Docker\Docker\*.dll" -ErrorAction SilentlyContinue | Out-Null
while ($true) {
$instance = New-Object Docker.Core.GoBackend.GoBackendClient
$setting = $instance.GetSettingsAsync().Result
{
"swagger": "2.0",
"info": {
"version": "v3",
"title": "Bot Framework Bot Protocol V3",
"description": "The Bot Connector REST API allows your bot to send and receive messages to channels configured in the\r\n[Bot Framework Developer Portal](https://dev.botframework.com). The Connector service uses industry-standard REST\r\nand JSON over HTTPS.\r\n\r\nClient libraries for this REST API are available. See below for a list.\r\n\r\nMany bots will use both the Bot Connector REST API and the associated [Bot State REST API](/en-us/restapi/state). The\r\nBot State REST API allows a bot to store and retrieve state associated with users and conversations.\r\n\r\nAuthentication for both the Bot Connector and Bot State REST APIs is accomplished with JWT Bearer tokens, and is\r\ndescribed in detail in the [Connector Authentication](/en-us/restapi/authentication) document.\r\n\r\n# Client Libraries for the Bot Connector REST API\r\n\r\n* [Bot Builder for C#](/en-us/csharp/builder/sdkreference/)\
@tg123
tg123 / gist:11280667
Created April 25, 2014 07:27
mysql create table to java pojo field
#!/usr/bin/env python
import sys
import re
# http://stackoverflow.com/questions/4303492/how-can-i-simplify-this-conversion-from-underscore-to-camelcase-in-python
def underscore_to_camelcase(value):
def camelcase():
yield str.lower
while True:
@tg123
tg123 / addgitignore
Created April 15, 2014 04:20
pull content from github/gitignore into .gitignore by type
#!/bin/bash
t=$1
if [ -z "$t" ];then
echo "usage: $0 ignoretype"
echo "example: $0 Java"
exit 1
fi
@tg123
tg123 / svnignore.sh
Created April 15, 2014 03:18
set svn:ignore like git ignore
#!/bin/bash
for i in {`svn ls | grep /`,'.'}; do
svn ps svn:ignore $i -F .svnignore
done
@tg123
tg123 / README.md
Created November 9, 2013 02:32
自动订餐脚本 :) 现在刷失效了 开放出来
@tg123
tg123 / typescripttogif
Last active December 21, 2015 03:09
Bash script to convert typescript to gif Origin from http://blog.fedora-fr.org/metal3d/post/typescript-to-gif
#!/bin/bash
# origin from http://blog.fedora-fr.org/metal3d/post/typescript-to-gif
# modified by tgic to specified output file
# http://www.imagemagick.org/script/command-line-options.php#limit
CONVERTARG="-limit memory 32MiB -limit map 64MiB"
TIMING=$1
@tg123
tg123 / db_sync_lib.php
Created March 11, 2013 06:47
php code to sync tables primay key name should be id
<?php
function coltable($db, $table){
$stmt = $db->prepare("DESC $table");
$stmt->execute();
return array_map(function($v){
return strtolower($v['Field']);
}, $stmt->fetchAll(PDO::FETCH_ASSOC));
@tg123
tg123 / whereisdup.py
Last active October 11, 2015 17:58
Find duplicate class in a directory
#!/usr/bin/env python
from zipfile import ZipFile
from glob import glob
from itertools import groupby
from optparse import OptionParser
from fnmatch import fnmatchcase
class Printer:
def before(self):