Skip to content

Instantly share code, notes, and snippets.

@herohenu
herohenu / docker-compose.yml
Created August 20, 2025 05:35
docker-compose-redis-cluster-3-main-node
version: '3.8'
services:
redis-master-0:
image: bitnami/redis-cluster:7.2
container_name: redis-master-0
environment:
- REDIS_PASSWORD=123456
- REDIS_CLUSTER_ENABLED=yes
- REDIS_CLUSTER_ANNOUNCE_IP=172.16.3.29
@herohenu
herohenu / doubao-macos-intel-start-error
Created June 9, 2025 05:09
doubao macos startup log
[0609/130438.403207:INFO:launch_repair_app_mac.mm(12)] [Repair] LunchRepairApp: Saman app bundle id: com.bot.pc.doubao
[0609/130438.404151:INFO:launch_repair_app_mac.mm(32)] [Repair] LunchRepairApp: Repair helper path: /Applications/Doubao.app/Contents/Frameworks/Doubao Framework.framework/Versions/Current/Helpers/Doubao Helper (Repair).app
[27883:259:0609/130438.733198:ERROR:install_info_mac.cc(104)] [DMG Installer] is_translocated=0
[27883:259:0609/130438.736538:ERROR:update.cc(198)] UpdateIfNeeded: begin
[27883:259:0609/130438.736926:ERROR:update.cc(131)] [vulcan_update] from_version empty, won't update
[27883:259:0609/130438.736931:ERROR:update.cc(230)] UpdateIfNeeded: !CheckHasInstalledVersion
Warning: GetProperties is deprecated, use GetInfo instead.
[27883:81155:0609/130439.069832:ERROR:trust_store_mac.cc(821)] Error parsing certificate:
ERROR: Failed parsing extensions
@herohenu
herohenu / read_line.go
Created July 19, 2018 13:05 — forked from kendellfab/read_line.go
Golang --> Read file line by line.
func readLine(path string) {
inFile, _ := os.Open(path)
defer inFile.Close()
scanner := bufio.NewScanner(inFile)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
fmt.Println(scanner.Text())
}
}
@herohenu
herohenu / dbbak.sh
Created June 19, 2018 00:34
mysqldump-expect
#! /usr/bin/expect
set timeout 10
set password password
spawn ~/bakdb
expect "Enter password:"
send "$password\r"
expect eof
# Copyright (c) 2014-2017, racaljk.
# https://github.com/racaljk/hosts
# Last updated: 2017-08-22
# https://laod.cn/hosts/2017-google-hosts.html
# This work is licensed under a CC BY-NC-SA 4.0 International License.
# https://creativecommons.org/licenses/by-nc-sa/4.0/
# Modified Hosts Start
https://blog.csdn.net/aerchi/article/details/41077613
—– BEGIN LICENSE —–
TwitterInc
200 User License
EA7E-890007
1D77F72E 390CDD93 4DCBA022 FAF60790
61AA12C0 A37081C5 D0316412 4584D136
94D7F7D4 95BC8C1C 527DA828 560BB037
D1EDDD8C AE7B379F 50C9D69D B35179EF
2FE898C4 8E4277A8 555CE714 E1FB0E43
```
a.bak file content
188302021 b20892db-485d-4ae9-af77-f75791af824a 1
183935026 DC3FC748-EAFD-4D4A-8F64-B9F3517EF549 0
183935026 9B9E985A-3F1F-4D76-A15E-E5B79F5E85FD 0
```
#!/bin/bash
result_file="a"
declare -A mydict
@herohenu
herohenu / generate-code.rb
Last active March 27, 2018 07:22
auto generate hive sql query shell file and job
require 'erb'
def genShell adx
<<-EOF
run_day=`date -d "1 days ago $ScheduleTime" +"%Y%m%d"`
HIVE=/data/hadoop/hive-0.13.1-amzn-3/bin/hive
sql="use adn_dsp;
ALTER TABLE stat_dsp_daily_devid ADD IF NOT EXISTS PARTITION (dt='${run_day}',adx='#{adx}')
@herohenu
herohenu / gen_mongoid.go
Created March 13, 2018 09:15
generate mongoid
import "gopkg.in/mgo.v2/bson"
mongoid = bson.NewObjectId().Hex()
@herohenu
herohenu / shll-dict.sh
Created March 7, 2018 03:46
shell  dict 操作,如果有数据则聚合,没有则追加入dict
declare -A mydict
count=0
errstr="000000000000"
while read campid devid needmd5
do
#计数器获取当前遍历的是多少行
((count+=1))
if [[ $devid =~ $errstr ]] ;then
continue
fi