1.简介
ApacheLog4j2是一个开源的Java日志框架,被广泛地应用在中间件、开发框架与Web应用中。
2.漏洞概述
该漏洞是由于Apache Log4j2某些功能存在递归解析功能,未经身份验证的攻击者通过发送特定恶意数据包,可在目标服务器上执行任意代码。
给我一个需求,还你一个项目——别管它是什么。这就是全栈。
Apache Log4j2 is an open-source Java logging framework that is widely used in middleware, development frameworks and web applications.
This vulnerability comes from the recursive resolution feature in certain Apache Log4j2 functionality: an unauthenticated attacker can send a specially crafted malicious packet and execute arbitrary code on the target server.
这段时间,各地新冠感染人数都在暴增,大家出门记得戴口罩。
这几天,咱编辑部也充满了风雨欲来的危机感,不过,办公室刚出现病例,咱们就迅速进行了一个居家办公,所以目前情况还不错。
但即便如此,我们每天讨论最多的话题,仍然是新冠,不仅仅是编辑部,差评君在的大部分群聊里也是这个状况。
“ 听说现在新冠跟流感一样了?”
“ 抢到药了么?我咋到处买不到药?”
“ 现在得新冠还会有啥后遗症么?”
During this period, the number of COVID infections has been soaring everywhere. Remember to wear a mask when you go out.
These past few days our editorial team has also been filled with a sense of impending crisis, but as soon as a case appeared in the office we quickly switched to working from home, so the current situation is still not bad.
Even so, the topic we discuss most every day is still COVID — and it’s not just the editorial team. Most of the group chats 差评君 is in are in the same state.
“Do I hear that COVID is the same as the flu now?”
“Did you manage to grab any medicine? How come I can’t buy any anywhere?”
“Will catching COVID now still leave any after-effects?”
家里有一个闲置的极路由2,试试刷个openwrt,结果一不小心刷成砖头了。开机不能通电,没有指示灯亮。本来想着就这样丢了,再弄个查查咸鱼,二手的都要100多。果断找找解决办法。找这篇文章极路由X编程器救砖教程编程器刷PandoraBox,根据这篇文章,到万能的淘宝买了CH341A编程器 + 烧录夹
There is an idle HiWiFi 2 sitting at home, so I tried flashing openwrt on it, and one careless move bricked it. It would not power on, and no indicator light came on. I had originally thought of just throwing it away, but then I checked Xianyu and second-hand ones cost over 100. So I resolutely looked for a solution. I found this article HiWiFi X programmer brick rescue tutorial: flashing PandoraBox with a programmer, and following it, I bought a CH341A programmer + flashing clip from the almighty Taobao
需求是这样的:
有个外部app给我们小程序做推广,在他们那领取优惠券码。然后到我们小程序领取优惠券,使用优惠券下单。同时,需要我们推送订单。还要接受他们那变更优惠券的状态。
Here’s the requirement:
There’s an external app that promotes our mini program by handing out coupon codes on their side. Then users come to our mini program to claim the coupon and place an order with it. At the same time, we need to push orders to them, and also accept the coupon status changes on their side.
去年在刷招聘网站的时候,偶然认识了rust开发语言,留了个心眼,刚好这段时间不太忙,就先初步认识一下。
官方网站是这样介绍的:
一个赋予每个人构建可靠且高效软件能力的语言。
Last year, while browsing job sites, I happened to come across the Rust programming language and made a mental note of it. It just so happens that I’m not too busy these days, so let me start by getting a first look at it.
The official website describes it like this:
A language empowering everyone to build reliable and efficient software.
参考地址:https://go-zero.dev/cn/docs/quick-start/micro-service#%E5%88%9B%E5%BB%BAuser-rpc%E6%9C%8D%E5%8A%A1
go-zero(收录于 CNCF 云原生技术全景图:https://landscape.cncf.io/?selected=go-zero)是一个集成了各种工程实践的 web 和 rpc 框架。通过弹性设计保障了大并发服务端的稳定性,经受了充分的实战检验。
Reference address: https://go-zero.dev/cn/docs/quick-start/micro-service#%E5%88%9B%E5%BB%BAuser-rpc%E6%9C%8D%E5%8A%A1
go-zero (included in the CNCF Cloud Native Landscape: https://landscape.cncf.io/?selected=go-zero) is a web and rpc framework that integrates a variety of engineering practices. Through resilient design it guarantees the stability of highly concurrent server-side services and has been fully proven in practice.
beego中数据库分页
func PageDB(limit int, page int, count int64) (int, int) {
pageSetNum := limit // 每页条数
pageCount := math.Ceil((float64(count)) / (float64(pageSetNum))) // 总页数
pageNum := page // 当前页码
if pageNum > int(pageCount) { // 如果传入的页码超出范围
pageNum = int(pageCount)
}
offset := pageSetNum * (pageNum - 1)
if offset < 0 {
offset = 0
}
return pageSetNum, offset
}
Database pagination in beego
func PageDB(limit int, page int, count int64) (int, int) {
pageSetNum := limit // items per page
pageCount := math.Ceil((float64(count)) / (float64(pageSetNum))) // total pages
pageNum := page // current page number
if pageNum > int(pageCount) { // if the page number passed in is out of range
pageNum = int(pageCount)
}
offset := pageSetNum * (pageNum - 1)
if offset < 0 {
offset = 0
}
return pageSetNum, offset
}
func YunDaSign(structData interface{}) ([]byte, string, string) {
jsonData, _ := json.Marshal(structData)
appKey := "你的key"
appSecret := "你的秘钥"
newStr := string(jsonData) + "_" + appSecret
md := md5.New()
md.Write([]byte(newStr))
md5Str := hex.EncodeToString(md.Sum(nil))
return jsonData, appKey, md5Str
}
func YunDaSign(structData interface{}) ([]byte, string, string) {
jsonData, _ := json.Marshal(structData)
appKey := "你的key"
appSecret := "你的秘钥"
newStr := string(jsonData) + "_" + appSecret
md := md5.New()
md.Write([]byte(newStr))
md5Str := hex.EncodeToString(md.Sum(nil))
return jsonData, appKey, md5Str
}
func PKCS7Padding(ciphertext []byte, blockSize int) []byte {
padding := blockSize - len(ciphertext)%blockSize
//Repeat()函数的功能是把切片[]byte{byte(padding)}复制padding个,然后合并成新的字节切片返回
padtext := bytes.Repeat([]byte{byte(padding)}, padding)
return append(ciphertext, padtext...)
}
func PKCS7Padding(ciphertext []byte, blockSize int) []byte {
padding := blockSize - len(ciphertext)%blockSize
//The Repeat() function copies the slice []byte{byte(padding)} padding times, then merges it into a new byte slice and returns it
padtext := bytes.Repeat([]byte{byte(padding)}, padding)
return append(ciphertext, padtext...)
}
获取部分时间范围
//获得当前月的初始和结束日期
func GetMonthDay(types int) (string, string) {
now := time.Now()
currentYear, currentMonth, _ := now.Date()
currentLocation := now.Location()
firstOfMonth := time.Date(currentYear, currentMonth, 1, 0, 0, 0, 0, currentLocation)
lastOfMonth := firstOfMonth.AddDate(0, 1, -1)
f := firstOfMonth.Unix()
l := lastOfMonth.Unix()
if types == 1 {
return time.Unix(f, 0).Format("2006-01-02"), time.Unix(l, 0).Format("2006-01-02")
}
return time.Unix(f, 0).Format("2006-01-02") + " 00:00:00", time.Unix(l, 0).Format("2006-01-02") + " 23:59:59"
}
Getting some date ranges
// Get the start and end dates of the current month
func GetMonthDay(types int) (string, string) {
now := time.Now()
currentYear, currentMonth, _ := now.Date()
currentLocation := now.Location()
firstOfMonth := time.Date(currentYear, currentMonth, 1, 0, 0, 0, 0, currentLocation)
lastOfMonth := firstOfMonth.AddDate(0, 1, -1)
f := firstOfMonth.Unix()
l := lastOfMonth.Unix()
if types == 1 {
return time.Unix(f, 0).Format("2006-01-02"), time.Unix(l, 0).Format("2006-01-02")
}
return time.Unix(f, 0).Format("2006-01-02") + " 00:00:00", time.Unix(l, 0).Format("2006-01-02") + " 23:59:59"
}
没有找到匹配的文章 🙈