Code
从源码编译 golang
首先下载 golang 的代码,可以从 https://golang.org/dl 或者中国的 mirror https://golang.google.cn/dl 下载最新的 go<version>.src.tar.gz
. 然后开始编译就可以。
构建方法基本可以参考官方文档 就可以。
Code
Initialize Jetson Nano Environment
If we use Jetson Nano's default image to start our project, we may have some follow steps to make our work easier.
Code
Go Proxy Configurations
To speed up our dependencies updating for golang, or prepare some patterns for our special libraries, we probably consider to use a proxy to speed it up.
Code
The short-circuiting in bash
Bash script writing is a import approach to configure the linux system. Suppose we wish to add a user if not exists, the command may seems as follow:
TARGET_USER=alice if (! id -u $TARGET_USER > /dev/null 2>&1 ); then echo "creating user $TARGET_USER" # adduser $TARGET_USER fi
However, it is kind of too long. In this case short-circuiting is a alternative solution. (more…)
Code
A simple workflow to create a clean python library based on Anaconda
The open-source Anaconda Distribution is an easy way to perform Python/R data science and machine learning on Linux, Windows, and Mac OS X. We could easily prepare an isolated and constant environment on anywhere based on a configure file.
Considering the various kind of strange errors due to the different versions of python and python libraries, this management tool makes our life much more comfortable in deploying and cooperating.
Code
How to keep the Ubuntu laptop on working
We may edit the configure file "/etc/systemd/logind.conf" and change one line from
#HandleLidSwitch=suspend
Code
Gracefully shutdown a http server in golang
To gracefully shutdown a http server requires a few steps.
The http library's serving function will block over there when getting started, until we call http.Server.Close(). As for us, we can invoke the starting function in a goroutine, and call close in another one.
Code
How to manage a repository on github without ssh key & password?
A simple way is to generate a personal access token instead.
Code
Detect the exists of methods in golang
Suppose we are trying to process a few interfaces, but not sure does a specific function exists.
Code
How to install Nvidia driver & CUDA?
It is more complex than ordinary packages, but still not hard.
Code
How to detect the exists of the Nvidia graphics cards
To detect the exists of the graphics cards on the computer, we may use command lshw. (more…)