2022年9月29日

keepalived nginx 配置

摘要: 主机配置文件keepalived.conf ! Configuration File for keepalivedglobal_defs { notification_email { acassen@firewall.loc failover@firewall.loc sysadmin@firewa 阅读全文

posted @ 2022-09-29 16:14 Ben丶大壮 阅读(359) 评论(0) 推荐(0) 编辑

2022年9月8日

经典算法案例 1.1 有多少苹果用来分赃

摘要: 1 <?php 2 3 #1.1 有多少苹果用来分赃 4 5 for($s=5; ; $s++){ 6 7 if($s%5 == 1){ 8 9 $a = $s - round($s/5) -1; 10 11 if($a%5 == 1){ 12 13 $b = $a - round($a/5) -1 阅读全文

posted @ 2022-09-08 09:20 Ben丶大壮 阅读(12) 评论(0) 推荐(0) 编辑

2022年9月7日

Git常用命令

摘要: git commit 提交 git branch 查看分支 git checkout master 切换分支 git checkout -b bugFix 创建并切换到新分支 git switch master 切换分支 git merge master 合并分支 git rebase master 阅读全文

posted @ 2022-09-07 09:11 Ben丶大壮 阅读(9) 评论(0) 推荐(0) 编辑

2022年8月31日

PHP文件操作

摘要: //php读文件 $data = file_get_contents('./1.txt'); var_dump($data); //php写文件 file_put_contents('./1.txt', date('Y-m-d H:i:s').PHP_EOL, FILE_APPEND); /** * 阅读全文

posted @ 2022-08-31 12:02 Ben丶大壮 阅读(98) 评论(0) 推荐(0) 编辑

2022年1月11日

mysql 查询数据时,自动为结果编上序号

摘要: select (@i:=@i+1) i, username from sys_users ,(SELECT @i:=0) as i 阅读全文

posted @ 2022-01-11 15:45 Ben丶大壮 阅读(79) 评论(0) 推荐(0) 编辑

2022年1月5日

LINUX rsync-demo

摘要: #!/bin/sh inotifywait -mrq --timefmt '%d/%m/%y %H:%M' --format '%T %w%f' -e modify,delete,create,attrib /www/rsync-demo/ | while read file do rsync -a 阅读全文

posted @ 2022-01-05 15:37 Ben丶大壮 阅读(29) 评论(0) 推荐(0) 编辑

2021年11月22日

PHP简单日志文件

摘要: <?php error_reporting(0); $filename = date('Y-m-d'); $access_time = date('Y-m-d H:i:s'); file_put_contents('logo/'.$filename.'.log', '访问时间:'.$access_t 阅读全文

posted @ 2021-11-22 14:13 Ben丶大壮 阅读(91) 评论(0) 推荐(0) 编辑

2021年9月15日

JS PHP 判断是否是微信打开H5页面

摘要: function isWeiXin(){ var ua = window.navigator.userAgent.toLowerCase(); if(ua.match(/MicroMessenger/i) == 'micromessenger'){ return true; }else{ retur 阅读全文

posted @ 2021-09-15 11:19 Ben丶大壮 阅读(114) 评论(0) 推荐(0) 编辑

2020年12月11日

推荐分享一个牛X的自定义PHP加密解密类

摘要: !这是简单的使用方法,不要粘贴这份保存为Mcrypt.class.php! <?php require("Mcrypt.class.php") ; $code = Mcrypt::encode('sajkfcasjcla','7580'); echo "code-".$code; echo "<hr 阅读全文

posted @ 2020-12-11 16:02 Ben丶大壮 阅读(124) 评论(0) 推荐(0) 编辑

2020年12月4日

PHP使用PhpSpreadsheet操作Excel 转载:https://www.jb51.net/article/183570.htm

摘要: 一、PhpSpreadsheet 介绍 1、PhpSpreadsheet 是什么 PhpSpreadsheet是一个用纯PHP编写的库,提供了一组类,使您可以读取和写入不同的电子表格文件格式PhpSpreadsheet提供了丰富的API接口,可以设置诸多单元格以及文档属性,包括样式、图片、日期、函数 阅读全文

posted @ 2020-12-04 15:57 Ben丶大壮 阅读(171) 评论(1) 推荐(0) 编辑

2020年12月3日

PHP导出excel文件的几种方式

摘要: 先说说动态生成的内容当作文件来下载的方法: 1、通过把Content-Type设置为application/octet-stream,可以把动态生成的内容当作文件来下载; 2、用Content-Disposition设置下载的文件名; 3、 基本上,下载程序都是这么写的: <?php $filena 阅读全文

posted @ 2020-12-03 17:36 Ben丶大壮 阅读(1092) 评论(0) 推荐(0) 编辑

2020年12月1日

JS设置cookie setcookie getcookie

摘要: //获取cookie值 function getCookie(name) { //document.cookie.setPath("/"); var arr, reg = new RegExp("(^| )"+name+"=([^;]*)(;|$)"); if(arr=document.cookie 阅读全文

posted @ 2020-12-01 10:46 Ben丶大壮 阅读(2828) 评论(0) 推荐(0) 编辑

2020年11月17日

完美分页类

摘要: 1 <?php 2 /** 3 file: page.class.php 4 完美分页类 Page 5 */ 6 class Page { 7 private $total; //数据表中总记录数 8 private $listRows; //每页显示行数 9 private $limit; //S 阅读全文

posted @ 2020-11-17 13:51 Ben丶大壮 阅读(112) 评论(0) 推荐(0) 编辑

2020年5月19日

屏蔽国外ip 转载https://www.hostloc.com/thread-484625-1-1.html 感谢大神

摘要: 听大佬们讨论如何防CC攻击,有大佬提出禁止国外IP访问,可以有所缓解,因此从路由器中移植了如下脚本,在CENTOS 6下调试通过。使用:先运行如下语句获取国内IP网段,会保存为/root/china_ssr.txt wget -q --timeout=60 -O- 'http://ftp.apnic 阅读全文

posted @ 2020-05-19 16:59 Ben丶大壮 阅读(1903) 评论(0) 推荐(0) 编辑

2019年11月7日

PHP连接MySQL数据库的几种方法

摘要: 1.最简单的方式-mysql(面向过程) <?php $con = mysql_connect("localhost","root","password"); $select_db = mysql_select_db('test'); if (!$select_db) { die("could no 阅读全文

posted @ 2019-11-07 14:32 Ben丶大壮 阅读(65669) 评论(2) 推荐(0) 编辑

导航