Skip to content

Instantly share code, notes, and snippets.

View hongkongkiwi's full-sized avatar
🤓

Andy hongkongkiwi

🤓
View GitHub Profile
@stokito
stokito / pkg_size.sh
Last active June 24, 2021 03:14
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 March 12, 2024 11:45
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 May 25, 2024 08:06
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 && sh get-docker.sh && 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 git@github.com: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
@mihow
mihow / load_dotenv.sh
Last active June 2, 2024 15:18
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@stefanbuck
stefanbuck / upload-github-release-asset.sh
Last active November 26, 2023 12:40
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
@rtfpessoa
rtfpessoa / openvpn-client-key-gen.sh
Last active April 16, 2022 19:25
OpenVPN Client Key Generator
#!/bin/bash
#
# OpenVPN Client Key Generation Script
#
# Author: rtfpessoa
# Date: 03-09-2016
#
# Based on the guide:
# * https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04