Skip to content

Instantly share code, notes, and snippets.

@copuzzle
copuzzle / docker-compose.yml
Created February 23, 2023 07:15
Kafka 2.7 docker compose cluster for Mac
# WARNING: This docker-compose.yml is only for testing purpose.
# Parameters:
# name: None
# - description: Major ports are exposed to host computer
# - zookeeper: 2181
# kafka1: 9091
# kafka2: 9092
# kafka3: 9093
# kafka3: 9094
# Tips:>
当不使用 multi pipline 的时候 ,配置 hook:
```
如果用户名有 @ 符号,转码成 %40
这样可以在命令行调用:
curl -X POST https://aaa%40bb.cc:115xxxxxxxxxxxxxxxxxxxxxx5bxx@my.job.host/job/my-job-one/build
git webhook 则直接使用以下地址:
https://aaa%40bb.cc:115xxxxxxxxxxxxxxxxxxxxxx5bxx@my.job.host/job/my-job-one/build

php的grpc扩展 下载地址: http://pecl.php.net/package/gRPC 安装过程:

phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
# 添加grpc.so到php.ini配置

System Feature

auto config

There are some great answers here, but many are out of date. Since May 2016, Raspbian has been able to copy wifi details from /boot/wpa_supplicant.conf into /etc/wpa_supplicant/wpa_supplicant.conf to automatically configure wireless network access:

If a wpa_supplicant.conf file is placed into the /boot/ directory, this will be moved to the /etc/wpa_supplicant/ directory the next time the system is booted, overwriting the network settings; this allows a Wifi configuration to be preloaded onto a card from a Windows or other machine that can only see the boot partition. wpa config update

Since the /boot partition is accessible by any computer with an SD card reader, wifi configuration is now much simpler.

A skeleton wpa_supplicant.conf file can be as little as:

安装lua扩展的前提是lua已经安装好,如果没有安装,参照

1.http://pecl.php.net/package/lua 下载lua扩展 或者Linux下直接输入 wget -c http://pecl.php.net/package/lua/get/lua-1.0.0.tgz 如果出现域名无法解析的提示

2.解压文件 tar xzvf lua-1.0.0.tgz 进入lua-1.0.0.tgz 运行 phpize 命令 得到如下提示:

表示所下的扩展没有问题,运行 ./configure --prefix=/usr/local/phplua --with-php-config=/usr/local/bin/php-config --with-lua=/usr/local/lua(我自己的lua路径 视情况而定)然后运行 make 得到如下提示:

/************************************/
基本命令
C-x C-f 打开/新建文件
C-x C-s 保存当前缓冲区
C-x C-w 当前缓冲区另存为
C-x C-v 关闭当前Buffer并打开新文件
C-x i 光标处插入文件
C-x b 切换Buffer
C-x C-b 显示Buffer列表
C-x k 关闭当前Buffer
@copuzzle
copuzzle / ubuntu-install-resilio-sync.md
Last active August 15, 2017 06:18
ubuntu16.04 安装 btsync

官网地址: https://www.resilio.com/

正常安装

Linux 安装 Package 可以参考 https://help.getsync.com/hc/en-us/articles/206178924 这里

添加源

echo "deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free" | sudo tee /etc/apt/sources.list.d/resilio-sync.list

添加源公钥

wget -qO - https://linux-packages.resilio.com/resilio-sync/key.asc | sudo apt-key add -

@copuzzle
copuzzle / update_gfwlist.sh
Created October 18, 2016 04:06 — forked from VincentSit/update_gfwlist.sh
Automatically update the PAC for ShadowsocksX. Only tested on OS X.
#!/bin/bash
# update_gfwlist.sh
# Author : VincentSit
# Copyright (c) http://xuexuefeng.com
#
# Example usage
#
# ./whatever-you-name-this.sh
#
# Task Scheduling (Optional)
@copuzzle
copuzzle / pull.php
Last active March 12, 2018 15:13
git webhook
header("Content-type: text/html; charset=utf-8");
$body = file_get_contents('php://input');
error_log($body, 3, 'hookInfo.log');
$js = json_decode($body, true);
if ($js['password'] == "yourPassword") {
$a = shell_exec( 'cd /data/www/yourProject && sudo -u www /usr/bin/git pull 2>&1' );
die("SUCCESS.");