Thanks to visit codestin.com
Credit goes to gist.github.com

Skip to content

Instantly share code, notes, and snippets.

OpenWRT UCI scripting cheat sheet

Notes

I use UCI together with bash. In case of other shells the variable and loop syntax might have to be adjusted accordingly.

New config entry - indexes

  1. Reference the newly added item with [-1]:

    uci add firewall rule
    uci set firewall.@rule[-1].name=test
    
@ittps-pro
ittps-pro / ts-fuck.d.ts
Created September 27, 2025 01:15 — forked from Theaninova/ts-fuck.d.ts
TSFuck - The Brainfuck interpreter written using TypeScript Types
// TSF***
type IncrementPointer = '>'
type DecrementPointer = '<'
type IncrementByte = '+'
type DecrementByte = '-'
type Output = '.'
type Input = ','
type LoopOpen = '['
type LoopClose = ']'
import type { AxiosRequestConfig } from "axios";
import axios from "axios";
import qs from "qs";
export const createHttpClient = (config?: AxiosRequestConfig) => {
return axios.create({
paramsSerializer: (params) => qs.stringify(params, { skipNulls: true }),
...config,
@ittps-pro
ittps-pro / ipsec.sh
Created April 13, 2025 22:23 — forked from Olivier-R/ipsec.sh
Manage IPSec IKEv2 server
#!/bin/bash
readonly VERSION='1.0'
readonly BLUE="\e[34m"
readonly NC="\e[0m"
readonly FQDN=$(hostname -f)
version() {
echo "$VERSION"
}
@ittps-pro
ittps-pro / index.ts
Last active April 12, 2025 00:00 — forked from theanht1/vpn.sh
Openconnect script as a cmd client to connect to Anyconnect VPN
import { spawn } from 'node:child-process'
// --usergroup=$VPN_GROUP
// --certificate=${certificate} --key-password=$CERT_PASSPHRASE
// "passwd-on-stdin"
echo ${password} | openconnect ${server} --user=${user} --passwd-on-stdin
@ittps-pro
ittps-pro / README.md
Created April 1, 2025 10:37 — forked from spy86/README.md
LAB Domain Controller with PowerShell

Setting up the NIC, Renaming the Computer, and Rebooting

# Define the Computer Name
$computerName = "dc1"

# Define the IPv4 Addressing
$IPv4Address = "10.10.100.25"
$IPv4Prefix = "24"
$IPv4GW = "10.10.100.1"
$IPv4DNS = "8.8.8.8"
@ittps-pro
ittps-pro / Add-RemoteDesktopUser.ps1
Created March 29, 2025 03:31 — forked from janikvonrotz/Add-RemoteDesktopUser.ps1
Add Remote Desktop User #PowerShell #Windows
$computername = "hostname"
Invoke-Command -ComputerName $computername -ScriptBlock {
$computer = $env:COMPUTERNAME
$domain = "domain"
$user = "username"
$group = [ADSI]"WinNT://$computer/Remote Desktop Users,group"
$group.psbase.Invoke("add",([ADSI]"WinNT://$domain/$user").Path)
}
@ittps-pro
ittps-pro / add-local-user.sh
Created March 29, 2025 03:24 — forked from luckyray/add-local-user.sh
Add local user #useradd #user
#!/bin/bash
#
# This script creates a new user on the local system.
# You will be prompt to enter the username, the person name, and a password
# The username, password and host for the account will be displayed.
# Make sure the script is being executed with superuser privileges.
if [[ "${UID}" -ne 0 ]]
then
echo 'Please run with sudo or as root.'
@ittps-pro
ittps-pro / use-axios.ts
Created February 24, 2025 21:26 — forked from ethantaylan/use-axios.ts
use-axios.ts
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import axios, { AxiosError, AxiosRequestConfig } from 'axios';
import React from 'react';
export interface AxiosHooks<T> {
response: T | null;
loading: boolean;
error: AxiosError | null;
abortController: AbortController | null;
executeFetch: () => Promise<void>;
@ittps-pro
ittps-pro / workstation.ps1
Created December 30, 2024 18:24 — forked from jasonhorner/workstation.ps1
chocolatey scripts for workstation setup
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install chocolatey -y
choco install git.install -y
choco install git-credential-manager-for-windows -y
choco install github -y
choco install gh -y
#@choco install git-fork -y