The idea came from Nir Lichtman video with the title: 'Making Simple Linux Distro from Scratch'
this gist just re-document it in the form of text
- compiled linux kernel
- compiled static-linked busybox
- installed qemu
// sorting alphabet | |
// reference: https://stackoverflow.com/a/64693036/22382954 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
int main(void) | |
{ | |
srand(time(NULL)); |
The idea came from Nir Lichtman video with the title: 'Making Simple Linux Distro from Scratch'
this gist just re-document it in the form of text
Live Boot arch linux:
qemu-system-x86_64 \
-drive format=raw,file=./archlinux-2024.04.01-x86_64.iso,index=0,media=disk \
-enable-kvm -machine pc -cpu host -m 1G -nographic
Since the above command using -nographic
, so we don't start VNC server, thus don't forget to add console=ttyS0
to kernel parameter, press on the bootloader to modify kernel parameter
not related link:
#!/bin/sh | |
threshold=10 # threshold percentage to trigger alert | |
while :; do | |
capacity=$(cat /sys/class/power_supply/BAT1/capacity) | |
# If battery is discharging with capacity below threshold | |
if [ "${capacity}" -lt ${threshold} ];then | |
# Send a notification that appears for 300000 ms (5 min) |
const { get } = require("node:https"); | |
(async () => { | |
const stickerName = ['Elaina_san', 'bagasgoyang'] | |
const token = "bot7003873933:AAFKl0LwWViMJIA34-qjbTh7nZwcNQr2hFs" | |
const domain = "https://api.telegram.org" | |
const file_baseurl = `${domain}/file/${token}` | |
const api_baseurl = `${domain}/${token}` | |
stickerName.forEach(async (name) => { |
const net = require('node:net'); | |
function keepAlive(ephPort, intervalId) { | |
const socket = new net.Socket(); | |
socket.setTimeout(1000); | |
socket.connect(port, process.env.GWROK_IP, () => socket.destroy()); | |
// stop the interval, indicate either the gwrok server no longer accept request | |
// or just bad internet connection and should retry if this is the case. | |
// for now we not perform retry, just stop the interval. | |
socket.on('timeout', () => { |
const { spawn } = require('node:child_process') | |
const readline = require('node:readline'); | |
const { stdin: input, stdout: output } = require('node:process'); | |
const rl = readline.createInterface({ input, output }); | |
const shell = spawn('sh') | |
shell.stdout.on('data', (data) => { | |
process.stdout.write(data.toString()) |
const { get } = require("node:https") | |
require('dotenv').config(); | |
function fetch(url) { | |
return new Promise((resolve, reject) => { | |
get(url, (res) => { | |
let buff = Buffer.alloc(0); | |
res.on("data", chunk => buff = Buffer.concat([buff, Buffer.from(chunk)])) | |
res.on("error", reject) | |
res.on("end", () => resolve(buff)) |
#!/usr/bin/sh | |
watch -n 0.1 "date +\"%d-%m-%Y %H:%M:%S.%9N\"" |