Skip to content

Instantly share code, notes, and snippets.

View thienandangthanh's full-sized avatar

Thien An Dang Thanh thienandangthanh

View GitHub Profile
@Hebilicious
Hebilicious / cloudflare-pages-bun.env
Last active April 17, 2025 05:03
Cloudflare Pages and Bun
# Bun is now officially supported and these environments variables are no longer needed. Keeping this gist for legacy purposes.
# SKIP_DEPENDENCY_INSTALL=true
# UNSTABLE_PRE_BUILD=asdf install bun latest && asdf global bun latest && bun i
@tatumroaquin
tatumroaquin / archlinux-qemu-kvm.md
Last active July 12, 2025 07:03
QEMU-KVM Installation for Arch Linux

QEMU-KVM in Arch Linux

Check Virtualization Support

lscpu | grep -i Virtualization
  • VT-x for Intel
  • AMD-Vi for AMD

Ensure that your kernel includes KVM modules

@laureen71
laureen71 / nginx.conf RTMP Server
Last active December 10, 2024 02:35
TLS encapsulation RTMP Traffic (RTMPS) with nginx stream module
load_module modules/ngx_rtmp_module.so;
...
rtmp {
server {
listen 0.0.0.0:1935;
# if you want to run all on one server, change port here, eg:
# listen 127.0.0.1:1936;
chunk_size 4000;
notify_method get;
interleave on;
@hikiko
hikiko / win_line_endings.vim
Created August 15, 2021 17:20
Git "\ No newline at end of file" solution for VIM (*finallyyyyyy*)
" When git complains about line endings with this message:
" \ No newline at end of file
" the easier fix is to use the following VIM command:
set noendofline binary
@andrebrait
andrebrait / keychron_linux.md
Last active July 4, 2025 07:24
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@fktkrt
fktkrt / Elasticsearch + Kibana behind NGINX.MD reverse proxy with TLS.md
Last active June 10, 2025 11:47
Elasticsearch + Kibana behind NGINX reverse proxy with TLS

Prerequirements:

  • Have Elasticseach + Kibana installed
  • Have server.basePath: "/kibana" option configured in your kibana.yml file

i. Install NGINX apt install nginx

ii. Modify nginx.conf

In /etc/nginx/nginx.conf you should have a similar setup:

@Elfocrash
Elfocrash / IntegrationTest.cs
Created July 10, 2019 10:40
ASP.NET Core Integration tests code from my video: https://www.youtube.com/watch?v=7roqteWLw4s
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Tweetbook.Contracts.V1;
using Tweetbook.Contracts.V1.Requests;
using Tweetbook.Contracts.V1.Responses;
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active July 2, 2025 20:56
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

I (437) example: Opening file
I (457) example: File written
I (467) example: Renaming file
I (467) example: Reading file
I (467) example: Read from file: 'Hello SU04G!'
This line will be written into the log file, not to UART
@glegrain
glegrain / uart.c
Last active December 7, 2024 10:10
STM32 printf retarget to UART
/*# 1- Identify the UART interface, GPIO pins and Alternate Function #########*/
/* For example:
* B-L475E-IOT01A:
* PB6 ------> USART1_TX
* PB7 ------> USART1_RX
*
* NUCLEO-L476RG:
* PA2 ------> USART2_TX
* PA3 ------> USART2_RX
*