程序员的宣誓

The Programmer's Oath

by Robert C. Martin (Uncle Bob)

In order to defend and preserve the honor of the profession of computer programmers(为了捍卫和维护专业计算机程序员的荣誉),

I Promise that(我在此承诺):

1、I will not produce harmful code.(我不会创作不良的代码。)

2、The code that I produce will always be my best work. I will not knowingly release code that is defective either in behavior or structure.

3、I will produce, with each release, a quick, sure, and repeatable proof that every element of the code works as it should.

4、I will make frequent, small, releases so that I do not impede the progress of others.

5、I will fearlessly and relentlessly improve the code at every opportunity. I will never make the code worse.

6、I will do all that I can to keep the productivity of myself, and others, as high as possible. I will do nothing that decreases that productivity.

7、I will continuously ensure that others can cover for me, and that I can cover for them.

8、I will produce estimates that are honest both in magnitude and precision. I will not make promises without certainty.

9 、I will never stop learning and improving my craft.

This article from:http://blog.cleancoder.com/uncle-bob/2015/11/18/TheProgrammersOath.html

Linux常用命令汇总

df 查看存储状态

top 查看内存和CPU状态

last 查看历史登陆,可以看看服务器有没有陌生IP登陆

例:last|grep 192.168.1.1  查看192.168.1.1的登陆情况 

dmesg:查看核心启动日志

free:显示内存使用情况

uname -a :显示系统信息

 

tail 查看文件尾

例:tail -100f game.log 查看文件最后100行,持续刷新,适合在服务器上看实时日志时使用


查看指定端口是哪个服务在使用:

sudo fuser -v 9000/tcp

 

Linux杂记

此帖子用于记录使用Linux过程中遇到的各种小问题。


1、使用ln命令跨分区链接目录时,报错“目录链接出错”。

答:2.4 kernel以上,可以用mount –bind命令来链接。

 The bind mounts.
              Since Linux 2.4.0 it is possible to remount  part  of  the  file
              hierarchy somewhere else. The call is
                     mount --bind olddir newdir
              or shortoption
                     mount -B olddir newdir
              or fstab entry is:
                     /olddir /newdir none bind

              After  this  call the same contents is accessible in two places.
              One can also remount a single file (on a single file). It's also
              possible  to  use  the  bind mount to create a mountpoint from a
              regular directory, for example:

                     mount --bind foo foo

              The bind mount call attaches only (part of) a single filesystem,
              not possible submounts. The entire file hierarchy including sub‐
              mounts is attached a second place using

                     mount --rbind olddir newdir

              or shortoption
                     mount -R olddir newdir

              Note that the filesystem mount options will remain the  same  as
              those  on  the  original  mount  point, and cannot be changed by
              passing the -o  option  along  with  --bind/--rbind.  The  mount
              options  can be changed by a separate remount command, for exam‐
              ple:

                     mount --bind olddir newdir
                     mount -o remount,ro newdir

              Note that behavior of  the  remount  operation  depends  on  the
              /etc/mtab  file. The first command stores the 'bind' flag to the
              /etc/mtab file and the second command reads the  flag  from  the
              file.  If you have a system without the /etc/mtab file or if you
              explicitly define source and  target  for  the  remount  command
              (then  mount(8)  does  not read /etc/mtab), then you have to use
              bind flag (or option) for the remount command too. For example:

                     mount --bind olddir newdir
                     mount -o remount,ro,bind olddir newdir

继续阅读Linux杂记

在Linux下如何打开bitlocker加密的硬盘

我们这里用到一款叫做dislocker的工具,它可以在Linux或者Mac OSX中,读写被Windows Bitlocker加密的卷。它的GitHub地址:https://github.com/Aorimn/dislocker

以下是我的操作步骤:

1、创建两个文件夹,用来挂载被解锁的文件块和硬盘上的文件,我这里分别在/media目录下创建了windows文件夹和mount文件夹,打开终端(Ctrl+Alt+T),输入下面的命令:

$sudo mkdir /media/windows
$sudo mkdir /media/mount/

继续阅读在Linux下如何打开bitlocker加密的硬盘

对代码命名的一点思考和理解

一个软件最后都会落实到代码。而代码,其背后的架构设计或设计思想或模式固然重要,但我觉得更重要的东西则是良好的命名。混乱或错误的命名不仅让我们对代码难以理解,更糟糕的是,会误导我们的思维,导致对代码的理解完全错误。相反,良好的命名,则可以让我们的代码非常容易读懂,也能向读者正确表达事物以及逻辑的本质,从而使得代码的可维护性就大大增强,读命名好的文章是非常流畅的,会有一种享受的感觉。

继续阅读对代码命名的一点思考和理解