Skip to content

Instantly share code, notes, and snippets.

View willnode's full-sized avatar

Wildan M willnode

View GitHub Profile
@willnode
willnode / loadenv.sh
Created April 9, 2025 11:44
Load .env file as environment variables and execute a command
#!/bin/sh
ENV_FILES="" # list of env files (empty by default)
VERBOSE=0
show_help() {
cat <<EOF
Usage: $(basename "$0") [--env-file=FILE ...] [--verbose] [--help] [VAR=val ...] COMMAND [ARGS...]
Options:
@willnode
willnode / readcsvinzip.go
Created December 29, 2024 09:32
Streaming CSV inside a ZIP File with Go Channel
package main
import (
"archive/zip"
"bytes"
"context"
"errors"
"fmt"
"io"
"path/filepath"
@willnode
willnode / deceptive.html
Created August 7, 2024 17:33
DOM Cloud
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>You're entering DOM Cloud User Generated Content</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@567&display=swap" rel="stylesheet">
<style>
<?php
namespace App\Libraries;
use App\Entities\User;
use App\Entities\Purchase;
use Config\Services;
use WpOrg\Requests\Requests;
/**
@willnode
willnode / install-medusa-no-tty.sh
Last active March 11, 2024 04:53
install medusa.js without interactive prompts
#!/usr/bin/expect -f
# Check if the correct number of arguments is provided
if { $argc != 2 } {
puts "Usage: $argv0 <npx_command_arguments> <admin_email>"
exit 1
}
# Set timeout for expect
set timeout -1
@willnode
willnode / install.md
Last active May 26, 2025 06:02
Build Redox for Aarch64 OS Guide

[WIP] Building Aarch64 Redox OS from Mac M1

Here's how you build Redox from Mac in May 2025. It's so much easier to do it now than in ancient days.

The only problem you may encounter is packaging the build, since it requires FUSE and it's requires patching Mac kernel, which I don't want. I (trying) develop a way to avoid it by using Podman only for that.

I run with UTM on QEMU virtualization. It works for me.

This notes is WIP, see https://gist.github.com/willnode/a31a1265d955dbb914001aba8a576ad2 for Redox OS native bootstrapping

@willnode
willnode / restart.sh
Created January 4, 2024 10:44
DOM Cloud's restart script
#!/bin/bash
while [ `passenger-config list-instances --json | jq length` -ne 1 ]; do
echo "Waiting until NGINX done reloading..."
sleep 1
done
sudo -n -- passenger-config reopen-logs &> /dev/null || true
passenger-config restart-app ~ --ignore-app-not-running
@willnode
willnode / index.html
Created November 16, 2023 22:07
DOM Cloud's default index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Welcome!</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
text-align: center;
font-family: "Segoe UI", Roboto, sans-serif;

Install XCode via terminal

sudo xcodebuild -runFirstLaunch
@willnode
willnode / forward-domain-nginx.conf
Created May 26, 2023 14:39
Example of NGINX implementation for forwarddomain.net
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}