Helix: How to jump to the build error from the terminal output?
2023-07-21
In my previous post, I shared how I run code in Helix, and today I’ve taken things a step further by integrating WezTerm into Helix. Now, after running the code, if I encountered errors or warnings, I can simply click on the corresponding file to open it in Helix at the specific line and column number.
Previously, I had to either look at the line number and navigate to that specific line or manually copy the file path and open it in Helix, which was somewhat cumbersome.
How I run code in Helix editor?
2023-07-14
In my previous post, I mentioned that I’ve made the switch to WezTerm and Helix, and today I want to share how I run my code in this setup.
Previously, I would split Wezterm into two panes and run the code in a new pane.
However, I found it cumbersome to type different commands for each programming language (Go, C, Racket, and so on).
While auto-completion helped to some extent, or using control-p
to run the previous command, it still took up a little time.
SICP Exercise 2.77: expected a procedure that can be applied to arguments, given #f
2023-07-13
2.5.1 Generic Arithmetic Operations
Louis Reasoner tries to evaluate the expression (magnitude z) where z is the object shown in figure 2.24. To his surprise, instead of the answer 5 he gets an error message from
apply-generic
, saying there is no method for the operationmagnitude
on the types(complex)
.
To simplify the install-complex-package
procedure, I made the following changes:
1(define (install-complex-package) 2 (define (make-from-real-imag x y) 3 ((get 'make-from-real-imag 'rectangular) x y)) 4 (define (tag z) (attach-tag 'complex z)) 5 (put 'make-from-real-imag 'complex 6 (lambda (x y) (tag (make-from-real-imag x y)))) 7 8(install-complex-package) 9 10(trace-define (make-complex-from-real-imag x y) 11 ((get 'make-from-real-imag 'complex) x y)) 12 13(magnitude (make-complex-from-real-imag 3 4))
Docker rootless keeps restarting?
2023-07-12
As some of you may know, this blog is hosted on Raspberry Pi. To monitor its status, I wrote a script, which you can find here.
Recently, I decided to switch the Docker daemon to run in rootless mode. However, after making this change, I started receiving notifications indicating that the blog was frequently going offline.
Whenever this happens, I ssh into my Pi and run the command docker ps
to list the running containers.
How I setup a new Macbook in 2023
2023-05-06
I purchased my first MacBook Pro in 2013 prior to transitioning to remote work. In my job, we were using saltstack to build an automation tool. In order to delve deeper into Salt, I decided to configure my Macbook using it, and I documented the process here.
I also utilized this method to set up another Macbook for my older sister.
In 2018, due to work requirements, 8GB of memory proved insufficient to run Windows on VirtualBox, prompting me to acquire a second hand MacBook with 16GB of RAM.
A terminal UI for Taskwarrior
2023-04-21
When I first started using Linux, I came across Taskwarrior, a command line tool for managing to-do lists. However, I never got around to using it extensively, mainly because there was no Android app available at the time, making it difficult to sync tasks from my phone.
I did experiment with taskwarrior-pomodoro but unfortunately, it wasn’t as effective as I had hoped.
Recently, though, I stumbled upon foreground, a new discovery that reignited my interest in Taskwarrior,
Load averages approximately 1000 on macOS?
2023-04-20
Em “vợ” ra đời năm 2015, cưới về năm 2018, loa đã rè, pin đã chai.
Một ngày đẹp trời bật máy lên và không làm được gì. Load gần… 1000 (trong ảnh là sau khi đã restart, và hơn 30p sau mới gõ được w
):
Mình thử khởi động lại thì mất khoảng 5-10p mới đến chỗ gõ password. Search thấy có bạn thay cable ổ cứng thì hết nhưng đời 2015 thì ổ cứng không có cable.
A simple terminal UI for ChatGPT
2023-04-01
When I started learning Linux, I immediately fell in love with the terminal. I still remember the feeling of typing commands into the terminal, pressing Enter and seeing if I got the expected result. As a system administrator and DevOps engineer, I always wanted to do everything on the terminal.
The reasons are simple: it allowed me know what was happening behind the scenes, and it was faster than switching to other tools, and then back to the terminal to continue working.
Man on fire - trained or untrained?
2023-03-20
Hôm trước vừa biên một bài về Nhiều giờ bay và có phản hổi, thì hôm nay ChatGPT lại đưa tôi đến đây:
1You: 2 Top 10 kidnapping movies (with release year) 3 4ChatGPT: 5 Here are the top 10 Kidnapping movies with their release year: 6 7 1. "Taken" (2008) 8 2. "Ransom" (1996) 9 3. "Man on Fire" (2004) 10 4. "Prisoners" (2013) 11 5. "Gone Girl" (2014) 12 6. "Misery" (1990) 13 7. "The Vanishing" (1988) 14 8. "Room" (2015) 15 9. "The Call" (2013) 16 10. "The Lovely Bones" (2009)
Nhiều giờ bay và có phản hồi
2023-03-14
Tặng D.
Nam Định, 1992.
Mặc dù còn nhiều khó khăn nhưng chú vẫn được bố mẹ cho đi học bóng bàn. Bọn trẻ hồi đó dùng… bảng đen để chơi bóng ở nhà. Chú được chú H hàng xóm cho một cái vợt mà quý như vàng.
Nhà hát nhân dân (nằm cạnh Chùa Vọng Cung) có khoảng chục bàn. Thầy dạy từ những động tác cơ bản nhất: đôi công. Góc này có H (5 tuổi) cao ngang mặt bàn.