Skip to content

Instantly share code, notes, and snippets.

View avin's full-sized avatar
🚀

Avin Lambrero avin

🚀
View GitHub Profile
@avin
avin / caprover.yaml
Last active May 30, 2024 10:27
Docker hub mirror caprover app
captainVersion: 4
services:
$$cap_appname:
image: registry:2
ports:
- "5000:5000"
environment:
REGISTRY_PROXY_REMOTEURL: https://registry-1.docker.io
caproverOneClickApp:
variables:
@avin
avin / instruction.md
Created May 7, 2024 17:56
Raspberry Pi OpenWRT WireGuard router (+keep vanilla internet on the device)
echo "201 vpn" >> /etc/iproute2/rt_tables

Edit /etc/config/network

config interface 'loopback'
        option device 'lo'
@avin
avin / setup.md
Last active May 6, 2024 17:34
Wireguard via Docker

Prepare

sudo mkdir -p /opt/wireguard/config
sudo nano /opt/wireguard/docker-compose.yml

docker-compose.yml content:

---
services:
@avin
avin / setup.md
Created March 30, 2024 10:03
Setup OpenWRT router with wireguard client

Preconfigure two interfaces wan and lan (if not already configured)

vi /etc/config/network

config interface 'wan'
        option device 'eth0'
        option proto 'dhcp'

config interface 'lan'
@avin
avin / App.tsx
Last active September 14, 2023 19:35
Slim form control
import React, {memo, useCallback, useEffect, useRef} from 'react';
import {useControl, useForm, useValidation} from './utils/useFormState';
// function useTraceUpdate(props: any) {
// const prev = useRef(props);
// useEffect(() => {
// const changedProps = Object.entries(props).reduce((ps: any, [k, v]) => {
// if (prev.current[k] !== v) {
// ps[k] = [prev.current[k], v];
// }
@avin
avin / template.ftl
Created May 19, 2023 07:50
Freemarker dump all data
<#-- JSON stringify -->
<#function stringify obj>
<#if !obj??>
<#return 'undefined'>
</#if>
<#if obj?is_date>
<#return '"' + obj?string("yyyy-MM-dd HH:mm:ss") + '"'>
</#if>
<#if obj?is_boolean || obj?is_number>
<#return obj?string>
@avin
avin / obs-auto-record.cmd
Created April 6, 2023 13:04
Periodical record in OBS
:: This script automates video recording using OBS
:: Disable command echoing and clear the screen
echo off
cls
:: Set the log file path
set logfile="C:\utils\autorecord\logs\automate.log"
echo log file will be %logfile%
// ==UserScript==
// @name SuperAjax for AppLinks
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Allow to do cross-domain AJAX requests
// @author You
// @run-at document-start
// @connect *
// @match https://localhost:5173/*
// @match https://web.rbsdev.com/front-utils/app-links/*
@avin
avin / needful-languages.js
Last active March 4, 2023 12:14
[TAMPERMONKEY] Only needful languages for AIPRM for ChatGPT
// ==UserScript==
// @name Only needful languages for AIPRM for ChatGPT
// @namespace http://tampermonkey.net/
// @version 0.1
// @author You
// @description try to take over the world!
// @match https://chat.openai.com/chat
// @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com
// @grant none
// ==/UserScript==
@avin
avin / react-to-vue.md
Last active April 23, 2024 03:41
Migrate from React to Vue | Migrate from Vue to React