离开的话语

最近两年眼见同事们陆续离开,时而感慨 “天下没有不散的筵席”。有的人带着新的希望去到下一站,有的人带着愤怒和倔强离开,有的人被公司裁员不得不离开,有的人依然期待着什么…

并不仅仅因为一些认识的人离开而让我感伤、叹息,也因为那些我不认识的人他们离开时包含感情的语句,和勾起我同样的经历的珍贵回忆,让我共鸣,让我惋惜。

摘抄一下一些真诚的、深刻的语句,也是我很喜欢且认同的经历。

(希望等我离开时,不仅仅是一句江湖再见,苟富贵勿相忘, 之类的俗套的话语;当然或许我什么也不会写到邮件里,甚至懒到不去发一封邮件。)


I’m leaving this office that has been more than just a workplace. It’s a place bursting with challenges, laughter, and invaluable lessons.

As I move forward, I carry with me not just experiences but relationships that I treasure deeply. Some of you have become more than my friends and an important part of my life. You know who you are, I would have expressed it to you personally at some point in the last 5 years. I cherish you and will continue to do so.

To those people: what a remarkable journey we’ve embarked on together. Each day spent with you was filled with moments of learning, joy, and immense fun. We’ve gone through things that seemed insurmountable, celebrated victories big and small, and sometimes, braved losses together. Every tough problem was lighter because I had you all by my side.

Thank you for the inspiration you’ve unknowingly bestowed upon me. It was your support that transformed my challenges into achievements and my doubts into confidence. Your memories will always echo in my mind, bringing a smile just as they often brought exhaustion.

有的人在工作中找到自己的乐趣,有的人能找到自己的挚友和同伴,也有的人只是当同事就是同事而已;无论如何,每个人都有自己对待工作、同事的态度,没有谁对谁错,只是收获的多与少,信任的深与浅。当今社会,工作占据了大多数的时间,与同事相处的时间可能比家人都多得多,如何对待他们每个人都有自己的观点。

Please keep in touch, I’ll do the same. I am excited about the future but will forever hold onto the past we shared with such fondness.

Shell getopts处理多命令行选项

场景一:有多选项,但每次只用一个选项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
status=off #定义变量status,初始值设置为off
filename="" #定义变量filename,用于保存选项参数(文件)
output="" #定义变量output,用于保存选项参数(目录)

Usage () { #定义函数Usage,输出脚本使用方法
echo "Usage"
echo "myscript [-h] [-v] [-f <filename>] [-o <filename>]"
exit -1
}

while getopts :hvf:o: varname #告诉getopts此脚本有-h、-v、-f、-o四个选项,-f和-o后面需要跟参数

#没有选项时,getopts会设置一个退出状态FALSE,退出循环

do
case $varname in
h)
echo "$varname"
Usage
exit
;;
v)
echo "$varname"
status=on
echo "$status"
exit
;;
f)
echo "$varname"
echo "$OPTARG"
filename=$OPTARG #将选项的参数赋值给filename
if [ ! -f $filename ];then #判断选项所跟的参数是否存在且是文件
echo "the source file $filename not exist!"
exit
fi
;;
o)
echo "$varname"
echo "$OPTARG"
output=$OPTARG #将选项参数赋值给output
if [ ! -d $output ];then #判断选项参数是否存在且是目录
echo "the output path $output not exist"
exit
fi
;;
:) #当选项后面没有参数时,varname的值被设置为(:),OPTARG的值被设置为选项本身
echo "$varname"
echo "the option -$OPTARG require an arguement" #提示用户此选项后面需要一个参数
exit 1
;;
?) #当选项不匹配时,varname的值被设置为(?),OPTARG的值被设置为选项本身
echo "$varname"
echo "Invaild option: -$OPTARG" #提示用户此选项无效
Usage
exit 2
;;
esac
done

场景二:一次性支持多选项

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash

while getopts "c:t:p:e:" opt_name; do
case $opt_name in
c)
case $OPTARG in
aws)
export cloud='aws'
;;
azure)
export cloud='azure'
;;
aliyun)
export cloud='aliyun'
;;
*)
echo "-c Option choose: aws, azure, aliyun"
exit 1
;;
esac
;;
t)
case $OPTARG in
one)
export clustertype='one'
;;
two)
export clustertype='two'
;;
*)
echo "-t Option choose: aaaa, bbbb"
exit 1
;;
esac
;;
p)
export project_name=$OPTARG
;;
e)
export project_env=$OPTARG
;;
:)
echo "$OPTARG Option need a argument"
;;
esac
done

echo "\033[31mAttention\!\033[0m" # red font
echo "Input parametes is: $cloud--$clustertype--$project_name--$project_env"

getopts、getopt的区别

在介绍如何使用getopts、getopt处理命令行参数之前,先来简单的说下getopt、getopts两者的各种特点和区别

首先来说getopts,getopts是shell中内建的命令,它的使用语法相对getopt简单,但它不支持长命令参数(–option)。它不会重排列所有参数的顺序,选项参数的格式必须是-d val,而不能是中间没有空格的-dval,遇到非-开头的参数,或者选项参数结束标记–就中止了,如果中间遇到非选项的命令行参数,后面的选项参数就都取不到了,出现的目的仅仅是为了代替getopt较快捷方便的执行参数的分析。

相反的是,getopts的缺点正好是getopt所具有的优点。相对于getopts而言,getopt是一个独立的外部工具(Linux的一个命令),它的使用语法比较复杂,支持长命令参数,会重排参数的顺序。在shell中处理命令行参数时,需要配合其他Linux命令一起使用才行。

总的来说getopts和getopt相比,getopts使用起来比较简单,但只支持短参数,getopt使用起来虽比较复杂,但处理的参数类型比较广泛


reference links:

Git configuration

There are 3 levels of git config; project, global and system.

  • project: Project configs are only available for the current project and stored in .git/config in the project’s > directory.
  • global: Global configs are available for all projects for the current user and stored in ~/.gitconfig.
  • system: System configs are available for all the users/projects and stored in /etc/gitconfig.

git支持多级配置,如:系统级、用户级、项目级、工作区级;它们的优先级如下:工作区级配置 > 项目级配置 > 用户级配置 > 系统级配置;每级配置记录在对> 应的配置文件中,通过 git config 命令设置的配置项 也都会写在对应的配置文件中,配置文件的具体信息如下:

  • /etc/gitconfig :系统级配置文件;对系统中所有用户都普遍适用的配置。若使用 git config 时用 –system 选项,读写的就是这个文件。
  • ~/.gitconfig :用户级配置文件;用户目录下的配置文件只适用于该用户。若使用 git config 时用 –global 选项,读写的就是这个文件。
  • 当前项目的 git仓库目录中的配置文件(也就是工作目录中的 .git/config 文件):这里的配置仅仅针对当前项目有效。若使用 git config 时用 > –local 选项 或 省略,读写的就是这个文件。
  • 工作区级配置文件 :这里的配置仅仅针对当前工作区有效。若使用 git config 时用 –worktree 选项,读写的就是这个文件。

面对不同类型的代码仓库,有时候我们需要使用不同的用户名,以及一些特殊一些的git参数。如何有效快速的设置,而不是按照一个一个repo去逐一的设置;但全局设置又兼顾不到一些剩余的代码仓库

编辑home目录下的 .gitconfig,按照如下配置的前提是:通常我们把一类代码仓库的放在一个目录下,例如按照公司名称来区分目录,或者是 gitlab_repo, github_repo这样来分。下面的代码片段只是展示最为简单的配置方法,可自行根据需求设置。

1
2
3
4
5
6
vim ~/.gitconfig

[includeIf "gitdir:~/company_a/"]
path = .gitconfig-company_a
[includeIf "gitdir:~/company_b/"]
path = .gitconfig-company_b

注意⚠️:

  • gitdir 后面的目录路径在最后需要包含 一个斜杠 “/”;后面的 Conditional 规则也是支持灵活匹配的
  • path 路径建议使用绝对路径

在对应的 .gitconfig-company_a.gitconfig-company_b 文件中,参数的设置就如何普通的 .gitconfig 一样,例如下面的代码片段。

如果是一些字段(如user.name)的值是一致的,也可以无需在多个gitconfig文件中声明,只在 home目录下的.gitconfig 文件中定义一次,等同于运行命令 git config --global user.name "John Doe"

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[user]
name = John Smith
email = john.smith@companya.net

[core]
sshCommand = ssh -i ~/.ssh/id_rsa_companya

#### or
[credential]
helper = osxkeychain
[pull]
rebase = true
[rebase]
autostash = true
[gpg]
program = gpg
[commit]
gpgsign = true

[http "http://git.cn.companyB.net"]
sslVerify = false

如何查看我们设置的参数是否生效了

1
2
3
4
5
$ git config --show-origin --get user.email
file:.git/config tomcat@companyA.net

$ git config user.email #并不能显示是哪个文件
tomcat@companyA.net

另外也可以通过命令的形式将参数写入具体的文件中,例如 git config -f 对应的配置文件/的路径/gitconfig_company_c user.email abcdef@qq.com`

更多详细的gitconfig中的参数可以参考 https://git-scm.com/docs/git-config,或者在本地用man命令查看, 如 $ man git-config


reference links:

English Note 05-面试

讨论面试这个话题

Well, we could have a mock interview. I could role-play as the interviewer and you cpuld pretend to be the interviewee.

Yup.Then the interviewer will want to know what actions you took to achieve your goal.

Exactly. And then the interviewer might ask you about a task, something you wanted to achieve.

I heard back from a few companies that offered me interviews.
我得到了一些公司给我的面试机会.

English Note 04-blog

这里分享一些个人认为值得仔细阅读和学习的一个英文博客站点,可能无关于技术,也可能只是生活工作的一个小的感受,某个小的想法。他们来自于全世界不同的地方,借助于他们的启迪,或者能让我们有一些新的认识,缓解一下生活的压力,城市的快节奏,抑或是内心片刻的平和,足矣。

How to Get Rich

I Got Laser Eye Surgery

English Note 00-礼貌/不礼貌的用语

不管你的外语说的如何,但礼貌是最基本的。或者说避免使用不礼貌的用语也很重要,不然会让对方误解,甚至生气等等

礼貌用语

不礼貌用语

来源:【如何更有禮貌的說英文】’’Excuse me’’的正確用法/別再說’’I want’’!

1. Wait

  1. Hang on a second
  2. Could you give me a moment?
  3. Please can you wait a second?

2. 祈使句

在英语中,祈使句总体来说不太礼貌,比如:
Tell me.. ❌
Check something… ❌
Do something ❌

将其转变为一个疑问句会更合适一些
Could you let me know what time we’re meeting?✅
Please, could you have a look at this?

3. Already

“I already have done it” ❌
听起来有点儿防御性,似乎在质疑别人,潜台词是“难道不相信我吗”

4. I want

应该说 I would like

5. Hedgin

This way is better…

I think this way might be better. ✅
加入不确定性让句子听起来更礼貌一些

I don’t know why…
I’m not quite sure why… ✅

This was wrong…
I think there was something that might not have been quite right here. ✅

其他用语

The theory is now with you. Go get your hands dirty.
现在你已经掌握了这些理论了,放手干吧.

Exactly, they’ll sort it out and see if it’s viable plan, then the CEO will approve.
(if在类似场景的用法)

When is it due?
什么时候交?/什么时候到期?

My boss gave me this report at the last minute. I’m short on time.
…..我时间很紧张.

Not so great, James. I’m really nervous. Kyle told me that the boss is going to start firing people.

Thanks a million. I really appreciate it.

I am eager to use them. Is there something you want me to start on?

Considering your results, we’d like you to give a talk about the best practices.
Considering句式

  • Yo, Ken, what’s new?
  • Same as usual

Reference Links:

  1. 15句英語口語常用的禮貌用語
  2. https://englishlive.ef.com/zh-tw/blog/career-english/request/

English Note 03-写代码必备

英文标点符号(中英对照)

符号 ta的英文 ta的中文
{ open brace, opencurly  左花括号
  } close brace, close curly  右花括号
  ( open parenthesis, open paren  左圆括号
  ) close parenthesis, close paren  右圆括号
  () brakets/ parentheses  括号
  [ open bracket 左方括号
  ] close bracket 右方括号
  [] square brackets  方括号
  . period, dot  句号,点
  \ vertical bar, vertical virgule  竖线
  & ampersand, and, reference, ref  和,引用
  * asterisk, multiply, star, pointer  星号,乘号,星,指针
  / slash, divide, oblique 斜线,斜杠,除号
  // slash-slash, comment 双斜线,注释符
  # pound  井号
  \ backslash, sometimes escape  反斜线转义符,有时表示转义符或续行符
  ~ tilde  波浪符
  . full stop  句号
  , comma  逗号
  : colon  冒号
  ; semicolon  分号
  ? question mark  问号
  ! exclamation mark (英式英语) exclamation point (美式英语)
  ‘ apostrophe  撇号
  - dash 破折号
 … dots/ ellipsis  省略号
  “ single quotation marks 单引号
 “” double quotation marks 双引号
  ‖ parallel 双线号
  & ampersand = and
  ~  swung dash 代字号
  § section; division 分节号
  →  arrow 箭号;参见号

Reference Links:

Q Blog List

收集一些有趣的博主,大多是技术相关的博主,但也包含不少一些对生活的感想、自己的追求等随性的随笔,有“繁体字”的, 也有海内外的。

大合集

里边是一些别人统计收藏的站点,可以说是一个宝藏列表,无聊时翻翻说不定可以找到有趣的内容。

https://github.com/alaskasquirrel/Email-newsletter-RSS
https://github.com/timqian/chinese-independent-blogs

Blog Name About Note
Reimbar Some notes on tech, food and philosophy

English Note 02-邮件

How To Reply Customers’ Questions

参考:https://www.woculus.com/reply-customers-questions-via-email/

项目上一封回复客户提出的具体技术问题的邮件,参考如下:

1
2
3
4
5
6
7
I hope you are well.  This is Jack from XXX Support and I have taken ownership of your case to further assist you.

It's my understanding you are looking to increase .... At this time, we have raised the limit from 20 to 100 and 100 is our hard limit.

As a workaround, we recommend you / your team to check and see if there are any used API that may be deleted so new keys can be provisioned under the 100 limit.

Thank You for your understanding and please let us know if further question.

20 phrases for closing an email

来源: https://www.linkedin.com/pulse/20140903131536-29650941-20-phrases-for-closing-an-email

Expressions for thanking

Thank you for your help. / time / assistance / support.

I really appreciate the help. / time / assistance / support you’ve given me.

Thank you once more for your help in this matter.

Expressions with a future focus

  1. I look forward to hearing from you soon / meeting you next Tuesday.
  2. I look forward to seeing you soon.
  3. I’m looking forward to your reply.
  4. We hope that we may continue to rely on your valued custom.
  5. We look forward to a successful working relationship in the future.
  6. Please advise as necessary. (请在必要时提出建议。)
  7. I would appreciate your immediate attention to this matter.

Expressions for showing them you want to help

  1. If I can be of assistance, please do not hesitate to contact me.
  2. If you require any further information, feel free to contact me.
  3. If you require any further information, let me know.
  4. Please feel free to contact me if you need any further information.
  5. Please let me know if you have any questions.
  6. I hope the above is useful to you.
  7. Should you need any further information, please do not hesitate to contact me.
  8. Please contact me if there are any problems.
  9. Let me know if you need anything else
  10. Drop me a line if I can do anything else for you.

如何回复感谢信

年底又近,newsletter,感谢信在公司邮箱中出现的越来越多。如果作为被表扬团队中的一员,如何回复比较礼貌得当;如果作为旁观者,如何祝贺别人、夸赞别人。

有一些常用的模式在这种类型的邮件里,例如这一篇How to Reply to Thank You Emails (With Template, Examples and Tips)

Congratulations, team!
XXX is new to us, the process of building trust is not easy, but thanks to everyone’s outstanding contribution, we have won the full trust of our clients! We did it!

And I would say that during this journey, we gradually know more about each other. We built trust step by step, we shared the joy of release 1, and we faced the issues together.

How honoured I am to have joined this team, and met such great guys!

Wow! So proud to receive plenty of appreciative words from clients.

We have worked with them in different countries and never seen them face to face, it was not easy in the process, especially at the beginning because we have different cultures and ways of working.
But so lucky to have met so many great team members in this process and we have done such good things in the end.

Hope XXX gets better and better in the new year.

Congratulations! I’m so happy and proud that I’m a member of XXX team.

The process at beginning was not easy, but we overcame lots of difficulties, and now we did it!

下面职位高一些的大佬的认可
Wow! Congrats to each person on this team.

This is amazing feedback.

Thanks to everything that each person does to make this sort of feedback possible.

English Note 01-会议用语

关于会议

按照时间线划分:

会议前 → 会议中 → 会议后

按照会议主题划分:

  1. 交流工作、同步进展,就问题简单讨论;
  2. 专门解决问题的会议
  3. 产品/成果展示

我们通常需要提出自己的建议和见解,当然也需要提出自己的需求一次希望对方来完成某件事情;有时还要顾及其他的感受,主动询问别人的建议.

常用语

I’ve scheduled a meeting for Friday to discuss our marketing strategy.

It’s scheduled for two o’clock. Is that okay?
会议安排在两点,你可以吗? (注意介词 for, 没有用at,on等)

I will be with a client until 12,so i need you to chair the meeting if I’m late.

Basically we need to use this meeting to iron out concerns over the new platform.

Can you look through this agenda and highlight our areas of interest?

I’ll take notes and pass them through to everyone this afternoon.

Does anyone have any concerns?

⭐ That’s one idea, but I’d like to look at mutilple solutions.

I’ll come with ideas. (我也想想点子)

电话会议

- Matt,are you there?
- Yeah. Hey everybody, can you hear me?
- Yes, we can. Is the video clear?
- Um, you’re a little fuzzy. Waita minute. Okay, I adjusted my screen settings. (fuzzy: adj. 模糊)
- Thank you for joining us from Montreal.
- My pleasure. Thanks for adjusting for the time change.
- ⭐ Yeah,what time is it there? (你那边现在几点)
- Nine o’clock for me. Perfect. - All right, let’s get started.** - ⭐ Matt, just chime in when you have something to add (如果我们讨论的时候你想补充什么,就直接说). You are a vital part of this discussion(你的意见对我们至关重要).*
- Will do. (好的)

组织会议

- Are you ready for the meeting?
- ⭐ Kind of, I’m pretty nervous. My last proposal got shot down. (差不多了,我很紧张。我的上一份提议被否决了
- I’ll be backing you, so don’t worry, you got this.(有我支持你,别担心,你可以的)
- You really think so?
- ⭐ Yeah, get psyched man, go in there and crush it. (当然了,打起精神,走进去搞定它,psyched /saikt/ adj. 激动的、兴奋的)
- Will you be in there too?
- ⭐ No, of course not. I’m staying far away from this trainwreck. (我不趟这趟浑水,trainwreck n. 火车事故)

Matt, we have to get a move on.
Matt, 我们得快点了.

We need to get back on track.
我们得回归会议主题.

We’ve gone off on a tangent, we need to get back on track.
话题跑偏了,我们回归会议主题.

Excuse me for interrupting. But I think this point is a bit off the topic.

The meeting was scheduled for two hours, but it’s not over yet.

结束会议

- All right, ladies and gentlemen, that was the last item on the agenda.
- Wow. We covered a lot this morning. (我们谈了好多内容)
- Before I close this presentation, are there any questions or concerns?
- Do you have extra copies of the handout?
- Yes, how many do you need?
- Three.
- Here you go. Anything else? If not, then I thank you for coming. Send me an e-mail if you have follow-up questions. (如果你后续有问题…)

Alright, thanks everyone for your time, let’s get back to doing actual work.

  • Copyrights © 2019-2024 John Doe
  • Visitors: | Views:

请我喝杯咖啡吧~