Skip to content

Instantly share code, notes, and snippets.

View hongkongkiwi's full-sized avatar
🤓

Andy hongkongkiwi

🤓
View GitHub Profile
@reillysiemens
reillysiemens / signing-vbox-kernel-modules.md
Last active April 22, 2025 22:18
Signing VirtualBox Kernel Modules

Signing VirtualBox Kernel Modules

These are the steps I followed enable VirtualBox on my laptop without disabling UEFI Secure Boot. They're nearly identical to the process described on [Øyvind Stegard's blog][blog], save for a few key details. The images here are borrowed from the [Systemtap UEFI Secure Boot Wiki][systemtap].

  1. Install the VirtualBox package (this might be different for your platform).
    src='https://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo'
@mistadikay
mistadikay / npm-install.sh
Created October 17, 2018 12:35
Speedup node modules installation if cache exists on s3
#!/usr/bin/env bash
NPM_TARBALL=node_modules.tgz
NPM_MD5SUM_FILE=package-lock.md5sum
NPM_CACHE_DIR=${HOME}/.cache/YOUR_PROJECT/npmtarball
S3_DIR=s3://YOUR_BUCKET/YOUR_PROJECT
function shouldInstallFromCache() {
printf "\nChecking the cache\n"
[[ ! -e $NPM_CACHE_DIR ]] && mkdir -p $NPM_CACHE_DIR
@ergoz
ergoz / motd_generator.sh
Last active May 23, 2025 09:53
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! %
@stokito
stokito / pkg_size.sh
Last active June 24, 2025 00:47
openwrt opkg size of all packages
grep -H Installed-Size: /usr/lib/opkg/info/*.control | sed 's,^.*/\([^/]\+\)\.control:Installed-Size: *\(.*\),\2\t\1,' | sort -n
@miguelmota
miguelmota / ethereum_keys.sh
Last active April 15, 2025 11:46
Generate Ethereum Private key, Public key, and Address using Bash and OpenSSL
# Generate the private and public keys
openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > key
# Extract the public key and remove the EC prefix 0x04
cat key | grep pub -A 5 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^04//' > pub
# Extract the private key and remove the leading zero byte
cat key | grep priv -A 3 | tail -n +2 | tr -d '\n[:space:]:' | sed 's/^00//' > priv
# Generate the hash and take the address part
@zulhfreelancer
zulhfreelancer / install-docker.md
Last active July 10, 2025 08:01
Install Docker oneliner script

Just install Docker

$ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

Install Docker and Rancher Server

$ curl -fsSL get.docker.com -o get-docker.sh &amp;&amp; sh get-docker.sh &amp;&amp; sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server

#!/bin/bash
# get the kernel and initrd
ROS_VERSION="v0.9.2-rc4"
URL_BASE="https://github.com/rancher/os/releases/download/${ROS_VERSION}"
VMLINUX="vmlinuz-4.9.21-rancher"
INITRD="initrd-v0.9.2-rc4"
cd /tmp
echo "downloading ${URL_BASE}/${VMLINUX}" > /dev/kmsg
@anildigital
anildigital / install_janus.sh
Created April 7, 2017 10:00
Install Janus WebRTC Gateway on macOS
brew install jansson libnice openssl libusrsctp libmicrohttpd libwebsockets cmake rabbitmq-c sofia-sip opus libogg glib pkg-config gengetopt
wget https://github.com/cisco/libsrtp/archive/v1.5.4.tar.gz
tar xvf v1.5.4.tar.gz
cd libsrtp-1.5.4
./configure --prefix=/usr/local/libsrtp
make
sudo make install
git clone [email protected]:meetecho/janus-gateway.git
@knu
knu / detect-updates-in-bigquery-sql-reference.json
Created March 31, 2017 12:11
Huginn scenario for detecting updates in BigQuery SQL Reference
{
"schema_version": 1,
"name": "Detect updates in BigQuery SQL Reference",
"description": "No description provided",
"source_url": false,
"guid": "3d9024f5898a7183e278289832f0720a",
"tag_fg_color": "#ffffff",
"tag_bg_color": "#5bc0de",
"icon": "globe",
"exported_at": "2017-03-31T12:09:09Z",
@bekce
bekce / README.md
Created February 21, 2017 13:36
ldap server with mysql backend

I wanted to build an LDAP server that queries a MySQL server to fetch users and check their passwords. It is mainly used for old software that does not work with custom OAuth2 providers. Redmine is an example of this.

Instructions:

  1. Create the database and table with insert.sql