Tạo thư mục chứa file không phân biệt chữ hoa - chữ thường trong Linux
Đăng vào June 15, 2022
| 1 phút
• Ngôn ngữ khác: English
Cài đặt ciopfs
-
Tải source code của package tại https://github.com/martanne/ciopfs.
-
Cài dependencies.
Fedora:
$ sudo dnf install make gcc fuse-devel glib2-devel libattr-devel
Debian:
$ sudo apt install make gcc libfuse-dev libglib2.0-dev libattr1-dev
-
Build và cài đặt.
[Đọc tiếp]
Cài đặt AMDGPU HiP, OpenCL trên Fedora 36
Đăng vào June 14, 2022
| 1 phút
• Ngôn ngữ khác: English

-
Bạn có thể tải amdgpu installer tại https://www.amd.com/en/support. Lưu ý lựa chọn đúng mẫu card của bạn.
-
Tải Radeon™ Software for Linux® installer version … for RHEL/CentOS 9.0.
Chúng ta sẽ nhận được 1 file rpm: amdgpu-install-....el9.noarch.rpm
.
[Đọc tiếp]
Cấu hình Raspberry Pi 4 thành Wireless Access Point
Đăng vào May 8, 2022
| 2 phút
• Ngôn ngữ khác: English
+- RPi -------+
+---+ 192.168.1.2 | +- Laptop ----+
| | WLAN AP +-))) (((-+ WLAN Client |
| | 192.168.3.1 | | 192.168.3.2 |
| +-------------+ +-------------+
+- Router ----+ |
| Firewall | | +- PC#1 ------+
(Internet)---WAN-+ DHCP server +-LAN-+---+ 192.168.1.3 |
| 192.168.1.1 | | +-------------+
+-------------+ |
| +- PC#2 ------+
+---+ 192.168.1.4 |
+-------------+
[Đọc tiếp]
Tính thời gian thực thi thực sự trong C++
Đăng vào October 13, 2021
| 1 phút
• Ngôn ngữ khác: English
#include <chrono>
int main() {
std::chrono::time_point <std::chrono::system_clock, std::chrono::duration<double, std::milli>> then = std::chrono::high_resolution_clock::now();;
// ... do something ...
std::chrono::time_point <std::chrono::system_clock, std::chrono::duration<double, std::milli>> now = std::chrono::high_resolution_clock::now();;
double elapseTimeInMS = (now - then).count();
return 0;
}
Cách viết khác ngắn hơn:
#include <chrono>
using namespace std;
int main() {
auto then = chrono::high_resolution_clock::now();
// ... do something ...
auto now = chrono::high_resolution_clock::now();
double elapseTimeInMS = chrono::duration<double, milli>(now - then).count();
return 0;
}
Bắt đầu với GStreamer - Dòng lệnh
Đăng vào October 10, 2021
| 5 phút
• Ngôn ngữ khác: English
Bài vết này là về GStreamer riêng trên Linux.
[Đọc tiếp]
[Linux] Đánh số trang cho file PDF từ terminal
Đăng vào September 29, 2021
| 1 phút
• Ngôn ngữ khác: English
Chú ý: Link trong file PDF (hyperlink, internal-link) sẽ bị mất nếu làm theo cách này
Tạo một file numbered.tex với nội dung như sau:
[Đọc tiếp]
Hiển thị tab Firefox trên nhiều dòng
Đăng vào August 9, 2021
| 1 phút
• Ngôn ngữ khác: English

- Truy cập about:config, bật tùy chọn
toolkit.legacyUserProfileCustomizations.stylesheets
.
- Truy cập about:support >
Profile Directory
> Open Directory
.
Cửa sổ thư mục profile sẽ bật ra.
- Trong thư mục profile, tạo thư mục
chrome
nếu chưa tồn tại.
- Trong thư mục
chrome
, tạo file userChrome.css
.
- Copy nội dung từ file multi-row_tabs.css
vào file
userChrome.css
.
- Khởi động lại Firefox.
Bật Application Launcher trên Latte Dock bằng phím tắt Window
Đăng vào May 29, 2020
| 1 phút
• Ngôn ngữ khác: English
- Bấm chuột phải vào dock > Layouts > Configure…
- Trong cửa sổ Settings, chuyển tới tab Preferences
- Trong mục Actions > Chọn Press ⌘ to activate Application Launcher

Hoặc
Tạo GPG key với text file
Đăng vào January 31, 2020
| 1 phút
• Ngôn ngữ khác: English
Tạo 1 file text tên là gpg_gen_key với đầy đủ thông tin cho việc tạo key:
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: My Name
Name-Email: [email protected]
Expire-Date: 0
Passphrase: secretpass
Tiến hành tạo key từ file text trên:
gpg --batch --gen-key gpg_gen_key
NGINX Basic Authentication
Đăng vào January 30, 2020
| 1 phút
• Ngôn ngữ khác: English
Gói yêu cầu
Tạo file lưu trữ user:password
Tạo file /etc/nginx/.htpasswd
là file chứa thông tin về người dùng và mật khẩu.
sudo htpasswd -c /etc/nginx/.htpasswd user1
Tùy chọn -c
chỉ nên dùng nếu file chưa tồn tại nếu không nó sẽ ghi đè file đã có.
Để thêm người dùng khác, ta chạy lệnh giống như trên nhưng bỏ tùy chọn -c
.
sudo htpasswd /etc/nginx/.htpasswd user2
[Đọc tiếp]