阅读视图

发现新文章,点击刷新页面。
🔲 ☆

Menghaoran

坐观垂钓者,徒有羡鱼情:孟浩然与当代人的无能为力之痛

“欲济无舟楫,端居耻圣明。坐观垂钓者,徒有羡鱼情。”唐代诗人孟浩然在《望洞庭湖赠张丞相》中写下的这四句诗,穿越千年时空,依然刺痛着现代人的心。

如果看过我之前的文章,就知道我很喜欢孟浩然的这首诗,我也不止一次的分享过。

这位隐逸诗人表面写的是面对浩瀚洞庭湖无法渡过的困境,实则抒发了自己身处盛世却无从施展抱负的深切苦闷。他渴望渡水却无舟船,闲居在家又愧对时代,只能眼睁睁看着他人垂钓,空怀一片羡鱼之情。

这种“无能为力”的感触,何尝不是当代人的普遍困境?

现代人生活在人类历史上最富足的时代,科技让我们能够上天入地,信息技术让全球知识触手可及。表面上,我们拥有了前所未有的能力去实现自我。然而,无力感却依然如影随形。

我们想改变职业生涯,却困于经济压力不敢妄动;我们想追求理想生活,却被各种社会期待所束缚;我们关心社会议题,却常感个人力量微薄;我们渴望深刻人际关系,却在数字洪流中越来越孤独。

孟浩然的痛苦在于,他明明有才华和能力,却找不到通往实现的路径。这与当下许多年轻人的处境何其相似——教育给了我们知识和视野,现实却未能提供相应的机会和舞台。

这种“志与功”之间的矛盾,正是“人生根本问题之一”。我们有所追求,却无力达成;有所看见,却无法触及。

那么,如何面对这种无能为力的痛苦?

孟浩然的选择是写下诗篇,向当权者表达自己的心声。这种诗的类型也叫拜谒诗。虽然他的仕途最终未能如愿,但他的诗歌却流传千古,实现了另一种形式的不朽。李白也把孟浩然看作自己的偶像,吾爱孟夫子,风流天下闻。

对于当代人而言,或许我们可以:

接纳有限的自我。认识到个人能力的边界,明白不是所有愿望都必须实现,也不是所有理想都能够达成。

重新定义成功。不必将他人的“垂钓”成果作为自己必须“得鱼”的标准,找到适合自己的价值实现方式。

重视微小行动。巨大的改变往往始于微小的步伐,一次简单的尝试或许就能打开新的可能性。

寻找同行之人。孤独加剧无力感,而志同道合者的陪伴能让我们获得前行的勇气。

孟浩然的诗之所以动人,正是因为它触碰了人类处境中某种永恒的东西——欲望与能力之间的鸿沟永远存在,而我们的尊严恰恰体现在明知鸿沟存在仍不放弃追求的勇气中。

在这个看似无所不能的时代,承认自己的无能为力或许正是真正力量的开始。当我们学会与局限共存,反而能够更自由地行走在属于自己的道路上。从无能为力到力量有限,到微小的改变,到涓滴之水,汇成江湖。

正如加缪所说:“不求永生,竭尽人事”无论有舟无舟,我们都得继续渡河。

image https://mp.weixin.qq.com/s/M3hIGWQQzEK2FVBGf25FkQ

🔲 ☆

Dns Vs Whois

DNS: The Phone Book Itself

  • What it is: The Domain Name System (DNS) is the system that translates the friendly website names you type (like google.com) into the numerical IP addresses that computers use to find each other (like 142.251.42.206). It’s the actual lookup process.
  • Simple Analogy: DNS is the phone book. You look up a name (e.g., “Jane’s Pizza”), and it gives you the phone number you need to call to reach them.
  • Key Purpose: Finding the correct server. It answers the question: “Where is this website located?”

WHOIS: The “Who Owns This?” Section

  • What it is: WHOIS is a protocol and a database that stores information about who registered a domain name. It’s a directory of who owns what.
  • Simple Analogy: WHOIS is like the section in the phone book that lists who the phone number is registered to, their address, and when they registered it. It’s about ownership and registration details.
  • Key Purpose: Identifying the domain owner. It answers the questions: “Who owns this website?”, “When did they register it?”, and “How can I contact them?”

Side-by-Side Comparison

Feature DNS (Domain Name System) WHOIS (Who Is)
Main Job Finding an address. Translates a domain name to an IP address. Finding an owner. Provides registration details for a domain.
Analogy The phone book that gives you a number. The listing that tells you who the number belongs to.
What it answers Where is google.com?” Who owns google.com?”
Information it gives IP addresses, mail server info, etc. Owner’s name, contact info, registrar, registration & expiry dates.
When you use it Every time you visit a website (your browser does this automatically). When you need to investigate a domain, contact the owner, or check if a domain is available.

A Simple Example

Let’s say you want to visit example.com.

  1. Your computer uses DNS: It’s like your computer shouting, “Hey, everyone, what’s the address for example.com?!” A DNS server answers back, “It’s 93.184.216.34!” Your browser then uses that number to connect to the website.
  2. You get curious and use WHOIS: You wonder, “Who actually owns example.com?” You go to a WHOIS lookup website (like whois.icann.org), type in the domain, and it tells you the registration company, when it was created, and when it will expire.

In a Nutshell:

  • DNS is for computers to find websites. It’s about location.
  • WHOIS is for people to find out about website owners. It’s about ownership.

They work together to make the internet function, but they serve two completely different purposes.

🔲 ☆

Dns Vs Whois

DNS: The Phone Book Itself

  • What it is: The Domain Name System (DNS) is the system that translates the friendly website names you type (like google.com) into the numerical IP addresses that computers use to find each other (like 142.251.42.206). It’s the actual lookup process.
  • Simple Analogy: DNS is the phone book. You look up a name (e.g., “Jane’s Pizza”), and it gives you the phone number you need to call to reach them.
  • Key Purpose: Finding the correct server. It answers the question: “Where is this website located?”

WHOIS: The “Who Owns This?” Section

  • What it is: WHOIS is a protocol and a database that stores information about who registered a domain name. It’s a directory of who owns what.
  • Simple Analogy: WHOIS is like the section in the phone book that lists who the phone number is registered to, their address, and when they registered it. It’s about ownership and registration details.
  • Key Purpose: Identifying the domain owner. It answers the questions: “Who owns this website?”, “When did they register it?”, and “How can I contact them?”

Side-by-Side Comparison

Feature DNS (Domain Name System) WHOIS (Who Is)
Main Job Finding an address. Translates a domain name to an IP address. Finding an owner. Provides registration details for a domain.
Analogy The phone book that gives you a number. The listing that tells you who the number belongs to.
What it answers Where is google.com?” Who owns google.com?”
Information it gives IP addresses, mail server info, etc. Owner’s name, contact info, registrar, registration & expiry dates.
When you use it Every time you visit a website (your browser does this automatically). When you need to investigate a domain, contact the owner, or check if a domain is available.

A Simple Example

Let’s say you want to visit example.com.

  1. Your computer uses DNS: It’s like your computer shouting, “Hey, everyone, what’s the address for example.com?!” A DNS server answers back, “It’s 93.184.216.34!” Your browser then uses that number to connect to the website.
  2. You get curious and use WHOIS: You wonder, “Who actually owns example.com?” You go to a WHOIS lookup website (like whois.icann.org), type in the domain, and it tells you the registration company, when it was created, and when it will expire.

In a Nutshell:

  • DNS is for computers to find websites. It’s about location.
  • WHOIS is for people to find out about website owners. It’s about ownership.

They work together to make the internet function, but they serve two completely different purposes.

🔲 ⭐

如何去消耗服务端资源

本篇文章主要记录消耗服务端资源的方法,可以当作性能测试的一部分。

首先我们大致列出服务端资源都有什么: 网络宽带,内存,CPU,文件句句柄,socket连接,mysql连接数,redis缓存,发送邮件,发送短信验证码

如何占用宽带?

设置网卡流量限速

如何占用socket资源

ddos攻击,例如syn泛洪攻击

如何保持http连接占用?

你是否还记得当初的slowhttptest?今天突然想到了她,眼泪不自觉的流了下来

https://null-byte.wonderhowto.com/how-to/dos-using-slowhttptest-0159548/

你是否还记得小巧强悍的性能测试工具wrk

./wrk -t4 -c1001 -d30s $url

如何保持mysql连接占用?

用户在转账时候数据库连接数满了 比如你想模拟数据库资源被占满的情况,那么你就可以使用jdbc执行sql但是不close. 例如使用jdbc不close就会占用连接。

🔲 ☆

依赖于第三方服务的场景要怎么测试

如何依赖于第三方服务的场景?

我为什么会想到这个问题?因为依赖于三方的场景太常见了。和三方最常用的交互方式就是http/https,我在思考到底如何测试这种场景下的我方逻辑。

mock,这是我首先想到的方法。但是mock的切入点是哪里?到底要通过什么样的方式去mock?

  1. http代理拦截 (感觉比较适合前端项目,例如使用anyproxy搭建代理服务器,浏览器中配置代理,这样是可以的) 对于服务端项目来说,应该是socket层的代理才能够实现http请求的拦截吧?
     cnpm -g install anyproxy
    [AnyProxy Log][2018-03-30 20:55:42]: Http proxy started on port 8001
    [AnyProxy Log][2018-03-30 20:55:42]: web interface started on port 8002
    
  2. service层mock 这个是我着手做的一种mock实践。
🔲 ☆

别做拒绝成长的苹果树

网上看到这样一则小故事。

一颗苹果树,终于结果了。

第一年,它结了10个苹果,9个被拿走,自己得了1个。对此,苹果树愤愤不平,于是自断经脉拒绝成长。

第二年,它结了5个果子,4个被拿走,自己得了1个。“哈哈,去年我得到了10%,今年得到20%,翻了一番。”这下苹果树心里平衡了。

但是,他还可以这样:继续成长。譬如,第二年,它结了100 个果子,被拿走90个,自己得到10个。

很可能,被拿走99个,自己得到1个。但没关系,它还可以继续成长,第三年结了1000个果子……

其实,得到多少果子不是最重要的。最重要的是,苹果树在成长!等苹果树长成参天大树,那些曾阻碍它成长的力量都会微弱到可以忽略。真的,不要太在乎果子,成长是最重要的

🔲 ☆

Spring Boot Test

对spring boot应用进行测试

添加如下两个注解,编写测试类,可以测试Spring boot应用


@RunWith(SpringRunner.class) 运行Junit并支持Spring-test特性
@SpringBootTest 为springApplication创建上下文并支持SpringBoot特性

spring boot的一些简单介绍

Controller Service Dao


测试方法

junit

注解

@Test
@Before
@After
@BeforeClass
@AfterClass

testng

比起junit我更偏向于testng

主要的优点我认为是Listener的定制化和xml配置用例测试套

🔲 ☆

前端tips

主要记录一些前端相关内容

  1. .dist目录是什么?有什么用处? distribution用于发布的文件,react等前端项目产生静态文件,可以直接放到静态服务器中,例如python -m SimpleHTTPServer

快速搭建前端环境

dva new myapp
cd myapp
npm start
❌