Skip to content

Instantly share code, notes, and snippets.

@apla
apla / guest.md
Last active November 8, 2019 04:23
luci segregated lans
  1. Select menu item Network > Switch and click Add button under VLAN ID section
  2. For the new VLAN, make sure the CPU is tagged, then select untagged for the LAN port(s) you are want to use this new VLAN. Make sure that port is off for all other VLANs. Click Save & Apply
  3. In the Network > Interfaces click Add new interface button (under the interface overview section)
  4. Name the new interface (Guest), select the new VLAN (likely something like eth0.3); the rest of the defaults are okay. Click Submit.
  5. Set your desired IPv4 address (for the router on this VLAN), net mask, and gateway, and any other stuff here you want. Click Save.
  6. Click Setup DHCP Server button. Defaults here are fine, but you can change them if you want. Click Save.
  7. Select the Firewall Settings tab for the interface. The radio button will default to the unspecified -or- create box. Name your firewall zone (guest). Click Save & Apply.
  8. Network > Firewall > Zones section,
@apla
apla / avr-uart-calc.markdown
Created October 24, 2019 07:12
avr-uart-calc
@apla
apla / gpio
Last active June 15, 2019 23:45
OrangePI protobor display monitor code
#!/bin/bash
cmd=$1
pin=$2
mode=$3
value=$3
pin_num=
@apla
apla / macOS.txt
Created May 2, 2019 07:42
node_exporter output
## curl http://127.0.0.1:9100/metrics
# HELP go_gc_duration_seconds A summary of the GC invocation durations.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 0
go_gc_duration_seconds{quantile="0.25"} 0
go_gc_duration_seconds{quantile="0.5"} 0
go_gc_duration_seconds{quantile="0.75"} 0
go_gc_duration_seconds{quantile="1"} 0
go_gc_duration_seconds_sum 0
go_gc_duration_seconds_count 0
@apla
apla / ls
Created July 22, 2018 07:55
how apple handles incorrect permissions
ls -la /usr/local/
total 8200
drwxr-xr-x 15 root wheel 480 Jan 23 16:47 .
drwxr-xr-x@ 11 root wheel 352 Jul 11 00:54 ..
-rw-r--r-- 1 user wheel 0 Jul 22 03:20 .com.apple.installer.keep
drwx------ 72 user staff 2304 Jul 22 03:55 Cellar
drwxr-xr-x 4 user admin 128 Mar 7 23:25 Frameworks
drwxrwxr-x 17 user admin 544 Jul 19 09:15 Homebrew
drwxrwxr-x 466 user admin 14912 Jul 22 03:55 bin
-rw-r--r-- 1 root wheel 3970951 Apr 15 08:49 createnetwork.log
@apla
apla / clone.sh
Last active June 17, 2019 20:21
Linux clone disk
#!/bin/bash
# parted --list
sudo lsblk -o name,mountpoint,parttype,partlabel,label,size,uuid
DISKS=( $(lsblk --nodeps -n -o name) )
read -e -p "Source disk: " -i "sda" FROM
read -e -p "Destination disk: " -i "sdb" TO
@apla
apla / a.bash
Created September 30, 2017 22:37
macOS Library/Mail account identifiers to username conversion
ls -1 ~/Library/Mail/V5 | xargs -I {} sqlite3 -noheader -column ~/Library/Accounts/Accounts4.sqlite "select ZIDENTIFIER || ' => ' || ZUSERNAME || '/' || ZACCOUNTDESCRIPTION || ' ACTIVE: ' || ZACTIVE from ZACCOUNT where ZIDENTIFIER = '{}'"
@apla
apla / INDEX.md
Last active February 14, 2017 09:59
cnc

Preview:

  1. Copy jscad file contents to the OpenJSCad.org

Prepare and edit:

  1. Download and install Atom editor
  2. Launch Atom, then go to the plugins, search and install atom-jscad package
  3. Save all the files from this gist to the folder on your computer
  4. Open folder with Atom editor
@apla
apla / index.css
Created December 31, 2016 00:14
test for a linked graphs
.shadergraph-graph {
font: 12px sans-serif;
line-height: 25px;
position: relative;
}
.shadergraph-graph:after {
content: ' ';
display: block;
height: 0;
font-size: 0;
@apla
apla / build-chromium-windows.bat
Last active May 9, 2023 15:00
Build CEF# from source with mp4
@echo off
REM instructions from: https://groups.google.com/d/msg/cefsharp/BJLMXl9c204/HMJlp8mZzF0J
REM seems like partial instructions copied to SO: http://stackoverflow.com/questions/8033495/chromium-embedded-framework-mp3-support
REM all chromium releases: https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding.md#markdown-header-release-branches
REM 2272 - latest chromium with npapi (41)
REM there is a commits list: https://bitbucket.org/chromiumembedded/cef/branch/2272
REM https://github.com/cefsharp/CefSharp
REM cef builds http://www.magpcss.net/cef_downloads/
REM https://cefbuilds.com