Skip to content

Instantly share code, notes, and snippets.

View pbtrung's full-sized avatar

Trung Pham pbtrung

View GitHub Profile
@pranaypratyush
pranaypratyush / convert1.sh
Created November 3, 2021 10:41 — forked from zengxinhui/convert2arch_arm.sh
Replace Oracle Cloud Linux with Arch Linux ARM remotely
Refs:
1. http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz
2. https://dl-cdn.alpinelinux.org/alpine/v3.13/releases/aarch64/alpine-virt-3.13.5-aarch64.iso
3. https://wiki.alpinelinux.org/wiki/Replacing_non-Alpine_Linux_with_Alpine_remotely
4. https://wiki.archlinux.org/index.php/installation_guide#Configure_the_system
5. https://archlinuxarm.org/platforms/armv8/generic
Requirement:
Console access.
@magicstone1412
magicstone1412 / wireguard
Last active December 12, 2021 23:17
Start all wireguard tunnels with wg-quick
#!/sbin/openrc-run
# Nico Schottelius, 2020-07-02
# Start all wireguard tunnels with wg-quick
# Copying: GPLv2 or later
do_wireguard() {
action=$1
[ -d /etc/wireguard ] || exit 0
@ergoz
ergoz / motd_generator.sh
Last active February 8, 2024 10:18
Dynamic motd generator for Alpine Linux (/etc/periodic/15min/motd)
#!/bin/sh
UPTIME_DAYS=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 / 86400)
UPTIME_HOURS=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 % 86400 / 3600)
UPTIME_MINUTES=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 % 86400 % 3600 / 60)
cat > /etc/motd << EOF
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
% %
% WELCOME! %
@bodokaiser
bodokaiser / Makefile
Last active March 6, 2023 03:51
Example of how to use libuv`s QUEUE.
build:
$(CC) -o queue.o queue.c