STUDY WHILE YOU ARE BORING


  • 首頁

  • 搜索

  • 技术

  • Tags

  • 关于我

underconstruct.io a free and none-hosting solution for under construction page

發表於 May 27, 2019   |   评论

What's under construction page?

请输入图片描述

When we need the under construction page?

  • New domain, without certain context.
  • Web server update events
  • Just stop showing thing

A new fast way without hosting

An under construction page still need to be uploaded to any web hosting server. Sometimes you also need to install some packages, apache/ nginx etc.
Despite, we find out an new and fastest way to do that without any hosting server and command line. That's http://underconstruct.io

DNS for all

All you need to do is pointing your DNS to undercontruct.io
请输入图片描述

One more thing

It support theme configuration. Visit http://underconstruct.io for more.

Centos 6.x 上安装php 的 zbarcode 扩展

發表於 May 27, 2019   |   评论

环境

Centos 6.x
PHP 5.3.3

安装

1 安装ImageMagick依赖

yum install ImageMagick ImageMagick-devel

2 安装zbar拓展

wget -c http://jaist.dl.sourceforge.net/project/zbar/zbar/0.10/zbar-0.10.tar.bz2
tar jxvf zbar-0.10.tar.bz2
cd zbar-0.10
./configure --without-gtk --without-python --without-qt --prefix=/usr/local/zbar ##禁止gtk,python和qt的支持
make && make install

3 安装php-devel

yum install php-devel

4 安装php-zbarcode

git clone https://github.com/mkoppanen/php-zbarcode.git 
cd php-zbarcode
/usr/bin/phpize #自己phpize的位置
./configure --with-php-config=/usr/bin/php-config --with-zbarcode=/usr/local/zbar/
make && make install

5 添加extension=zbarcode.so 到php.ini中 然后重启apache

6 测试

    //新建一个图像对象  
    $image = new ZBarCodeImage("test.png");  

    // 创建一个二维码识别器  
    $scanner = new ZBarCodeScanner();  

    //识别图像  
    $barcode = $scanner->scan($image);  

    //循环输出二维码信息  
    if (!empty($barcode)) {  
        foreach ($barcode as $code) {  
            echo $code['type'];//图像的条码类型
            echo $code['data'];//条码的数据 
        }  
    }  

参考资料

  1. http://www.geekso.com/qrcode/
  2. http://www.xianyunyehe.cc/2017/03-29/php%E8%AF%86%E5%88%AB%E6%9D%A1%E7%A0%81.html

搭建mutt+msmtp发信服务

發表於 May 27, 2019   |   评论

各种命令行发信

mail/mailx 都试过,相对来说mailx比较方便点,发送带附件带邮件也很方便,例如:

mailx -s "The Subject" -a github.png [email protected] < body.txt

比较头疼带是mailx其实有很多个版本,各个表现不一致,参见
https://stackoverflow.com/questions/17359/how-do-i-send-a-file-as-an-email-attachment-using-linux-command-line/48588035#48588035

我在测试带服务器是CentOS 6.x,各种尝试后无法实现发送html格式的邮件内容,只好放弃,转向mutt

Mutt只是个客户端

首次运行mutt的时候马上会报错。。。

Error sending message, child exited 127 (Exec error.).

又翻阅了各种资料,mutt只是个客户端,方便你收发邮件,需要先配置真实的发信服务,例如sendmail/msmtp等

vi /etc/Muttrc.local
set sendmail="/usr/bin/msmtp"

这里有个插曲,网上大多数教程是教你是设置为 /usr/sbin/sendmail,奈何CentOS下面即使安装了sendmail,也没有sendmail这个命令,查阅了n多资料,里面也是一个很复杂的故事,所以走向另外一条路

yum install msmtp

我们尽量用yum能安装的工具

配置

vi /etc/msmtprc 
account [email protected]
host    smtp.exmail.qq.com
from    [email protected]
auth    login
user    [email protected]
password        密码
account default:        [email protected]

总算遇到一个简单的配置,配置完毕之后就能使用mutt发信了。

mutt  -e "set content_type=text/html" -s "html test" -a file.zip -- [email protected] < body.html

One more thing

如果你是用阿里云,默认是禁止25端口出的,要么用其他端口,要么后台申请一下解封

未解决难题

虽然mutt能发信,能发html格式的信,能发html格式带附件带信,但是怎么可以将附件里面图片插入邮件主体里面,我一直没找到办法,虽然网上说mutt1.5.23版本会自动加cid,我测试了没有成功。如果你知道怎么弄,请告诉我。
https://stackoverflow.com/a/32227037/2809902

2天后我还是用了mailsend 替代上述服务

https://github.com/muquit/mailsend

git clone https://github.com/muquit/mailsend.git mailsend
cd mailsend
yum install -y openssl-devel
./configure --with-openssl=/usr/
make && make install

因为可以内嵌图片

-from [email protected] 
-to [email protected] 
-smtp smtp.mail.com 
-port 25 
-auth  
-user [email protected] 
-pass senderPassword 
-content
-type "multipart/related"  
-mime
-type text/html  
-content
-type "multipart/related" 
-mime
-type text/html 
-disposition inline 
-enc
-type "none" 
-attach "body.mailsend.html" 
-mime
-type image/png  
-enc
-type "base64"  
-disposition inline  
-content
-id "imgs_d1"  
-cs "none"  
-attach "d1.png" 
-content
-id "imgs_d2"  
-cs "none"  
-attach "d2.png" 
-content
-id "imgs_d3"  
-cs "none"  
-attach "d3.png"

How to generate UPS SHIPID or Shipment IdentifyID?

發表於 May 27, 2019   |   评论

What's SHIPID?

UPS tracking number is format like 1Z4V90A96768678127, the SHIPID is short for it. For example.
Normal:1Z4V90A96768678127
ShipID:4V90A9N3SKP

If we know the normal one, I suppose we could calculate the ShipID from it.
But how?
After a lot of research, we could only find some pieces since useful.





- 阅读剩余部分 -

Generate OUTLINE client compatible ACCESSKEY

發表於 May 27, 2019   |   评论

OUTLINE is a great project, the OUTLINE client is cross platform. We know OUTLINE server base on SHADOWSOCKS protocol, so what if we could use SHADOWSOCKS server with the Outline client?
Different with SS-Client, OUTLINE client use the ACCESSKEY which like ss://access-key. It is not the server address, password, encryption method, etc. we used to use. Let me explain How is this access-key generated.

After reviewing, the SS configuration can also be shared by QRCODE, and the SS official also defines a standard. Is this standard the access-key generation method we are looking for?

URI and QR code
Shadowsocks for Android / iOS also accepts BASE64 encoded URI format configs:
 
    ss://BASE64-ENCODED-STRING-WITHOUT-PADDING#TAG
Where the plain URI should be:
 
    ss://method:[email protected]:port
Note that the above URI doesn't follow RFC3986. It means the password here should be plain text, not percent-encoded.
 
For example, we have a server at 192.168.100.1:8888 using bf-cfb encryption method and password test/!@#:. Then, with the plain URI ss://bf-cfb:test/!@#:@192.168.100.1:8888, we can generate the BASE64 encoded URI:
 
    ss://YmYtY2ZiOnRlc3RAMTkyLjE2OC4xMDAuMTo4ODg4Cg
To help organize and identify these URIs, you can append a tag after the BASE64 encoded string:
 
    ss://YmYtY2ZiOnRlc3RAMTkyLjE2OC4xMDAuMTo4ODg4Cg#example-server

According to the above steps, first we need to splicing the configuration together.

ss://method:[email protected]:port

E.g

ss://aes-256-cfb:[email protected]:10088

Then the content behind ss:// is BASE64 transcoded.

ss://YWVzLTI1Ni1jZmI6eW91ZG9udGtub3dubWVAMTE1LjIxMi4zMy4xOTQ6MTAwODg=

Fill in OUTLINE, if it show up "Connected", congratulations! But sometimes it will prompt "Incorrect". Please just transcode the first part. The server and port parts do not need to be transcoded. The formula is as follows:

ss://base64(method:passwod)@server-address:port

E.g

ss://[email protected]:10088

Tested in MacOS/ iOS/ Android/ Windows.

Reference:
https://shadowsocks.org/en/config/quick-guide.html
Want a SS server?

CentOS6 安装 php7.2+

發表於 March 7, 2019   |   评论

1、配置安装yum源 EPEL and Remi repository

yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
yum install -y http://rpms.remirepo.net/enterprise/remi-release-6.rpm

2、安装 yum-utils

yum install -y yum-utils

3、 yum-config-manager 管理要安装的版本,以下3个,选择自己要安装的版本执行

yum-config-manager --enable remi-php72   [Install PHP 7.2]

如果要安装php7.0或php7.1

# yum-config-manager --enable remi-php70   [Install PHP 7.0]


# yum-config-manager --enable remi-php71   [Install PHP 7.1]

4、开始安装

yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
yum install -y http://rpms.remirepo.net/enterprise/remi-release-6.rpm
yum install -y yum-utils
yum-config-manager --enable remi-php72
yum install -y php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo php-fpm php-sodium php-posix php-xml php-mbstring php-bcmath php-gd php-opcache php-pdo php-ssh2 php-soap

# 分割

5、查看版本

php -v

PHP 7.2.0 (cli) (built: Nov xxxxxxx) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

作者:杨鑫newlfe
来源:CSDN
原文:https://blog.csdn.net/u012965373/article/details/80592163
版权声明:本文为博主原创文章,转载请附上博文链接!

yum安装git-v2.x版本

發表於 November 1, 2018   |   评论

在bower项目的时候显示如下报错

Initialized empty Git repository in /root/phpPgAdmin6/.git/
error:  while accessing https://github.com/HuasoFoundries/phpPgAdmin6.git/info/refs

访问提示中的网址报如下信息

Please upgrade your git client.
GitHub.com no longer supports git over dumb-http: https://github.com/blog/809-git-dumb-http-transport-to-be-turned-off-in-90-days

就是说需要升级git,我的操作系统是centos6.5,git版本是再带的V1.7.1(使用git --version 查看)

首先卸载旧版本git

yum remove git  

直接使用这个命令下载的还是1.7.1版本的。不使用源码进行编译是因为依赖太多,总会缺东西。

yum install git

可以使用 WANDisco's CentOS repository去安装 Git 2.x.

Install WANDisco repo package:

yum install http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm

Install the latest version of Git 2.x:

yum install git

如果再bower时出现SSL connect error,执行

git config --global http.sslversion tlsv1

作者:我有一只小傲娇
来源:CSDN
原文:https://blog.csdn.net/t3369/article/details/79562853
版权声明:本文为博主原创文章,转载请附上博文链接!

SQLServer创建触发器,阻止某个表的记录插入

發表於 October 31, 2018   |   评论

有时候,很多需求真的很奇葩,例如我们在使用某些标准系统(无法自定义或修改)的情况,有些数据不希望按照原有的路径走,那么就只能在数据上动脑筋。
下面这种情况就是这样,某系统 A 每次操作都会产生大量的调试信息插入到调试表(还没地方关闭),非常耗空间。


- 阅读剩余部分 -

[Chrome Extension] Domain Bookmark 域名书签

發表於 October 15, 2018   |   评论

SHOW BOOKMARKS RELATIVE TO THE DOMAIN IN CURRENT TAB

起源

在浏览网页的时候,我们有时候会想知道收藏夹里是否有相关的收藏信息,这样我们可以更快速的找到自己喜欢的内容。这个插件主要提供的功能是自动检测正在查看网页,在收藏夹内搜索相同域名下的收藏页并自动提示列出。

While we surfing the internet, we want to know if there are relate bookmarks to current page. This extension solve this. As its name, it search the whole Chorme Bookmark with the domain of current page.

  • Show you the count of relate pages
  • Show all of them in list with click on the icon
  • Open all with one click.

效果图

请输入图片描述

- 阅读剩余部分 -

[Chrome Extension] 报销大杀器 - 中文数字大写转换

發表於 October 15, 2018   |   评论

报销杀器

最近老是要填写报销单,其中金额都需要填写中文大写,所以做了一个插件,方便自己

效果

请输入图片描述

- 阅读剩余部分 -

  1. « 前一页
  2. 1
  3. 2
  4. 3
  5. 4
  6. 5
  7. 6
  8. 后一页 »

钜添

56 文章
2 分類
1 页面
GitHub 日记技术
php apache centos macos mysql https shadowsocks mac 微信 ups svn javascript outline accesskey Chrome Extension letsencrypt ssl free certification certbo wildcard renew cloudflare pgsql 归档 binlog isset array_key_exists redmine axure
© 2023 钜添   |   文章 RSS     |  登录
由 Typecho 强力驱动
主題 - NexT
Send message encrypted and private - Msg2
Build your Under Construction Page without hosting - UnderConstruct.IO