Util | ChatGPT使用体验以及重拾Hexo遇到的坑

ChatGPT注册

  • 用Microsoft Edge、Google Chrome浏览器。
  • 美区的VPN,开全局模式
  • ChatGPT: Optimizing Language Models for Dialogue (openai.com)👉TRY CHATGPT Button。
  • 如遇到ChatGPT is at capacity right now问题,多刷新几次页面就能进去。
  • 利用Google账号直接登录。
  • 利用SMS-Activate,下载桌面版软件(网页版做的太烂了),充值0.2刀(支持支付宝),买一个印度区的openai短信服务(最便宜),就可以完成注册了。
  • 如遇到We're experiencing exceptionally high demand. Please hang tight as we work on scaling our systems.Too many requests in 1 hour. Try again later.问题
    • 换梯子、换浏览器,清除cookie和其他站点数据(短时间能解决问题)
    • 花钱买api接口调用(不过马上就要上线付费版的chatgpt pro了?)
    • 尽量白天使用,晚上别用(用的人太多了,尤其是美国娃,别抢了)
    • 实在不行淘宝等平台买新号用吧。

ChatGPT使用体验

  • 最初试用ChatGPT时,仅仅让它续写故事,做内容生成。发现是在一本正经的胡说八道,于是就没有再继续使用了。

  • 后来才发现是使用的方法不对。具体可以参考f/awesome-chatgpt-prompts: This repo includes ChatGPT prompt curation to use ChatGPT better. (github.com),里面涉及了ChatGPT可以完成的许多内容。

  • 最近看微软将ChatGPT集成到Bing搜索,以及谷歌等巨头公司做出的一系列举动,发现ChatGPT开启了新的交互式搜索范式,这是让剩下的搜索引擎巨头倍感焦虑的问题。

  • 关于ChatGPT的编码能力,我觉得很适合辅助入门者进行代码的学习,但是复杂一点的问题它就没办法解决了。

  • 不管是用YouTube、Google、StackOverflow、GitHub,还是ChatGPT辅助编码,问问题的能力永远比答案更重要,所以搜索引擎是一种工具。这些工具的诞生能够将简单的、重复性的工作解决掉,所以不愿意终身学习的躺平er们要小心了,在不久的将来,可能就要被代替掉了。

Hexo插入图片遇到的坑

参考

直接卸载hexo-asset-image插件

1
npm uninstall hexo-asset-image --save

将_config.yml中

1
post_asset_folder: true

md文件中引用格式为

1
![](同名文章assetfoldername/imagename.png)

基于Icarus的一些个人博客:

  1. about - improveNPC的日志 (wxk.me)
  2. legendsmb
  3. Hexo Icarus主题配置完全手册 | 小贪心 (littlezero.top)
  4. 旺阳 (lqwang.net)

学习文档

Util | Git使用小结

从今天开始正式使用git,记录每日代码量,早日成为5w行入门码农。
Talk is cheap. Show me the code.

1 Git 提交代码

1
2
3
4
5
1. git status # 查看当前状态、文件修改状态(红字)
2. git add . or git add <xxx(文件路径+文件名)> # 添加内容到本地git缓存区
3. git commit -m "<备注>" # 推送修改到本地git库
4. git pull <远程主机名><远程分支名> # 取回远程主机某个分支的更新,与本地指定分支合并
5. git push <远程主机名><远程分支名> # 本地仓库代码推送到远程主机的某个远程分支上

2 Git 代码管理

  1. 个人代码量统计
  • 全部时间
    1
    git log --author="<username>" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -
    在这里插入图片描述
  • 指定时间段
    1
    2
    git log --since="<start date e.g.2020-01-01>" --before="<end date e.g.2020-12-31>" --author="<username>" \
    --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "新增行数: %s, 移除行数: %s, 总行数: %s\n", add, subs, loc }'
    在这里插入图片描述

Util | 关于好用的Linux shell命令

1. ls命令查看文件数目

1
2
3
4
5
6
- 查看当前目录下的文件数量(不包含子目录中的文件)
ls -l|grep "^-"| wc -l
- 查看当前目录下的文件数量(包含子目录中的文件)
ls -lR | grep "^-"| wc -l
- 查看当前目录下的文件夹目录个数(不包含子目录中的目录)
ls -l | grep "^d"| wc -l

2. df/du查看磁盘/文件所占空间大小

1
2
3
4
5
6
- 查看磁盘空间利用情况
df -hl
- 查看子文件夹所占磁盘空间大小
du -h --max-depth=1 work/testing(filename)
- 查看某个文件的大小
du -shl 1.tar.gz

3. nohup实现后台训练

1
2
3
4
5
6
7
8
- nohup后台任务:nohup + command + &,当前路径产生日志文件nohup.out 
nohup bash scripts/run_inpaint_sa.sh &
- nohup后台任务,日志重定向到filename.txt
nohup bash scripts/run_inpaint_sa.sh > filename.txt 2>&1 &
- python脚本需要加一个 -u
nohup python -u main.py >ans.log 2>&1 &

log = logging.getLogger() #日志输出中间值

4. zip/unzip命令

  • zip

    1
    2
    3
    4
    - 之前用ssh传文件常用,先压缩再传文件是个好习惯
    zip -q -r gconvcode.zip(压缩后的文件名) Gated_conv(待压缩文件)
    - 解压
    unzip filename.zip
  • tar

    1
    2
    3
    4
    5
    - 多个文件压缩打包 
    tar czvf my.tar.gz file1 file2,...(file*)(也可以给file*文件mv 某目录 再压缩)
    - 解压
    tar -xvf file.tar 解压 tar包
    tar -xzvf file.tar.gz 解压tar.gz
  • 7zip

    1
    2
    3
    4
    - 安装7zip 需要root权限
    sudo apt update && sudo apt install --assume-yes p7zip-full #Ubuntu and Debian
    7z x filename.7z
    7z --help
  • undo unzip & tar

1
2
3
4
- 撤销unzip操作
zipinfo -1 path/xx.zip | xargs rm -rf
- 撤销tar操作
tar -tf xx.tar | xargs rm -rf

5. 学会写shell脚本

1
2
3
4
- 利用 \ 进行换行,脚本易读
- 运行shell脚本
bash scripts/run_inpaint_sa.sh(script name)
更好的方法是将能改的参数全部写进配置文件中(cfg, yml),便于记录训练参数~
  • 批量移动多个子文件内的文件到同一个文件夹中(数据集整理)
    1
    2
    3
    4
    5
    6
    #!/bin/bash
    for var in $(find ./ -name *.jpg);
    do
    cp -vf $var ./image/;
    done
    - 该脚本移动了文件夹内所有以jpg结尾的图片到image目录下。

6. Tips 学会整理数据集

把所有常用数据集整理在同一个文件夹下,并挂载在一个空间大的硬盘上。
训练中间生成数据也一样,进行整理。

  • 利用软链接使用数据集
    ln -s [源文件或目录] [目标文件或目录]
    例:

  • 删除软链接
    rm -rf filename

  • 注意,在打包代码的时候如果目录下有数据集的软链接,(zip)会一同打包,整理code的时候记得把该删的东西都删了。。(不要问我怎么想到这一点的)

7.ssh传输数据(scp,服务器ip)

1
scp -P 端口号 -r 文件名 远程服务器用户名@xxx.xx.xx.xxx服务器ip:/home/fengtl/BlindInpainting/vcnet服务器端路径

Growth | Steve Jobs —— Follow your heart and intuition, everything else is secondary

  • Extraverted iNtuition Thinking Judgment

    Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma - which is living with the results of other people’s thinking. Don’t let the noise of other’s opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.

Speech

You’ve got to find what you love.

I am honored to be with you today at your commencement from one of the finest universities in the world. I never graduated from college. Truth be told, this is the closest I’ve ever gotten to a college graduation. Today I want to tell you three stories from my life. That’s it. No big deal. Just three stories.

The first story is about connecting the dots.

I dropped out of Reed College after the first 6 months, but then stayed around as a drop-in for another 18 months or so before I really quit. So why did I drop out?

It started before I was born. My biological mother was a young, unwed college graduate student, and she decided to put me up for adoption. She felt very strongly that I should be adopted by college graduates, so everything was all set for me to be adopted at birth by a lawyer and his wife. Except that when I popped out they decided at the last minute that they really wanted a girl. So my parents, who were on a waiting list, got a call in the middle of the night asking: “We have an unexpected baby boy; do you want him?” They said: “Of course.” My biological mother later found out that my mother had never graduated from college and that my father had never graduated from high school. She refused to sign the final adoption papers. She only relented a few months later when my parents promised that I would someday go to college.

And 17 years later I did go to college. But I naively chose a college that was almost as expensive as Stanford, and all of my working-class parents’ savings were being spent on my college tuition. After six months, I couldn’t see the value in it. I had no idea what I wanted to do with my life and no idea how college was going to help me figure it out. And here I was spending all of the money my parents had saved their entire life. So I decided to drop out and trust that it would all work out OK. It was pretty scary at the time, but looking back it was one of the best decisions I ever made. The minute I dropped out I could stop taking the required classes that didn’t interest me, and begin dropping in on the ones that looked interesting.

It wasn’t all romantic. I didn’t have a dorm room, so I slept on the floor in friends’ rooms, I returned coke bottles for the five-cent deposits to buy food with, and I would walk the 7 miles across town every Sunday night to get one good meal a week at the Hare Krishna temple. I loved it. And much of what I stumbled into by following my curiosity and intuition turned out to be priceless later on. Let me give you one example:

Reed College at that time offered perhaps the best calligraphy instruction in the country. Throughout the campus every poster, every label on every drawer, was beautifully hand calligraphed. Because I had dropped out and didn’t have to take the normal classes, I decided to take a calligraphy class to learn how to do this. I learned about serif and san serif typefaces, about varying the amount of space between different letter combinations, about what makes great typography great. It was beautiful, historical, artistically subtle in a way that science can’t capture, and I found it fascinating.

None of this had even a hope of any practical application in my life. But ten years later, when we were designing the first Macintosh computer, it all came back to me. And we designed it all into the Mac. It was the first computer with beautiful typography. If I had never dropped in on that single course in college, the Mac would have never had multiple typefaces or proportionally spaced fonts. And since Windows just copied the Mac, it’s likely that no personal computer would have them. If I had never dropped out, I would have never dropped in on this calligraphy class, and personal computers might not have the wonderful typography that they do. Of course it was impossible to connect the dots looking forward when I was in college. But it was very, very clear looking backwards ten years later.

Again, you can’t connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something - your gut, destiny, life, karma, whatever, because believing that the dots that will connect down the road will give you the confidence to follow your heart, even when it leads you off the well-worn path, and that will make all the difference.

My second story is about love and loss.

I was lucky – I found what I loved to do early in life. Woz and I started Apple in my parents garage when I was 20. We worked hard, and in 10 years Apple had grown from just the two of us in a garage into a $2 billion company with over 4000 employees. We had just released our finest creation - the Macintosh - a year earlier, and I had just turned 30. And then I got fired. How can you get fired from a company you started? Well, as Apple grew we hired someone who I thought was very talented to run the company with me, and for the first year or so things went well. But then our visions of the future began to diverge and eventually we had a falling out. When we did, our Board of Directors sided with him. So at 30 I was out. And very publicly out. What had been the focus of my entire adult life was gone, and it was devastating.

I really didn’t know what to do for a few months. I felt that I had let the previous generation of entrepreneurs down - that I had dropped the baton as it was being passed to me. I met with David Packard and Bob Noyce and tried to apologize for screwing up so badly. I was a very public failure, and I even thought about running away from the valley. But something slowly began to dawn on me – I still loved what I did. The turn of events at Apple had not changed that one bit. I had been rejected, but I was still in love. And so I decided to start over.

I didn’t see it then, but it turned out that getting fired from Apple was the best thing that could have ever happened to me. The heaviness of being successful was replaced by the lightness of being a beginner again, less sure about everything. It freed me to enter one of the most creative periods of my life.

During the next five years, I started a company named NeXT, another company named Pixar, and fell in love with an amazing woman who would become my wife. Pixar went on to create the worlds first computer animated feature film, Toy Story, and is now the most successful animation studio in the world. In a remarkable turn of events, Apple bought NeXT, I retuned to Apple, and the technology we developed at NeXT is at the heart of Apple’s current renaissance. And Laurene and I have a wonderful family together.

I’m pretty sure none of this would have happened if I hadn’t been fired from Apple. It was awful tasting medicine, but I guess the patient needed it. Sometimes life hits you in the head with a brick. Don’t lose faith. I’m convinced that the only thing that kept me going was that I loved what I did. You’ve got to find what you love. And that is as true for your work as it is for your lovers. Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven’t found it yet, keep looking. Don’t settle. As with all matters of the heart, you’ll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don’t settle.

My third story is about death.

When I was 17, I read a quote that went something like: “If you live each day as if it was your last, someday you’ll most certainly be right.” It made an impression on me, and since then, for the past 33 years, I have looked in the mirror every morning and asked myself: “If today were the last day of my life, would I want to do what I am about to do today?” And whenever the answer has been “No” for too many days in a row, I know I need to change something.

Remembering that I’ll be dead soon is the most important tool I’ve ever encountered to help me make the big choices in life. Because almost everything – all external expectations, all pride, all fear of embarrassment or failure - these things just fall away in the face of death, leaving only what is truly important. Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart.

About a year ago I was diagnosed with cancer. I had a scan at 7:30 in the morning, and it clearly showed a tumor on my pancreas. I didn’t even know what a pancreas was. The doctors told me this was almost certainly a type of cancer that is incurable, and that I should expect to live no longer than three to six months. My doctor advised me to go home and get my affairs in order, which is doctor’s code for prepare to die. It means to try to tell your kids everything you thought you’d have the next 10 years to tell them in just a few months. It means to make sure everything is buttoned up so that it will be as easy as possible for your family. It means to say your goodbyes.

I lived with that diagnosis all day. Later that evening I had a biopsy, where they stuck an endoscope down my throat, through my stomach and into my intestines, put a needle into my pancreas and got a few cells from the tumor. I was sedated, but my wife, who was there, told me that when they viewed the cells under a microscope the doctors started crying because it turned out to be a very rare form. of pancreatic cancer that is curable with surgery. I had the surgery and I’m fine now.

This was the closest I’ve been to facing death, and I hope it’s the closest I get for a few more decades. Having lived through it, I can now say this to you with a bit more certainty than when death was a useful but purely intellectual concept:

No one wants to die. Even people who want to go to heaven don’t want to die to get there. And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because Death is very likely the single best invention of Life. It is Life’s change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away. Sorry to be so dramatic, but it is quite true.

Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma - which is living with the results of other people’s thinking. Don’t let the noise of other’s opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.

When I was young, there was an amazing publication called The Whole Earth Catalog, which was one of the bibles of my generation. It was created by a fellow named Stewart Brand not far from here in Menlo Park, and he brought it to life with his poetic touch. This was in the late 1960’s, before personal computers and desktop publishing, so it was all made with typewriters, scissors, and polaroid cameras. It was sort of like Google in paperback form, 35 years before Google came along: it was idealistic, and overflowing with neat tools and great notions.

Stewart and his team put out several issues of The Whole Earth Catalog, and then when it had run its course, they put out a final issue. It was the mid-1970s, and I was your age. On the back cover of their final issue was a photograph of an early morning country road, the kind you might find yourself hitchhiking on if you were so adventurous. Beneath it were the words: “Stay Hungry. Stay Foolish.” It was their farewell message as they signed off. Stay Hungry. Stay Foolish. And I have always wished that for myself. And now, as you graduate to begin anew, I wish that for you.

Stay Hungry. Stay Foolish.

Thank you all very much.

You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.