使用composer镜像
使用aliyun镜像
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
禁止安装时更新
composer require 添加 --no-update 参数
composer require packagename --no-update
使用aliyun镜像
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer require 添加 --no-update 参数
composer require packagename --no-update
dnf update -y
dnf install supervisor
sytemctl enable supervisord
vim /etc/supervisor/xxx.conf
[program:testprogram]
directory = /root/go/src/test
command = /root/go/src/test/bin/server
autostart = true
startsecs = 5
autorestart = true
startretries = 3
user = root
redirect_stderr = true
stdout_logfile = /var/log/supervisor/test.log
supervisorctl reload
supervisorctl start xxx
supervisorctl status
页面
├── home 首页 奖品列表页
├── luckDraw 奖品详情页 抽奖页
├── personalCenter 个人中心 我参加的抽奖、中奖纪录、收货地址
├── past 我参与过的抽奖页 待开奖、已结束
├── prize 中/未中奖展示页、分享页、通过通知点进去展示页
├── record 中过奖的记录页
├── portraitList 头像列表
├── FLBRecord 福利分领取记录
├── exchangeDetails 兑换商品详情
├── exchangeRecord 兑换商品记录
├── rankingList 排行榜
├── strategy 赚币攻略
|—— getMoreFLC 福利分页面 获得更多福利分
|—— historyDraw 历史抽奖
|—— sponsor 成为赞助商
|—— feedBack 意见反馈
一套微信小程序抽奖平台(包含全部前后端源码)
功能介绍
1、口令抽奖: 大家都知道小程序的限制颇多,不能引导回公众号,即使关联跳转小程序,也有数量限制。口令抽奖一来可以限制参与抽奖的人,二来可以通过口令提示引导回公众号下发口令,带动关注。
2、限定地点: 我希望这个小程序未来也可以帮助线下的商户发起抽奖活动,那么做一个参与的位置电子围栏是很有必要的。
3、限定性别: 不多解释
4、条码解锁: 这个的思路也很好玩,让抽奖活动需要触发扫描特定的条形码方可参与。那么自然特别适合快速消费品品牌来玩。
5、RP币
知晓云抽奖小程序
Windows主机编译Windows客户端
SET CGO_ENABLED=0
SET GOOS=windows
SET GOARCH=amd64
go build -o client-windows.exe main.go
Windows主机编译LINUX客户端
SET CGO_ENABLED=0
SET GOOS=linux
SET GOARCH=amd64
go build -o client-linux main.go
Windows主机编译MAC客户端
SET CGO_ENABLED=0
SET GOOS=darwin
SET GOARCH=amd64
go build -o client-mac main.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o client-linux main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o client-mac main.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o client-windows.exe main.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o client-linux main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o client-mac main.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o client-windows.exe main.go
下载地址:https://www.php.net/downloads.php,开始下载:
su root
mkdir tmp
cd tmp
wget https://www.php.net/distributions/php-7.3.7.tar.bz2
tar -jxvf php-7.3.7.tar.bz2
cd php-7.3.7
yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libicu-devel
编译
./configure \
--prefix=/usr/local/php-7.3.7-ts \
--enable-maintainer-zts \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--enable-bcmath \
--enable-exif \
--enable-intl \
--enable-mbstring \
--enable-pcntl \
--with-pdo-mysql \
--enable-sockets \
--enable-mysqlnd \
--with-gd
然后:
make && make install
Autoconf version 2.68 or higher is required错误是才需要此步骤
wget http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
tar -zxvf autoconf-latest.tar.gz
cd autoconf-2.69/
.configure
make
make install
autoconf --version
git clone https://github.com/krakjoe/pthreads.git
cd pthreads
/usr/local/php-7.3.7-ts/bin/phpize
./configure --with-php-config=/usr/local/php-7.3.7-ts/bin/php-config
make
make install
修改 /usr/local/php-7.3.7-ts/lib/php.ini,增加 extension=pthreads
/usr/local/php-7.3.7-ts/bin/php worker.php
<?php
class MyWorker extends Worker
{
public $id;
public $time;
public function __construct($id, $time)
{
$this->id = $id;
$this->time = $time;
}
public function run()
{
while (true) {
echo sprintf(worker %s is running, %s\n, $this->id, date('Y-m-d H:i:s'));
sleep($this->time);
}
}
}
class MyManager
{
/**
* @var MyWorker[]
*/
protected $workers;
public function add(MyWorker $work)
{
$this->workers[$work->id] = $work;
echo 'add worker' . $work->id . \n;
}
public function run()
{
foreach ($this->workers as $id => $work) {
echo 'run worker' . $work->id . \n;
$work->start();
}
}
}
$manager = new MyManager();
$manager->add(new MyWorker('1', 1));
$manager->add(new MyWorker('2', 3));
$manager->run();
log_format combined_with_time '$remote_addr - $remote_user [$time_local] '
'$request $status $body_bytes_sent '
'$http_referer $http_user_agent '
'$request_time $upstream_response_time';
access_log /data/wwwroot/xxxx/vagrant/nginx/log/frontend-access.log combined_with_time;
Google的firebase只能在国外用,且不开源,国内的有野狗、leancloud都是小厂。
PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.
PouchDB was created to help web developers build applications that work as well offline as they do online.
It enables applications to store data locally while offline, then synchronize it with CouchDB and compatible servers when the application is back online, keeping the user\’s data in sync no matter where they next login.
var db = new PouchDB('dbname');
db.put({
_id: 'dave@gmail.com',
name: 'David',
age: 69
});
db.changes().on('change', function() {
console.log('Ch-Ch-Changes');
});
db.replicate.to('http://example.com/mydb');
Apache CouchDB™ lets you access your data where you need it. The Couch Replication Protocol is implemented in a variety of projects and products that span every imaginable computing environment from globally distributed server-clusters, over mobile phones to web browsers.
Store your data safely, on your own servers, or with any leading cloud provider. Your web- and native applications love CouchDB, because it speaks JSON natively and supports binary data for all your data storage needs.
The Couch Replication Protocol lets your data flow seamlessly between server clusters to mobile phones and web browsers, enabling a compelling offline-first user-experience while maintaining high performance and strong reliability. CouchDB comes with a developer-friendly query language, and optionally MapReduce for simple, efficient, and comprehensive data retrieval.
$ curl -X PUT http://127.0.0.1:5984/my_database/001 -d
'{ Name : Raju , age : 23 , Designation : Designer }'
{ok:true,id:001,rev:1-1c2fae390fa5475d9b809301bbf3f25e}
A realtime, decentralized, offline-first, mutable graph protocol to sync the web. https://gun.eco/docs
<script src=https://cdn.jsdelivr.net/npm/gun/gun.js></script>
<script>
// var Gun = require('gun'); // in NodeJS
// var Gun = require('gun/gun'); // in React
var gun = Gun();
gun.get('mark').put({
name: Mark,
email: mark@gunDB.io,
});
gun.get('mark').on(function(data, key){
console.log(update:, data);
});
</script>
⛁ A realtime Database for JavaScript Applications https://rxdb.info/
myCollection.insert({
name: 'foo',
lastname: 'bar'
});
const query = myCollection
.find()
.where('age')
.gt(18);
Meteor is a full-stack JavaScript platform for developing modern web and mobile applications. Meteor includes a key set of technologies for building connected-client reactive applications, a build tool, and a curated set of packages from the Node.js and general JavaScript community.
import { Mongo } from 'meteor/mongo';
export const Tasks = new Mongo.Collection('tasks');
import { Tasks } from '../api/tasks.js';
db.tasks.insert({ text: Hello world!, createdAt: new Date() });
Kinto is a minimalist JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host.
Kinto is used at Mozilla and released under the Apache v2 licence.
http GET https://kinto.dev.mozaws.net/v1/buckets/default/collections/tasks/records \
-v --auth 'bob:s3cr3t'
Hoodie is a free and Open Source Software for building applications for the web and iOS. It is a complete backend for your apps, ready for you to get creative. It works immediately out-of-the-box: develop your frontend code, plug it into Hoodie’s frontend-friendly API and your app is ready.
When you develop it, your app runs locally first, you can then deploy and host it wherever you want to. And if you want to extend Hoodie’s core features, you can check our list of currently available plugins or build plugins yourself.
Hoodie is a noBackend technology — it\’s there for making the lives of frontend developers easier by abstracting away the backend and keeping you from worrying about backends. It gives you Dreamcode: a simple, easy-to-learn-and-implement frontend API built into it. Hoodie is also Offline First, which means that your app users’ data is stored locally by default so your Hoodie-based apps are accessible and usable anytime, independent from your users’ internet connection.
hoodie.store.add({
type: 'todo-item',
content: 'Try out hoodie!',
done: false
})
https://github.com/tengattack/certbot-dns-aliyun
certbot certonly -a certbot-dns-aliyun:dns-aliyun \
--certbot-dns-aliyun:dns-aliyun-credentials /data/aliyun.ini \
-d c4ys.com \
-d *.c4ys.com
https://github.com/tengattack/certbot-dns-dnspod
certbot certonly -a certbot-dns-dnspod:dns-dnspod \
--certbot-dns-dnspod:dns-dnspod-credentials /data/aliyun.ini \
-d c4ys.com \
-d *.c4ys.com
certbot plugins
certbot renew
自动重新加载nginx(需要更新成功后,所以等前一个任务进行几分钟之后再执行)
nginx -s reload
https://github.com/wechaty/wechaty
Wechaty 是一个开源的的 个人号 微信机器人接口,是一个使用Typescript 构建的Node.js 应用。支持多种微信接入方案,包括网页,ipad,ios,windows, android 等。同时支持Linux, Windows, Darwin(OSX/Mac) 和 Docker 多个平台。
在GitHub上可以找到很多支持微信个人号接入的第三方类库,其中大多都是基于Web Wechat的API来实现的,如基于Python的WeixinBot,基于Node.js的Wechaty等。少数支持非Web协议的库,大多是商业私有闭源的,Wechaty是少有的开源项目支持非Web协议的类库。
只需要6行代码,你就可以 通过个人号 搭建一个 微信机器人功能 ,用来自动管理微信消息。
import { Wechaty } from 'wechaty'
Wechaty.instance()
.on('scan', qrcode => console.log('扫码登录:' + qrcode))
.on('login', user => console.log('登录成功:' + user))
.on('message', message => console.log('收到消息:' + message))
.on('friendship', friendship => console.log('收到好友请求:' + friendship))
.on('room-invite', invitation => console.log('收到入群邀请:' + invitation))
.start()
更多功能包括:
https://github.com/weechatfly/wtoolsdkroomlive/
微控工具xp模块-开发版[微信(wechat)二次开发模块]sdk微信多群直播demo
https://github.com/geeeeeeeeek/WeChatLuckyMoney
微信红包
一个帮助你在微信抢红包时战无不胜的Android应用。自动检测并且拆开红包,速度超乎你的想象。
支持中英文。前往Release下载最新版本。已下载用户可直接在设置里面更新。
https://github.com/cocos543/WeChatTimeLineRobot
项目简介:朋友圈自动点赞评论机器人
开发语言:C++
https://github.com/Sunnyyoung/WeChatTweak-macOS
项目简介:Mac微信多开及防撤回动态库
开发语言:Objective-C
腾讯官方微信网络通讯协议
https://github.com/Tencent/mars
收费(谨慎购买)
微信ipad协议源码,可实现微信80%功能。支持62数据登录、扫码登录、收发朋友圈、查看朋友圈、微信建群、微信拉人进群、微信公众号阅读、微信消息收发、微信附近的人定位、微信添加好友、微信红包接收、微信防撤回、分享小程序、微信加粉、微信收藏、微信标签等。
https://github.com/weixinbao/WeChatXY
永久免费 微信ipad、微信mac协议,可实现微信80%功能;支持62数据登录、扫码登录、收发朋友圈、查看朋友圈、微信建群、微信拉人进群、微信公众号阅读、微信消息收发、微信附近的人定位、微信添加好友、微信红包接收、微信防撤回、分享小程序、微信加粉、微信收藏、微信标签等
https://github.com/AvengersWeChat/PadChat-SDK
https://github.com/fatesinger/PyMicroChat
使用腾讯微信Mars跨平台通信库实现模拟微信App通信
https://github.com/FlyingGlass/MicroChat
微信协议研究,实现基于Android/MAC/IPAD协议的PC客户端
添加-i参数
python -i myapp.py
code.interact() import code
# before
code.interact()
# after
for thing in set_of_things:
import pdb;
pdb.set_trace()
do_stuff_to(thing)
from IPython import embed
for thing in set_of_things:
embed()
do_stuff_to(thing)