Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
#
# The `sync-remote-file` is designed to synchronize local and remote files. The
# user can specify the direction of the sync (i.e., whether files are
# transferred from local to remote or remote to local), or can decide at runtime
# when prompted if differences are found.
#
# It accepts an optional argument -d to specify the direction of the sync:
#
# R: sync local file to remote.
#!/usr/bin/env bash
set -eu
# Helper cli command for upload artifacts to depot server
# by @allex_wang
#
# GistID: 88b3f45dde15b7aa88916c81fca3cf0c
# GistURL: https://gist.github.com/88b3f45dde15b7aa88916c81fca3cf0c
PROG=$(basename "$0")
#!/bin/bash
# vim: set ft=sh fdm=marker ts=2 sw=2 sts=2 tw=85 et:
# extract and convert scss to css3 variables, output type support json,text,css
# by @allex_wang
#
# Install:
# curl -sfkL -o ./convert-scss-var.sh https://gist.githubusercontent.com/allex/ab874c487178eade932d220cb079470a/raw/convert-scss-var.sh && chmod +x ./convert-scss-var.sh
#
# GistID: ab874c487178eade932d220cb079470a
--[[ 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>