Posted in Uncategorized

Solution to quickly delete youtube like and dislike records

Open this link: https://myactivity.google.com/page?hl=en&page=youtube_likes

It will bring you to the Youtube likes and dislikes webpage.

Then just click the “X” button beside the Date, e.g. July 21st.

When you do this first time, Google will pop up a dialog for notice. Then you will find you can delete without any pop ups. So you can quickly delete likes and dislikes by click the “X” button one by one.

If you want to delete all records, just click “Delete All” from the left panel:

Then it will pop out a dialogue like below:

After deleting, you can go to https://www.youtube.com/playlist?list=LL to check if the action effects. Remember, it will take several minutes to effect on Youtube webpages, just wait for a while.

Posted in Network

让v2ray、Shadowsocks等软件搭配AdGuard DNS实现广告屏蔽效果

可能很多人第一时间想到的是在服务器端搭建AdGuard Home之类的程序,其实这是毫无必要的,因为事实上AdGuard Home不过是一款开源的本地广告拦截程序,而AdGuard官方早就提供了一个免费的DNS解决方案,只要把服务器的DNS改成AdGuard DNS即可。

那么是否有必要把整个服务器的DNS改为AdGuard DNS呢?其实也没必要,因为你的流量全部都是通过v2ray、Shadowsocks转发的,你只要把v2ray、Shadowsocks的DNS设置更改即可。

修改v2ray、Shadowsocks的config文件,添加一行:

 "nameserver":"94.140.14.14"

这行代码将会指定服务器端的v2ray、Shadowsocks程序通过AdGuard DNS访问网址,然后转发被过滤后的信息,自然也就达到了屏蔽广告的效果。修改配置文件后,需要重启一下v2ray、Shadowsocks的进程(或者重启服务器),以重新加载配置文件。

但是,如果你自己并没有修改服务器配置文件的权限,或者不知道怎么修改配置文件,有没有其他方法呢?当然有,那就是直接在v2ray、Shadowsocks客户端内手动指定DNS地址为 94.140.14.14。找到软件客户端内带有DNS设置的选项,自己尝试配置。

配置完成后,我们可以访问一些测试网站来查看屏蔽效果,比如https://d3ward.github.io/toolz/adblock.html。经过本人实测,AdGuard DNS的有效率高达87%,已经算是非常厉害了,日常使用完全足够。

使用AdGuard DNS的缺点在于会增加一定的网络延迟,尤其是访问国内网站时,会感受到明显的卡顿。境外DNS服务器对国内网站的优化都不算太好,即便是最常用的8.8.8.8,有时也会掉包、暂时无法访问,或者把网站解析到其他地方去。但目前来说,AdGuard DNS在国内的访问还算稳定,延迟也不算太高,为了过滤广告,这点忍耐不算什么。

知道上面这点后,你就应该了解到,如果偶尔发生无法联网的问题,并非是节点故障,很有可能是DNS服务器解析失败了,这时候需要你重新指定一下DNS服务器,比如国内的阿里云DNS 223.5.5.5

利用v2ray内置的规则实现广告屏蔽可以看下面这篇:

https://jaylinwu.wordpress.com/2021/10/21/v2ray-block-ads-with-built-in-rules/

Posted in Windows

Windows 11: Microsoft Unofficially Announce Old Hardware PC Support Suspended

Well, for many years, Windows and Linux are two main operating systems which support many old hardware PCs. If you are familiar with the history of Mac OS and iOS, you will find how radical Apple is. Even for Android, one of the largest open source free OS, it would drop old devices very far away very quickly.

Most impressed, my old PC built in 2008 still can install and run Windows 10. Every function is good and experience is very smooth. However, good days have gone.

On official website, Microsoft lists requirements for Windows 11:

  • Processor: 1 gigahertz (GHz) or faster with two or more cores on a compatible 64-bit processor or system on a chip (SoC).
  • RAM: 4 gigabytes (GB) or greater.
  • Storage: 64 GB* or greater available storage is required to install Windows 11.
    • Additional storage space might be required to download updates and enable specific features.
  • Graphics card: Compatible with DirectX 12 or later, with a WDDM 2.0 driver.
  • System firmware: UEFI, Secure Boot capable.
  • TPM: Trusted Platform Module (TPM) version 2.0.
  • Display: High definition (720p) display, 9″ or greater monitor, 8 bits per color channel.
  • Internet connection: Internet connectivity is necessary to perform updates, and to download and use some features.
    • Windows 11 Home edition requires an Internet connection and a Microsoft Account to complete device setup on first use.

First, we notice that the CPU is x64 only. It actually drops the support for old CPUs. But this is not a main problem because nearly all mainstream CPU running today is x64 compatible.

If you are ready to run x64 OS, you must have at least 4GB RAM, 8GB or 16GB recommended. But this is not a problem either: RAM is usually cheap, especially old DDR3 RAM. You can buy RAM to upgrade.

Then we find GPU should be compatible with DX12. Most recent GPUs, including Core Graphics Cards built in CPU, will be fine. But I’m not sure if it should be native DX12 support or just compatible with DX12. If the requirement is native DX12, I think many old GPUs need to be upgraded. And the laptops which only have old Core Graphics Cards would be dropped totally because they cannot upgrade their GPUs. The only method is to buy a new laptop.

Until now, there is no real challenge for upgrading. But the true trouble is there.

The most important thing here is that Windows 11 needs two things: UEFI and Secure Boot, TPM. These two things are very awful for old PCs because they cannot support them.

UEFI and Secure Boot usually come with motherboards produced around 2010. This means old PCs should change their motherboard. But changing motherboard means change a whole new PC because CPU, RAM and Motherboard are based on the same platform. If you change your motherboard, you change the whole platform. You would buy motherboard, CPU and RAM.

TPM usually comes with two solutions: hardware chips and CPU support.

Most of motherboards doesn’t have hardware chips on them because the chips are very expensive. And also, these motherboards would not build a preserved slot to let you install hardware chips because manufacturers think you will never buy any hardware chips.

CPU support TPM is much easier. However, it requires very latest CPU. That’s why we will find Microsoft’s support CPU list for Windows 11 is radical: 8th generation Intel later and AMD Ryzen 2000 later. I would like to say it’s very insane. But if you want your PC supports TPM, you must have those latest CPUs.

So, the truth is that Microsoft suspends old PCs. They are not allowed to install Windows 11.

But what I want to say is that it shouldn’t be like that. UEFI and TPM should be an optional requirement and they are only secure methods for PC. If you want to have best safe environment, you should have them, or you could still use your PC with new Windows 11. No functions will lose effects. If your PC can run Windows 10 well, it should run Windows 11 well too.

I don’t know why Microsoft chooses this radical policy. It’s weird.

There are three months for launching the new system, maybe Microsoft will change its minds.

The ironic thing is that even Apple is so radical to enforce every Mac device has TPM hardware chip, the Hackintosh is still so popular. Maybe there will be Hackindows in the future to let the device which doesn’t support UEFI, Secure Boot or TPM can install and run Windows 11.

Posted in Comment, Windows

聊聊前苏联国家的杀毒软件们,以及中国软件产业的问题

最近忽然又对杀毒软件起了兴趣,于是在市场上寻找合适的杀毒软件。查了一些知名品牌,发现一个很有意思的现象:前苏联国家盛产杀毒软件,而且大多是国际知名品牌。

  • 俄罗斯:Dr. Web,Kaspersky
  • 捷克:Avast,AVG(AVG已经被Avast收购,这两个杀毒软件现在是一家的)
  • 斯洛伐克:Eset NOD32
  • 罗马尼亚:BitDefender

作为首屈一指的科技强国,美国的知名杀毒软件公司也不过区区几家。世界上第一款杀毒软件McAfee姑且也算美国的(McAfee创始人是英国人,但长期在美国发展,后来把McAfee卖给了Intel),但为何前苏联国家如此盛产杀毒软件呢?

第一个原因当然是因为前苏联国家的科技水平普遍较高,这和苏联的整体实力不无关系,毕竟当年和美国打得有来有回。这些杀毒软件的创始人、员工大多在前苏联安全部门公司工作过,无论是技术实力,还是实战经验,都是国际一流水准。

但是第二个原因是很多人想不到的。

东欧剧变、苏联解体后,当地人民对于隐私安全的需求空前高涨。

比如为何罗马尼亚会诞生BitDefender呢?原来,罗马尼亚曾经出过一个十分变态的大独裁者齐奥塞斯库。这个人的手段十分了得,连打字机都要严格管控(根据打字机可以追查到文件的创作者),臭名昭著的月经警察也是这哥们的发明。可以说,罗马尼亚人民普遍感到恐慌和憎恨。随着齐奥塞斯库的倒台,罗马尼亚采取了一系列措施来纠正齐奥塞斯库时代的恐怖。比如罗马尼亚的服务器厂商(VPS)就以绝对安全的数据隐私著称,因为罗马尼亚的法律规定了政府不得以任何理由检查服务器内的数据,哪怕这些服务器用于犯罪。所以罗马尼亚的服务器成了VPN、TOR、盗版网站的首选。因此,在这种环境下,诞生BitDefender这样的杀毒软件也就毫不奇怪了。

第三个原因是前苏联国家的物价和工资普遍很低,这就导致他们无法消费得起欧美的电子产品,比如游戏、电视剧等。所以前苏联国家的人民非常喜欢下载盗版软件,浏览盗版网站,这就难免中毒。既然容易中毒,自然需要安装杀毒软件来保护自己,所以才会涌现很多杀毒软件。

第四个原因是当时IE浏览器仍然占据主流地位,导致浏览网页都能轻易中毒。随着Firefox和Chrome不断占领市场份额,浏览器内置的黑白名单、沙箱功能等安全措施屏蔽了绝大多数安全隐患。

说到这里,2008年前后也是国产杀毒软件开始兴起的时候,因为那时候随着网民增多,家用电脑的普及,很多人都上网下载盗版资源,导致电脑病毒、木马满天飞。U盘差不多也是那时候开始流行起来的文件传输工具,所以病毒靠U盘传播得也很迅速。一开始是瑞星、金山毒霸等独领风骚,后来则是免费的360独霸天下。这显然是因为当时国内的市场利好杀毒软件,使得很多厂商投入到杀毒软件的制作。

但是和前苏联国家相比,国产杀毒软件存在几个问题。

第一个问题是技术。

显然,国产杀毒软件的技术实力十分薄弱,跟国际知名杀毒软件无法相提并论。原来国产杀毒软件还有自主研发的精神,但是后面普遍都套壳了。比如360就使用了小红伞和BitDefender的杀毒引擎。

但是国产并不是没有过刻苦钻研技术的光辉时刻。江民杀毒软件的创始人王江民通过自学成才,自己编写杀毒软件查杀了工厂电脑的病毒,随后成立公司,发布了中国第一款杀毒软件。而王江民当时编写的杀毒软件一度风靡国际,不输国际大品牌。但是随着王江民英年早逝,市场环境变化,江民杀毒软件迅速地没落了。

第二个问题是心态。

国产软件厂商的心态普遍浮躁,急功近利,而且心术不正。看到杀毒软件火了,就一窝蜂地上。其实他们的根本目的不在于靠杀入软件本身盈利,而是靠杀毒软件占据客户的终端、流量入口,最终获得顾客的利益。这就导致国产杀毒软件普遍存在各种流氓行径,杀毒软件反而成了病毒、木马和流氓软件。

同样的问题也出在江民杀毒软件上。当时江民杀毒软件十分火爆,所以盗版横行。王江民为了解决这个问题,竟然暗藏恶意程序,给安装盗版软件的用户强制硬盘加密,只要付费购买正版软件即可解锁。我不知道这是不是王江民首创的,但是很显然,这和如今流行的勒索软件如出一辙,也就不难想象当时的用户有多愤怒。的确,用盗版不是什么光彩的行为,但是也轮不到软件公司出来评判,甚至反过来伤害用户的电脑和数据。最后,江民杀毒软件因为这事儿被重罚,名声也一落千丈。

最典型的案例是百度杀毒。当时国内的360和腾讯的安全管家早就占据了绝大多数的市场份额,百度才回过神来,感觉自己错失了良机,忙不迭开发杀毒软件,这就是百度杀毒。然而,百度杀毒说到底还是国际杀毒软件的套壳,并无核心技术。而百度又是心术不正的典型代表,所以用户普遍排斥百度,这就造成百度杀毒的装机量惨淡,口碑极差,可以说它的失败是必然的。果不其然,百度杀毒昙花一现,淡出了历史舞台。

第三个问题是诚信。

360的起步虽然得益于永久免费的承诺,但是其一直标榜的强悍查杀能力也是用户信赖的原因。360曾经在AV-C等知名榜单中霸榜过一段时间,但是好景不长,因为其作弊的问题,导致被除名。AV-C给出的理由是360送检的产品与实际产品不符合,只开启360自己的引擎,而并未开启BitDefender引擎,因此实际产品在防护能力、查杀能力、资源占用等都存在很大问题。国产厂商搞两个标准企图蒙混过关的事情屡见不鲜,各行各业都有经典案例,实在是不胜唏嘘。

但国产厂商最大的问题是,丢脸丢到了国际上去。本来去国际上评奖就是为了提高自己在国际和国内的名声,却弄虚作假反而把自己搞臭。事后360还不服,发表声明说,AV-C的检测存在传统杀毒软件的利益壁垒,360免费杀毒触动了其利益,自己主动退出AV-C评测。毫无疑问,自己犯了错,就反过来污蔑别人不是善茬,自己不稀罕,然后继续靠打鸡血博取一个掩耳盗铃的美名。

而360在获得了巨大成功之后,在市场占有率、财务状况都不错的情况下,腐化变质,逐步失去了用户的信赖。这导致360的用户这些年来纷纷弃用360。尽管有人认为用户抛弃360是因为杀毒软件市场、PC市场逐渐萎靡,但360旗下其他业务实际上也不如曾经那么顺利。曾几何时,360推出的新服务都受到用户的热烈拥护,反响强烈,现在则普遍冷淡。从这点来说,360无疑走了百度的老路,百度曾经也是被用户热烈拥护的,但是因为用户失去了对百度的信任,所以弃用百度相关的所有产品,使得百度举步维艰,开展一个新业务就注定失败,甚至胎死腹中。

杀毒软件的未来

随着微软在Windows 10中内置免费的杀毒软件Windows Defender,杀毒软件江河日下,市场份额一缩再缩。Windows Defender最初在Windows 10上发布时存在资源占用高,查杀效率低下,错漏较多的问题,但几年来随着微软的持续改进,无论是性能还是查杀效果,都已经达到业界顶尖水准,普通家庭用户已经没有安装第三方杀毒软件的必要。目前许多老牌杀毒软件纷纷推出免费版吸引用户的下载、安装、使用,推广附加的增值业务以获取订阅收入,形成一套完整的解决方案,这大概也是其他杀毒软件唯一比Windows Defender强大的地方。

然而,江湖老话说得好,没有人比微软更了解Windows,随着Windows内置的PowerShell的广泛运用,也带来了黑客、病毒、恶意软件利用PowerShell执行恶意脚本的可能性。微软自己推出了AMSI防御机制,有效抵御PowerShell脚本攻击。其他老牌杀毒软件也只能调用微软的AMSI接口,以实现对PowerShell脚本的查杀。

根据目前的微软官方最新消息,Windows 11将会强制在硬件上要求机器启用UEFI、Secure Boot和TPM。这无疑会进一步提升系统的安全性,从硬件层面阻断勒索软件的侵扰。

无论如何,我认为做软件、做事业、做人,都应该把良心放在第一位,对别人负责,对自己负责,这才是正确的道路。如今杀毒软件软件厂商也在积极探索转型,靠提供各种安全服务盈利,但总体来说,这些老牌杀毒软件厂商都在做自己该做的事情,不做出格的、越界的事情。

附录

最后,不得不说,单以杀毒软件来看,除了美国和前苏联国家,知名的还有:

  • 德国:小红伞,G Data
  • 英国:Sophos,Comodo,BullGuard, Total AV
  • 韩国:安博士
  • 日本:趋势科技
  • 西班牙:熊猫
  • 芬兰:F- Secure Antivirus
  • 冰岛:F-PROT Antivirus
  • 印度:K7 Security, MicroWorld eScan

这些杀毒软件长期在AV-Test网站上霸榜,久经考验,久负盛名。

可以看出,上述国家才是真正掌握了软件工业的国家。虽然杀毒软件市场日渐萎靡,但是互联网安全技术永不过时,这意味着上述国家才是大浪淘沙中剩下的强者。以此观之,中国的软件产业、互联网产业还有很长的路要走。

印度的MicroWorld从1993年开始起步,在30年的专业坚持下,成为世界顶级杀毒软件之一。西班牙的“熊猫”(Panda)就更具讽刺性:一个欧洲的公司起名“熊猫”,还做成了欧洲第一,这无疑让中国人更加汗颜。

Posted in Xiaomi&MIUI

小米、红米手机卡刷xiaomi.eu(Lineage OS)简要指南

刷机前一定要做的准备工作

一定要先学会fastboot模式下线刷MIUI官方ROM。

参考资料为本人之前撰写的文章:https://jaylinwu.wordpress.com/2017/02/17/92/

如果你尚未掌握线刷的技巧,请勿研究卡刷,因为很容易在中途变砖而开不了机,到时候无计可施,只能去售后。

同理,如果你在卡刷的过程中遇到任何问题,不用到处求人,只需要fastboot模式下线刷即可,一切都完好如初。

xiaomi.eu和MIUI国际版的区别

xiaomi.eu不是MIUI国际版。

MIUI国际版是小米官方出品的ROM,这些年来MIUI国际版也有所变质,所以越来越多的人选择xiaomi.eu。

xiaomi.eu是一个第三方团队出品的ROM,主要目标是精简、净化MIUI的官方ROM。功能上其实和官方国际版几乎是一致的,但是把所有不必要的组件(尤其是各种广告)给去除了。

xiaomi.eu保留了Google服务和小米云服务。

正确选择你的ROM

以前小米手机国内外售卖的型号在硬件上是一致的,现在则不然。

比如国内版本的 红米Note 9 Pro 在海外的版本是 Mi 10T Lite ,而海外型号为 红米Note 9 Pro 的手机完全是另外一部手机。海外一般把国内的 红米Note 9 Pro 称为 红米Note 9 Pro 5G。

那么,有什么好的办法能让我们从这些眼花缭乱的机海中确定自己的手机是什么版本呢?

其实很简单,就是找到手机的通用代码(codename)。每部手机都有自己独特的代码,比如之前提到的国内版本的 红米Note 9 Pro 和海外版本的 Mi 10T Lite 都有同一个代码gauguin,我们在找包的时候,顺着这个代码找便不会错。

查询codename的网站有很多,这里随便贴一个:https://miuiver.com/xiaomi-device-codename/

但值得注意的是,即便两部设备享有同一个codename,也不能轻易地相信,最好详细研究一下两部手机在硬件上是否完全一致,或者有没有重大的差别。比如国内版本的 红米Note 9 Pro 和海外版本的 Mi 10T Lite 在相机模块上是不一样的,一个使用三星镜头,一个使用索尼镜头,这就导致刷官方ROM后会令相机无法使用。好在xiaomi.eu解决了这个问题,相机模块可以做到通用。

总的来说,codename能简化我们的工作,但是也需要自己去对比硬件参数,亲自刷机实验一下有无问题。

下载xiaomi.eu

访问https://xiaomi.eu ,然后根据页面上的引导一页页找到下载页面。

如果你英文能力不好的话,建议开启网页翻译。

找包的时候,注意结合手机的型号和codename。

联发科的手机不建议折腾

联发科的处理器由于内核闭源的特性,导致recovery和刷机包都很难找,因为制作者们也很为难。xiaomi.eu也从未对联发科处理器的手机提供任何支持。因此,如果你的小米手机是联发科处理器,不建议折腾,乖乖用自带的出厂ROM。

下面正式开始刷机之旅!

解锁你的手机

解锁地址:https://www.miui.com/unlock/download.html

解锁软件以及具体的操作方法小米那边一直在更新,建议直接按照解锁页面、解锁软件给定的步骤去操作。

需要注意的是,目前小米对解锁提出了新要求:在开发者选项中绑定小米账户后,要等待168小时才能解锁。

刷入TWRP或者其他第三方recovery

打开TWRP的官网,搜索自己的机型的codename,下载recovery镜像,文件类型为.img。

重启手机进入fastboot模式,USB连接电脑。

打开电脑的命令行工具,执行以下命令:

fastboot devices //该命令确认你的手机是否正确连接了电脑

fastboot flash recovery “D:\file\twrp.img” //该命令刷入img镜像文件为recovery。双引号内的路径应当换成你自己下载的镜像文件的路径(按住shift键,右键该文件,选择”复制为路径“)

fastboot boot “D:\file\twrp.img” //该命令将镜像文件写入启动项中,并且引导手机自动重启进入recovery。 双引号内的路径应当换成你自己下载的镜像文件的路径(按住shift键,右键该文件,选择”复制为路径“)

在TWRP中要执行的操作

进入TWRP后,我们要先format data,也就是格式化内置存储分区(操作前请务必备份数据)。

Format data完成后,在TWRP的reboot选项中选择recovery,重启进入recovery。

接着,要确认格式化后的存储分区是不是f2fs的文件系统。在我的试验中,xiaomi.eu的ROM在ext4的文件系统下无法成功加密,导致开机卡米进不了系统,只有f2fs可以。确认文件系统的方法和改变文件系统的方法,自行上网搜索。

在TWRP的reboot选项中选择recovery,重启进入recovery。

现在,我们要把xiaomi.eu的包拷贝进手机中。

通常来说,TWRP的MTP是可以直接用的,也就是在电脑端可以通过USB直接访问手机的内置存储分区。但是在某些特殊情况下,电脑无法访问手机的内置存储分区,那么怎么办呢?

我推荐的方法是把ROM拷贝到一张SD卡中,然后插入手机。如果你的手机支持OTG,也可以通过OTG连接U盘或者读卡器。如果你的手机不支持SD卡或者OTG,那么只能用adb命令把ROM推送过去,具体的操作请自己上网搜索。

如果直接通过MTP拷贝到手机内置存储,TWRP应该默认就显示出那个ROM文件。如果ROM拷贝到SD卡中,还需要在TWRP中访问到该文件。点击TWRP界面最上方的返回按钮,然后找到sdcard1或者sdcard2文件夹,就能看到SD卡中的ROM文件。

在刷写ROM文件之前,还需要进行双清或者三清操作(cache、data等,但不包括system、vendor),在TWRP中就是执行一次factory reset。

对于清除数据而言,通常只需要执行factory reset,TWRP会自动帮你处理完毕,无需手动操作三清、四清。多删、误删反而会造成问题,得不偿失。

点击ROM文件,滑动刷入ROM文件。刷写完成后,点击reboot to system。首次开机时间较长,最后能顺利开机进入系统即为成功。如果一直卡在小米logo界面,则为刷机失败。

刷机失败后,可以选择fastboot线刷,也可以继续在TWRP中重刷ROM包、双清数据、修改文件系统等。

与刷写Lineage OS的区别

刷写Lineage OS的大体操作是一致的,具体区别在于刷完ROM文件后,要接着手动刷入firmware和opengapps的包文件。

firmware可以在https://xiaomifirmwareupdater.com下载到。

opengapps可以在https://opengapps.org/下载到。

xiaomi.eu因为自带了firmware文件和Google服务文件,所以不需要自己额外手动刷。当然,如果你不需要firmware保持最新,或者不需要Google服务,也可以不刷。

没有必要为了最新的firmware去fastboot线刷MIUI官方ROM,小米的firmware是有单独包可以刷的。其他手机因为没有单独可以刷的firmware,才需要先刷一遍官方ROM,坊间称之为“底包”。

另外,Lineage OS对TWRP的分区加密的文件系统并未强求f2fs,ext4就可以。

更新系统

更新就比较简单了。先通过手机联网下载新版本的ROM文件到内置存储分区中,然后重启手机到recovery。直接刷,不需要删除任何东西。但是大版本更新时,必须要三清、format data。什么是大版本更新呢?就是MIUI版本从12升级到12.5,Android版本从10升级到11。

Lineage OS支持OTA升级,跟一般的手机系统更新没什么区别。但是有时会因为TWRP的故障导致刷写失败,甚至无法开机,因此还是建议手动刷机。

Lineage OS是每周出一个新版本,但是xiaomi.eu是跟随MIUI版本,而MIUI版本更新实际上很慢,可能一个月才更新一次稳定版,所以手动刷机并不是一件很麻烦的事情。

Posted in Uncategorized

美国的数学考试允许使用计算器的真正原因

当我还在上初中的时候,要说有什么最喜欢玩的东西,那便是计算器。

那时我们流行用国产的自然手写计算器,不过其实功能是很弱的,远远比不上卡西欧的手写计算器。最典型的是国产的计算器表示分数只能用“a/b”的横行形式,但是卡西欧则能使用竖行形式。值得玩味的是,当时国产的计算器卖12元,而卡西欧卖120元;十年后,国产的计算器功能还是那么简陋,但是外壳做工提升了一下,便卖到30元,而卡西欧则降价到56元。

那时候每天把玩、研究计算器比打游戏还兴奋,我甚至自己不知道怎么就开发出了一种类似于倒计时的玩法,通过输入一串提前预设好的数据,然后一直按着方向键向下,就能在屏幕上连续出现10、9、8……的倒计时,而且时间正好间隔正好是1秒钟。现在回想起来,这大概是我编过的第一个程序,虽然实际上并不是编程,但是在实现方法上却和用计算机编程有异曲同工之妙。

而在那时,我便常常听说美国的学生允许使用计算器,而老师们也常说,美国人因为爱用计算器,所以数学不如我们。那时的我年少,倒也迷信几分这种话语,全然不知道美国的数学水平在世界是前列的,而我们中国人真正进入到现代数学的体系,则可能得到鸦片战争以后。因此,光以这种浅薄的根基来说,我们中国人所谓的水平数学高超,实则是一种计算能力,而这种计算能力又是十分初等的,其实是不足挂齿的。

计算器、计算机诞生后,我们更是明白,其实所谓的单一计算,根本不是人的长处,我们比计算机聪明的地方在于我们有着很强的思维能力,而计算机则没有,但比较起单一计算能力,人则远远不如计算机。我并不是否定基础运算的作用,基础运算的能力其实是非常重要的,但远远没有我们中国人所强调的那么重要。实际上,美国中小学的学习中也是较为强调基础运算的作用的,我观察到那些做数学视频的美国人的口算能力也是很强的,不输给中国人。我们中国人学习了很久的数学,其实陷入了一种重复劳动的尴尬,劳动量很大,但是思维的提升非常有限,而美国人则往往把精力花费在如何提升数学思维上。

最近从头开始学习一本地地道道的美国微积分教材后,更是让我明白其中的根本差距。

我不知道中国考试强调不用计算器的原因是什么,也许是对自己祖传的算术方法比较自信,也许是怕计算器削弱学生的计算能力,也许是怕有人靠计算器作弊,但从结果而言,既然不允许使用计算器,那么考试的答案就必须是能通过手写计算而出的。这就导致了我们很容易在特殊值上获得一种简单化的倾向,从而严重削弱了在真实世界中解决问题的能力。典型的比如三角函数,如果我们为了考试方便,当然都是用几分之pi的简单值,但实际上在工程运用中,通常会出现零点几的数值,学生往往搞不明白这个值到底代表什么含义(实际上是弧度值),也不明白如何转换成常用的角度值。

上述问题紧接着而来的就是,因为我们必须尽可能地简化计算,除了使用特殊值外,还必须让整个函数变得易于计算,但现实生活中,函数往往是复杂的,因此我们就会抛弃掉那些真实的案例。而因为美国允许使用计算器,所以他们的教科书和课后练习中会直接以现实生活中会出现的各种函数来举例,我印象比较深的有日落时间和每日温度是一个经过变换的sin函数。这些真实存在的物理公式,往往带有不那么凑巧的系数,用手计算可以说是很困难,但是用计算器则不然。因此,只要是真正明白各种数学知识的原理,实际上这些题目都是不可怕的,按部就班地拿计算器计算便是。

我们这种避免使用真实工程中可能出现的情况的倾向,就很容易让书本与考试脱离实际,让学生无法掌握真正的知识原理,也无法运用到生活实践上去。长此以往,不但丧失能力,更容易产生对数学的畏难情绪,看到真实存在的那些看似很复杂实则很简单的数学公式也会觉得如临大敌,怀疑自己是不是智商不如人,也不知道学数学到底有什么用。

因此,我认为,中国的数学教育是必须摆脱重复低效的,不能把学生的精力都浪费在重复计算上。让学生真正懂得函数的意义,各种公式的意义,才是对他们的一生有根本性的帮助的,才是对整个国家和社会的进步、发展有真正的帮助的。

现代计算机、编程语言以及各类运算软件的普及,使得普通人也能掌握强大的算力,而如果放在古代,是需要职业数学家们花费几年甚至数十年去手动计算、验证一个算式的结果。所以,如果我们到了现代还将我们的思维放在计算能力这种最基础的事情上,几乎可以说对自己、对社会、对人类都是没有任何帮助的。我们应该把主要精力放在如何计算上,也就是算法。

比如我在学习极限时,给定一个函数式,要求分别以正负0.1,0.01,0.001,0.0001的差值从左右两个方向不断逼近某点a,计算出数值并列表。即便使用计算器,仍然是一项较为浩大的工程,而且意义不大,因为我们主要是要了解极限的思想。这时候,运用我所掌握的编程知识,编写一个程序,就能全自动给出运算结果。

下图便是我用自己Python编写的一段程序,只有区区几行。如果要更改函数的算式,只需要修改f(x)内的算式;如果要添加更多差值以求得更加精确的极限值,修改delta_x即可;如果要修改要逼近的点的值,修改a的数值即可。

所以,最终,我们可以得出结论:掌握思想才是王道,其次是掌握工具的使用。这样,我们才可以在通往真理的道路上越走越远,而不是原地打转。

Posted in Politics

The Congress occupied: the new history of America to fight against bureaucracy

I am glad to see after 250 years, Americans got into the Congress. This is their first time did this.

Why this is the first time?

Because they believe in the Constitution. The believe that the Congressmen will do as the followings and people only do their own things. By that division of labor collaboration, the country will run as well as possible.

But recently they have known that the whole bureaucracy system are corrupted and even the Congress representatives voted by themselves won’t listen to them. When Mitch McConnell stands with the Democrats and prevents the vote fraud challenging. When Mike Pence lied and betrayed them many times, American people get tired of those bullshit.

The power of the Congress are generated under the Constitution and the power of the Constitution are granted by people. Some people says those people who crashed into the Congress are committing treason. But in fact, they are using the power of the Constitution and under the protection of the Constitution.

I need to point out that I condemn those who smashed and broke things in the Congress, some evidences show that they are BLM and Antifa members. Those who just stepped into the Congress peacefully, they should be free judge of crimes.

Sadly, I heard some from the people died due to gunshot when they tried to get into the Congress. One of them is a brave woman once served the US as military. While in the year 1932, Bonus Army also hurt the hearts of the veterans. The dilemma of that time is the same as now.

When we look back to the history of the world, people around the world over periods had once occupied their Congress. Why? Because they know the bureaucracy are corrupted. Because they want their voices to be heard. They want to change something.

After the long term of 250 years, Americans have reached this moment. They find themselves are in a delicate lie and nightmare are falling.

Mike Pence said “Today was a dark day in the history of the United States Capitol.” But as we know, the real darkness is the corrupted bureaucracy, including Mike Pence.

Politicians in Washington DC should consider their future, American people’s future and the world’s future.

Jan 6th is the beginning, not the end. America has a new history to fight against bureaucracy.

Posted in Politics

Will America to be new South Africa? The real problem is not only that simple.

Due to this unfair election, many people say that America will be a new South Africa. It sounds like a racist idea but that is not exact because many people misunderstand the real meaning of it.

To be a new South Africa means the tyranny of the majority, especially the anti-wisdom majority. A country may be prosperous before but then the anti-wisdom and corrupted majority seized the regim and then spare the whole country’s source to the majority and then the country will begin to lose vigor. Why? Because due to the bad human characteristics, people would tend to be lazy and want to get food for free.

Sound familiar? Maybe the Americans know the history of Soviet Union very well. And when you try to examine the Democrats’ political ideas and theories, it’s the same.

I don’t think Trump is a savior but he is a real patriot. He doesn’t want to see America falling down. He doesn’t want to see the world falling down. But four years later, what we see is a cruel world surrounded by evils.

Even today I don’t know what will happen to make Trump win the election. I heard that millions of people will appear in the Washington DC on Jan 6th to support Trump and guard the Constitution. I hope they will succeed.

But even Trump win the election, so what?

You see the whole administration system highly corrupted, including the Congress and the Supreme Judge and the Media. The fathers of the US referenced Roman Republic to design the US administration system. However, after nearly 250 years, the system doesn’t work. The Congress representants don’t listen to their voters’ voice. The Supreme Judge loses its individual rights to keep the balance and find out the fraud.

So can you tell me if the president is still Trump, so what?

Noting!

Once Obama the liar said ‘change has come to America.’ Yes, the America goes into the darkest era.

Rome Republic fell apart into two parts. I think if the chaos cannot be dealt within the US, the US will fall apart into two parts too. Although one half and the other half cannot rule the country together, two parts will be good: a good part and a bad part, that will make sure not the whole country be a bad one.

Due to the US is federalism, it is easy to make things happen. The last resort to keep the remaining civilization. You will never wake up a person who pretends to be asleep. So if it gets tense, just go away, just move. When the first bath of Americans arrived in Plymouth, they have determined their minds. They prayed to God for blessing.

Time is young, but we are not old enough. The civilization of humans is nothing indeed. It’s delicate and easy to be broken.

I love studying history, but the more I know, the more I understand that the history of human is just a joke.

Posted in Linux, Network, Visual Studio Code, Windows

VS Code SSH remote connect to Linux Server (Real Solution)

First of all, forget the one who told you using Putty to generate the key, it’s outdated now.

Why? Because in the past, only Linux supports SSH so that Windows should use third party tool to realize SSH remote connection. But now Windows 10 supports native SSH Client, so you must get used to this one and avoid strange errors or wrongs.

Then, let’s see how to generate SSH key by native SSH Client. It’s easy. Open your local terminal (Linux or Windows) and execute:

ssh-keygen

In fact, though there is many options can be added, I only recommend one:

ssh-keygen -C username

Must be uppercase C and you can change the username to be any name you want to use, but that should be used to log in your Linux Server as its username later. It should be the same as your Linux username.

After you execute the command, you just follow the instructions on the screen. If you want not to overwrite the existing key files, change the default directory. If it suggests you to input Phrase, that can be empty, just enter directly.

When done, remember the default directory in the instruction just now? For Windows, you can cd into C:\Users\your_username\.ssh\; for Linux, you can cd into home/username/.ssh/.

Now you can see two files: id_rsa and id_rsa.pub.

pub means public, so its a public key. For the other with no extension, it’s a private key.

Here is the annoying question: where should I put them?

Well, if you look up on the internet and you will find too much information about that but you will be more confused.

Exactly, ssh-keygen is just a tool to generate keys, that’s all. It’s not about how to connect. So whatever you generate on Windows or Linux, Client or Server, that’s fine, don’t care about it. You just use a tool to generate two files.

But then the following question again is: So where should I put them indeed?

Well, maybe there is many theories behind the scene, but let me tell you the simple truth: client stores the private key and server stores the public key.

For example, you have PC A and PC B, you want to use PC A connect to PC B, so you should store the private key on PC A and store the public key on PC B.

But you should always make sure they are in a pair because you may have generated many key pairs before or later.

Why the server should store the public key? In fact, it’s easy to understand. The server will show the public key to anyone, but only allow connecting with who holds the private key. Due to the key stored on the server is public, so we called it public key.

Now let’s move on.

Now that we have known we should upload our public key on the server, let’s do it. If your client is Linux, thats easy, using:

 $ ssh-copy-id user@host

But if you are using Windows, ssh-copy-id should not work. So we need to understand what ssh-copy-id does.

Okay, we find a new file called authorized_keys. Go to your Linux server (use shell, SFTP or GUI), create that authorized_keys file under home/user/.ssh/ and copy the pub file contents (you can open it by VS Code) and paste into the new empty file. Save it.

In fact, id_rsa and id_rsa.pub is not necessary here

In case, reboot your Linux server now.

And now we should care about our path to store the private key. If you generate the keys on Windows directly, you should store it under C:\Users\username\.ssh\. If you generate it on Linux but you want to let it be stored on your Windows, you should download it from the Linux first. How to download it? I think SFTP is the best way. Use your SFTP tool to download it from Linux path home/username/.ssh and then store it under the same path on Windows.

Now we should check what we have done before we go on:

  1. we generate SSH Keys in a pair using ssh-keygen
  2. we store the private key on our client Windows PC (under C:\Users\your_username\.ssh\)
  3. we store the public key on our server Linux PC (under home/username/.ssh/authorized_keys)

Now let’s move on.

Open your VS Code, install SSH extensions in Extension Store. After installation, you will find a new icon on the side bar. Click it.

You can add new connection by “+” button. Follow the instruction on the top popped out dialog. After done, click ⚙ button. It will let you choose the path where SSH key files store. Then you will open a config file.

You can edit something here:

Host will change the UI display on the panel.

Hostname: the IP address or URL of your server.

User: should be the same as ssh-keygen -C username.

Port: the SSH port. Default is 22.

If you are using Virtual Machine like VirtualBox, you need to forward your Virtual Machine port (like 22) to the Host Machine port (like 12345).

IdentityFile: if you don’t add this option, VS Code will use the default ssh path (C:\Users\username\.ssh). But if you have many SSH key files to store in different paths, you should tell VS Code where is that file. On Windows, the “\” should be changed to “\\”.

Edit this file as your condition and save it.

Sometimes, there’s a problem on connecting a server by a forwarded port. You need to use the server real IP directly. You need use “ifconfig” command on your server shell screen. If it doesn’t work, just use apt install net-tools to get it. Type ifconfig, you will see server IP on the shell screen. Use this IP in your vscode config file, and set Port as 22(or delete Port line because the default port is 22).

Before we go, a small thing we need to deal with: go to C:\Users\username\.ssh, you will find a file called known_hosts. Delete it, it will be regenerated itself.

Return your VS Code panel, move your cursor on the server you want to connect, an icon will be shown on the right. Click it and you will begin connection in the new window. Follow the instruction on the top pop out dialog, then everything should be done.

Enjoy it!

If you want to connect to the server by tools like Putty or Shell…

Remember, you must use the same username as your keys generated, or the server will deny connection. (Error message: Permission denied (publickey))

For example, if we generated the key with username jaylin, and you want to connect to the server by Shell, you must use the command below:

ssh jaylin@ipaddress

After log in as jaylin, if you want to get root permission, you can use

sudo su

If your private keys stored in some specific path, you should use command below:

ssh -i /path/id_rsa jaylin@ipaddress

If you still meet strange problems, try to delete the known_hosts file under C:\Users\username\.ssh.