Approaches to Disable SSH

一、禁止用户登录

1、修改用户配置文件/etc/shadow
将第二栏设置为“*”,如下。那么该用户就无法登录。但是使用这种方式会导致该用户的密码丢失,也就是当你再次允许他登录的时候,你还得让他重新设置密码。(再次启用这个帐号的方法是把“*”去掉就可以了)
如:tom:*:14245:0:99999:7:::

为了使原密码不丢失,可以在原密码前面加一个特殊字符,比如”!”。需要再次启用这个用户的方法是删除此感叹号”!”。

2、使用命令usermod
这个方式简单又实用,而且没有(1)中的副作用。

1
2
usermod -L tom##Lock 帐号tom
usermod -U tom##Unlock 帐号tom

Read More

ISO 26262 Hardware Dev Requirement

Functional Safety

Design Integrity Device Quality Functional Safety
Function correct? Performance & power Silicon Design & Manufactory Device Failure Detection and Response Mechanisms
Function verification: Prevent/Eliminate Bugs Reduced DPPM Detect/Control Failures
Use best-in-class Functionla verification methodolody and tools DFT/Function patterns Assessed by Functional Safety Verification methodology and tools
SYSTEMATIC FAULTS - Design Bugs RANDOM FAULTS RANDOM FAULTS - HW FAILURES
Always permanent Permanent Permanent/Transient
Development Manufacturing In Operation

This Beta Version of Tyora Is Expired

Solution

  • Open in Explorer: C:\Users\xxx\AppData\Roaming\Typora
  • Sort by date
  • Delete latest two files: profile.data and typora.log

Updated on 7/16/2022
The above solution doesn’t work any longer. Luckily we have a “patch” by doing follows.
Win+R - regedit - Computer\HKEY_CURRENT_USER\Software\Typora

  • Right click on the folder of “Typora”
  • Select “Permissions…”
  • Select “Administrators”
  • Deny all check boxes

FTP Commands

Commands Description
open Connect
user Login user
bin Binary transfer mode
prompt on Switch on prompt (interactive)
prompt off Switch on prompt (non-interactive)
cd Change dir
lcd Change local dir
dir / ls List remote files or dirs
!dir / !ls List local files or dirs
put Upload a file
mput Upload multiple files
get Download a file
mget Download multiple files
mkdir Make remote dir
!mkdir Make local dir
bye Exit

Hide Unused Quick Links in Windows

1. Win+R -> regedit

2. Goto
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions

3. Change the string value of “ThisPCPolicy” from “Show” to “Hide” in following domains
Pictures: {0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag
Videos: {35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag
Downloads: {7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag
Music: {a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag
Documents: {f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag

4. New a string value of ThisPCPolicy = “Hide” in following domain
Desktop: {B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag

How Many Birds Do Cats Kill Every Year

1. Cats Kill Between 1.3 and 4 Billion Birds Annually

Estimating exactly how many birds are killed by cats is difficult. Many studies have tried, and not all of them are based on rigorous scientific estimation.

Particular cats kill more birds than others, so it doesn’t make sense to multiply the number of cats by an average “bird kill rate” and call it a day.

One of the newest studies to be published estimates the kill rate to be around 1.3 to 4 billion birds. They used a systematic method for calculating this rate, taking different feline predatory rates into account.

Read More

Install Specific Version of Python

1. Download Python source tarball for your specific version

https://www.python.org/downloads/source/

2. Unpack the tarball and install

1
2
3
4
root@localhost# tar xvf Python-3.10.4.tgz
root@localhost# cd Python-3.10.4
root@localhost# ./configure --enable-optimizations
root@localhost# make altinstall

3. Set the new version by default

For individual user: alias python '/usr/local/bin/python3.10'
For system-wide activation: update-alternatives

4. Check the new installation

1
jim@localhost% python --version

Update Alternatives

If there are several versions of a tool installed in Redhat. Use command update-alternatives for prioritization.

For instance with Python, saying Python 2.6, 2.7 and 3.6 versions are installed. With root following bundle of commands activates Python3.6 to be the system-wide default version.

1
2
3
4
5
6
7
8
9
root@localhost# update-alternatives --display python
root@localhost# update-alternatives --install /usr/bin/python python /usr/bin/python2.6 1
root@localhost# update-alternatives --install /usr/bin/python python /usr/local/bin/python2.7 2
root@localhost# update-alternatives --install /usr/bin/python python /usr/local/bin/python3.6 3
root@localhost# update-alternatives --display python
/usr/bin/python2.6 - priority 1
/usr/local/bin/python2.7 - priority 2
/usr/local/bin/python3.6 - priority 3
Current 'best' version is /usr/local/bin/python3.6.

SH Re-Open After 70 Days Lockdown

3月22日到6月1日,上海经过了长达70天的封城,今天终于迎来了全市解封。

昨天全市新增感染人数只有14个了,数据确实也支持解封。

但是这解封的行政指令来的太突然,太彻底了,对于大部分上海市民来说都有种猝不及防的感觉。当然瞬间的猝不及防之后就是压抑已久的情绪释放,于是今天出现了大量户外群体聚集的情况,大部分公司瞬间回到正常上班状态,这直接导致下班时间部分路段出现大堵车。这可是解封第一天啊!

事情的发展如果出现“火箭式直上”,或者“断崖式直下”的突变,那么就该引起足够的警惕。所以在大家选择奔走相庆的时候,我选择冷静,自主延长隔离一周,让子弹飞一会儿。