#——————————【插入数据】————
## 1.INSERT INTO movie指定要向movie表中插入数据,加上(指定要插入数据的列)
insert into movie(id,title,director,release_date,length_minutes)
values (23,'活着','张艺谋','1994-05-18',125),(24,'活着','张艺谋','1994-05-18',125)
#——————————【修改数据】————
## 1.修改对应数据:【UPDATE movie】指定要更新 movie 表中的数据 如果没有【WHERE】条件,会更新表中所有记录
update movie set length_minutes = 50,director='姜文' where title = '无人区'
## 2.修改对应数据:只更新ID值在1到5之间(包含1和5)的记录【BETWEEN】是范围运算符
update movie set length_minutes = 50,director='姜文' where id between 1 and 5
#——————————【删除行数据】————
## 1.删除一整行数据,对应条件
delete from movie where title = '无人区'
#——————————【删除列数据】————
## 1.删除一整列数据,对应条件director列,可以删除多个列,套用【drop column】
alter table movie drop column director,drop column length_minutes
#——————————【删除所有数据】————
## 1.删除movie表的所有内容
delete from movie
## 2.删除movie的表
drop table movie
]]>## 1.##movir中提取title和director列的表
select title,director from movie
## 2.movir中提取使用*所有列的表
select * from movie
## 3.提前director列数据,通过【distinct】语句取掉重复内容,根据director去重的数据,后面的release_date根据前面去重的数据一致
select distinct director,release_date from movie
## 4.使用【order by】语法对列表排序,默认为升序,尾部加个【desc】可以改变为降序
select * from movie order by release_date
## 5.前面加个【director】以导演名一列为排序,后面release_date以时间通过【desc】来降序
select * from movie order by director,release_date desc
## 6.使用【limit】语法输出列表的前5条
select * from movie limit 5
## 6.使用【limit】语法前面加个3,将从第4行开始输出列表5条数据
select * from movie limit 3,5
## 7.【where director=】 语法筛选出对应内容的数据
select * from movie where director='宁浩'
## 8.筛选出来的内容使用【and】与语句 时间列 >110分钟的数据
select * from movie where director='宁浩' and length_minutes > 110
## 9.筛选出来的内容使用【or】或语句 筛出导演和时间 >110分钟的数据
select * from movie where director='宁浩' or length_minutes > 110
## 10.筛选出来的内容使用【in】语句 筛出director列多个人的数据
select * from movie where director in('宁浩','姜文')
## 11.使用【between】语法,取length_minutes列下110到120区间的数据
select * from movie where length_minutes between 110 and 120
## 12.筛选列中对应时间的列
select * from movie where release_date='2013-12-03'
## 13.【like】通配符筛选,筛选内容包含2013的字符,来达到赛选2013年份所有数据的功能
select * from movie where release_date like '2013%'
## 14.【like】通配符筛选,使用下划线_一个代表一个文字,这里可以赛选出3个字的导演名字
select * from movie where director like '___'
## 15.使用【year()】语法,提取日期中的年份,进行筛选
select * from movie where year(release_date)='2013'
## 15.使用【month()】语法,提取日期中的月年份,进行筛选
select * from movie where month(release_date)='12'
]]>/**
* 根据音质和时长计算音频文件大小
*
* @param int $duration 时长(秒)
* @param int $sampleRate 采样率(Hz),如 44100(仅 WAV/FLAC 需要)
* @param int $bitDepth 位深(bit),如 16(仅 WAV/FLAC 需要)
* @param int $channels 声道数,如 2(仅 WAV/FLAC 需要)
* @param int $bitrate 比特率(kbps),如 128(仅 MP3/Ogg/M4A/AAC 需要)
* @param string $type 音频类型:'wav', 'flac', 'mp3', 'ogg', 'm4a', 'aac'
* @return float 返回文件大小(MB)
*/
function calculateAudioSize($duration, $sampleRate, $bitDepth, $channels, $bitrate, $type = 'mp3') {
$bytes = 0;
$type = strtolower($type);
if ($type === 'wav') {
$bytes = $sampleRate * $bitDepth * $channels * $duration / 8;
}
elseif ($type === 'flac') {
$rawBytes = $sampleRate * $bitDepth * $channels * $duration / 8;
$compressionRatio = 0.6;
$bytes = $rawBytes * $compressionRatio;
}
elseif (in_array($type, ['mp3', 'ogg', 'm4a', 'aac'])) {
$bytes = $bitrate * 1000 * $duration / 8;
}
return round($bytes / 1024 / 1024, 2);
}$duration = 180; // 3分钟 (180秒)
// 1. FLAC 文件:3分钟,CD音质 (44100Hz, 16bit, 2声道)
$flacSize = calculateAudioSize($duration, 44100, 16, 2, 0, 'flac');
echo "FLAC 文件大小约为:{$flacSize} MB\n";
// 2. AAC / M4A / Ogg 文件:3分钟,高音质 (256kbps)
$aacSize = calculateAudioSize($duration, 0, 0, 0, 256, 'aac');
echo "AAC/M4A/Ogg 文件大小约为:{$aacSize} MB\n";
]]>首先需要获取文件的 字节长度 和 音质 (如:6400、12800、32000)
//计算音乐时长
function ilingku_duration($lksize,$lkquality='12800'){
//音乐文件大小+音乐音质=音乐时长
$recordtime = intval((($lksize-42)*0.8) / $lkquality);
return date("i:s",$recordtime);
}//计算音乐时长
function ilingku_duration($lkurl,$lkquality='12800'){
$header_array = get_headers($lkurl, true);
$lksize = $header_array['Content-Length'];
//音乐文件大小+音乐音质=音乐时长
$recordtime = intval((($lksize-42)*0.8) / $lkquality);
return date("i:s",$recordtime);
}echo ilingku_duration(‘http://cg.sycdn.kuwo.cn/2a2eb0bafa872aee7021f133162d0835/64dfc0f5/resource/n1/64/13/3119858049.mp3′,’12800’);04:17
]]>http://blog.ilingku.com/api/qq/avatar/?qq=10001{
"code": 200,
"msg": "success",
"qq": "10001",
"name": "pony",
"email": "10001@qq.com",
"avatar": "http://blog.ilingku.com/api/qq/avatar/profile/?k=tA33ZFgtKdvljnkhHetNe",
"data": {
"qq_avatar_40": "http://blog.ilingku.com/api/qq/avatar/profile/?k=tA33ZFgtKdvljnkhHetNe&s=40",
"qq_avatar_100": "http://blog.ilingku.com/api/qq/avatar/profile/?k=tA33ZFgtKdvljnkhHetNe&s=100",
"qq_avatar_140": "http://blog.ilingku.com/api/qq/avatar/profile/?k=tA33ZFgtKdvljnkhHetNe&s=140",
"qq_avatar_640": "http://blog.ilingku.com/api/qq/avatar/profile/?k=tA33ZFgtKdvljnkhHetNe&s=640",
"qq_avatar_1000": "http://blog.ilingku.com/api/qq/avatar/profile/?k=tA33ZFgtKdvljnkhHetNe&s=1000"
}
}
]]>cd /root
mkdir bt
cd bt
# 这里以 9.6.0 版本为例,可以自行更改想降级的版本
wget https://download.bt.cn/install/update/LinuxPanel-9.6.0.zip
unzip LinuxPanel-9.6.0.zip
cd panel/
bash update.sh
]]>下载源码,根目录解压
挑选合适的图片上传至images文件夹
<img src="https://blog.ilingku.com/api/rand/img/gy">https://blog.ilingku.com/api/rand/img/gyhttps://blog.ilingku.com/api/rand/img/gy?act=pchttps://blog.ilingku.com/api/rand/img/gy?act=mobilehttps://blog.ilingku.com/api/rand/img/gy?act=video{cloud title="夸克网盘" type="quark" url="https://pan.quark.cn/s/4f0582e2bf4c" password="sBuf"/}
{cloud title="200张电脑墙纸" type="quark" url="https://pan.quark.cn/s/177987e037fe" password="pYEg"/}
{cloud title="88张手机墙纸" type="quark" url="https://pan.quark.cn/s/18c9c52babb0" password="YKc5"/}
方案:1.个人电脑自带微软,远程桌面连接工具mstsc,远程目标电脑;
2.手机或平板,下载remote desktop远程软件,远程目标电脑;
注意:若目标电脑或者服务器,在公司内网上,则需要配合相应的VPN工具,实现网络互通,才能使用如上工具进行远程桌面;
以上,为方案背景简要介绍;下面分享通过个人电脑,或手机/平板,远程目标电脑/服务器的具体实施步骤:
一、目标电脑/服务器端设置:
1.目标电脑/服务器,需要进设置--系统--远程桌面--打开被远程功能;
2.手机或平板,通过remote desktop软件,远程目标电脑;需要目标电脑打开启用,远程(RDP)连接要求使用指定的安全层。
①win+R输入:gpedit.msc 调出本地组策略编辑器
②路径为:本地组策略编辑器→计算机配置→管理模板→Windows 组件→远程桌面服务
→远程桌面会话主机→安全→远程(RDP)连接要求使用指定的安全层
③启用远程(RDP)连接要求使用指定的安全层,配置安全层为SSL
二、个人电脑端设置:
1.个人电脑端,搜索框--输入mstsc--找到远程桌面连接工具
--右击、打开文件位置--远程桌面连接右击、发送到桌面快捷方式(后续直接在桌面点击,就可以打开工具远程啦)
2、打开远程桌面连接工具:
①输入目标电脑的ip--打开左下角“显示选项”
②--填写目标电脑--账号和密码--,并保存凭证
(账号会被保存下来,再次登录需要重新输密码;也可以通过修改配置、保存,后续连接不需要输密码,各位朋友如有需要,下次再出一篇文章专门讲)
③点击连接时,会弹出提提示,勾选不再询问,确认忽略
3、正常情况下,通过个人电脑mstsc工具,远程目标电脑,此时已经成功了。
三、手机/平板端设置:
1.手机端,下载remote desktop 远程软件客户端;
2、点击右上角+号,添加电脑,输入相应的账户和密码;
ip和密码为必填项,其他选项按需求勾选即可;
另,手机远程软件,配合蓝牙鼠标使用有奇效,巨推荐!!省了背着大块头的电脑跑,随身装个蓝牙鼠标,完全也能满足同样的使用需求。
3、正常情况下,通过手机/平板的remote desktop远程工具,远程目标电脑,此时已经成功了。
<?php
// 示例:输出圆形图片
header('Content-Type: image/png');
echo getimg("https://q.qlogo.cn/headimg_dl?dst_uin=778713968&spec=640", 300);
// 制作圆形图片
function getimg($imageUrl, $size)
{
// 创建画布
$canvasSize = 1000; // 处理时的图片尺寸
$canvas = imagecreatetruecolor($canvasSize, $canvasSize);
// 设置透明背景
imagealphablending($canvas, false);
imagesavealpha($canvas, true);
$transparentColor = imagecolorallocatealpha($canvas, 0, 0, 0, 127);
imagefilledrectangle($canvas, 0, 0, $canvasSize, $canvasSize, $transparentColor);
// 加载原始图片
$sourceImage = imagecreatefromjpeg($imageUrl);
$sourceWidth = imagesx($sourceImage);
$sourceHeight = imagesy($sourceImage);
// 放大图片
$enlargedWidth = $sourceWidth * 1.5;
$enlargedHeight = $sourceHeight * 1.5;
$enlargedImage = imagecreatetruecolor($enlargedWidth, $enlargedHeight);
imagecopyresampled($enlargedImage, $sourceImage, 0, 0, 0, 0, $enlargedWidth, $enlargedHeight, $sourceWidth, $sourceHeight);
// 计算裁剪为圆形的半径
$radius = $canvasSize / 2;
// 裁剪为圆形
for ($x = 0; $x < $canvasSize; $x++) {
for ($y = 0; $y < $canvasSize; $y++) {
$dx = $x - $radius;
$dy = $y - $radius;
$distance = sqrt($dx * $dx + $dy * $dy);
if ($distance < $radius) {
// 在圆内部
imagesetpixel($canvas, $x, $y, imagecolorat($enlargedImage, $enlargedWidth / $canvasSize * $x, $enlargedHeight / $canvasSize * $y));
}
}
}
// 输出的图片尺寸
$end = imagecreatetruecolor($size, $size);
imagesavealpha($end, true);
$transparency = imagecolorallocatealpha($end, 0, 0, 0, 127);
imagefill($end, 0, 0, $transparency);
imagealphablending($end, false);
imagesavealpha($end, true);
imagecopyresampled($end, $canvas, 0, 0, 0, 0, $size, $size, $canvasSize, $canvasSize);
imagepng($end);
// 释放资源
imagedestroy($canvas);
imagedestroy($sourceImage);
imagedestroy($enlargedImage);
imagedestroy($end);
}
]]>
<script>
!function(e, t, a) {
function r() {
for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
requestAnimationFrame(r)
}
function n() {
var t = "function" == typeof e.onclick && e.onclick;
e.onclick = function(e) {
t && t(),
o(e)
}
}
function o(e) {
var a = t.createElement("div");
a.className = "heart",
s.push({
el: a,
x: e.clientX - 5,
y: e.clientY - 5,
scale: 1,
alpha: 1,
color: c()
}),
t.body.appendChild(a)
}
function i(e) {
var a = t.createElement("style");
a.type = "text/css";
try {
a.appendChild(t.createTextNode(e))
} catch(t) {
a.styleSheet.cssText = e
}
t.getElementsByTagName("head")[0].appendChild(a)
}
function c() {
return "rgb(" + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + ")"
}
var s = [];
e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame ||
function(e) {
setTimeout(e, 1e3 / 60)
},
i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),
n(),
r()
} (window, document);
</script>
]]>