Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

--[[ ngx-helper.lua
author: Allex Wang (https://iallex.com/)
## ngx helper
get_var_names() - get variable names
## tools
@allex
allex / update-v2ray-geo.sh
Last active July 14, 2023 07:00 — forked from maddie/update-v2ray-geo.sh
Script for updating V2Ray geoip.dat and geosite.dat on OpenWRT
#!/bin/sh
# GistID: 12011d02da2e8b605a6cb715debb35f8
# GistURL: https://gist.github.com/allex/12011d02da2e8b605a6cb715debb35f8
LOGGER_TAG=v2ray-geodata-updater
log () {
echo "$@"
logger -t $LOGGER_TAG -- "$@"
@allex
allex / remotessh.go
Created July 4, 2023 06:02 — forked from tobgu/remotessh.go
Remote ssh exec using Go
package main
import (
"bufio"
"fmt"
"golang.org/x/crypto/ssh"
"io"
"log"
"os"
"strconv"
#!/bin/bash
# Personal bash PS1 by @allex_wang (https://iallex.com/) {{{
# Last Modified: Mon May 08, 2023 14:22
# GistID: a7c062df0aba27c631aa92971ea83850
# GistURL: https://gist.github.com/a7c062df0aba27c631aa92971ea83850
{
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-256color | xterm-color) color_prompt=yes;;
#!/bin/sh
set -eu
# Export and bundle docker image to local (both linux/amd64(x86), linux/arm64)
# by @allex_wang <https://iallex.com> | MIT
#
# Usage:
# bundle-image.sh <SOURCE_IMAGE_URL> <TARGET_IMAGE_NAME>
#
# For remote invoke:
@allex
allex / GNU-Make.md
Created February 3, 2023 10:47 — forked from rueycheng/GNU-Make.md
GNU Make cheatsheet

NOTE -

  • Remove -h option if you are doing operation on same machine
  • Remove -u , -p option if your database don't have username and password

Binary

Import database

mongorestore -h IP:port -d DB_Name -u user_name -p password <input db directory>
#!/bin/sh
# usage: ngx-package-tool [install | list-modules | enable-modules | cleanup-debug] [OPTIONS]
# by @allex_wang
# shellcheck disable=SC2196,SC2086
#
# GistID: 355a1d7c6fa1f89844c1dd776fd63a16
# GistURL: https://gist.github.com/355a1d7c6fa1f89844c1dd776fd63a16
PROG=$(basename "$0")
@allex
allex / curl-api
Last active February 13, 2023 08:58
#!/bin/bash
# vim: set ft=sh fdm=marker ts=2 sw=2 sts=2 tw=85 et:
set -euEo pipefail
# ================================================
# Description: #{$Description}
#
# Usage:
# curl-api [-h, --json <JSON>, --parse-token <TOKEN_NAME>]
#
@allex
allex / Dockerfile
Created January 12, 2022 14:47 — forked from shov/Dockerfile
Docker PHP 7.2 fpm with GD jpg, png suppot
FROM php:7.2-fpm
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# make sure apt is up to date
RUN apt-get update --fix-missing
RUN apt-get install -y curl
RUN apt-get install -y build-essential libssl-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev