Skip to content

Instantly share code, notes, and snippets.

View davidlu1001's full-sized avatar

David Lu davidlu1001

View GitHub Profile
@BideoWego
BideoWego / dictionary.json
Created January 26, 2018 02:28
English dictionary in JSON and words in raw text
This file has been truncated, but you can view the full file.
{
"a": "The first letter of the English and of many other alphabets.The capital A of the alphabets of Middle and Western Europe, as alsothe small letter (a), besides the forms in Italic, black letter,etc., are all descended from the old Latin A, which was borrowed fromthe Greek Alpha, of the same form; and this was made from the firstletter (Aleph, and itself from the Egyptian origin. The Aleph was aconsonant letter, with a guttural breath sound that was not anelement of Greek articulation; and the Greeks took it to representtheir vowel Alpha with the ä sound, the Phoenician alphabet having novowel symbols. This letter, in English, is used for several differentvowel sounds. See Guide to pronunciation, §§ 43-74. The regular longa, as in fate, etc., is a comparatively modern sound, and has takenthe place of what, till about the early part of the 17th century, wasa sound of the quality of ä (as in far).",
"ab": "The fifth month of the Jewish year according to theecclesiastical reckoning, the eleventh by the
#!/bin/bash
function initStaticParams
{
MONGODB_SERVER=127.0.0.1
MONOGDB_PORT=27017
MONGODB_USER=
MONGODB_PWD=
OUTPUT_DIRECTORY=/mnt/backups/oplogs
LOG_FILE="/appl/mongo-backup/logs/backup.log"
@marwei
marwei / how_to_reset_kafka_consumer_group_offset.md
Created November 9, 2017 23:39
How to Reset Kafka Consumer Group Offset

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@irvingpop
irvingpop / ssh_key.tf
Last active April 8, 2024 07:18
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"
@singledigit
singledigit / cognito.yaml
Last active June 4, 2024 05:19
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@fliphess
fliphess / debbuild.py
Created April 5, 2017 18:05 — forked from mkouhei/debbuild.py
build package with cowbuilder or git-buildpackage on Jenkins
#!/usr/bin/python
# -*- coding: utf-8 -*-
''' debbuild_wrapper.py
The debian package build wrapper on Jenkins.
This script support three way of building debian package.
1-1. Backport from source package with cowbuilder.
1-2. Pre-build and Backport from source package with cowbuilder.
2. Build original package with git-buildpackage.
@youfou
youfou / ad_urls.json
Last active September 9, 2023 14:50
响应好友请求 / 自动聊天 / 限制频率 / 邀请入群 / 远程群管理 / 新人欢迎消息 / 关键词问答 / 发心跳 / 远程命令 / 远程执行代码
{
"xiaohongshu.com": "小红书",
"vip.com": "唯品会",
"douguo.com": "豆果美食",
"youshu.cc": "有书",
"missfresh.cn": "每日优鲜",
"qnr.io": "去哪儿",
"kaola.com": "网易考拉",
"waimai.meituan.com": "美团外卖",
"qcs.meituan.com": "美团打车",
@xlzd
xlzd / weibo_monitor.py
Created February 17, 2017 16:57
weibo monitor
#!/usr/bin/env python
# encoding=utf-8
import codecs
import json
import os
import sys
from pushbullet import Pushbullet
from weibo import Client