Simple things to do using jq
# turn a delimted string into an array:
echo '"2368;3924"' | jq 'split(";")
[
"2368",
"3924"
]| -- The array_position function was added in Postgres 9.5. | |
| -- For older versions, you can get the same behavior with this function. | |
| create function array_position(arr ANYARRAY, elem ANYELEMENT, pos INTEGER default 1) returns INTEGER | |
| language sql | |
| as $BODY$ | |
| select row_number::INTEGER | |
| from ( | |
| select unnest, row_number() over () | |
| from ( select unnest(arr) ) t0 | |
| ) t1 |
Simple things to do using jq
# turn a delimted string into an array:
echo '"2368;3924"' | jq 'split(";")
[
"2368",
"3924"
]| Allow recent versions of Perl to compile automake. | |
| For Yocto. Tested on poky (krogoth branch). | |
| From https://gist.github.com/xywei/03b546054f0d2e2f76c5ac530c88268a | |
| --- a/bin/automake.in 2015-01-06 03:25:55.000000000 +0800 | |
| +++ b/bin/automake.in 2017-07-26 13:58:07.086205701 +0800 | |
| @@ -3878,7 +3878,7 @@ | |
| sub substitute_ac_subst_variables | |
| { | |
| my ($text) = @_; |
| #!/bin/sh | |
| # https://community.ui.com/questions/Unifi-Controller-5-11-50-on-Mac-OS-X-Catalina-fails-to-start-/2fde6f63-b0ac-43a0-83f7-5cf43ba3d40f?page=2 | |
| brew cask install homebrew/cask-versions/adoptopenjdk8 | |
| brew cask install ubiquiti-unifi-controller | |
| export CLASSPATH=/Applications/UniFi.app/Contents/Java/* | |
| cd /Applications/UniFi.app/Contents/Resources | |
| java com.ubnt.ace.Launcher start & |
| #!/usr/bin/env sh | |
| system_profiler SPUSBDataType 2>/dev/null \ | |
| | sed -n '/iPhone/,/Serial/p' \ | |
| | grep "Serial Number:" \ | |
| | awk -F ": " '{print substr($2,1,8)"-"substr($2,9,24)}' |
Read the last paragraph if you want a simpler solution.
The current (May 2020) controller interface doesn't give you a clear ability to reserve
IP addresses for wireless access points. Instead it gives you the option of statically
entering all of the information. You can use the customization features of
config.gateway.json to do what the GUI does not let you do.
To figure out your network name, you'll probably want to ssh into your USG and then get
your shared-network-name by running the following command: mca-ctrl -t dump-cfg.
Once you have a network name and its associated subnet, you can enter in the static
I wanted a way to disable DNS over HTTPS so I can control DNS activity on my local network. I also block unauthorized outbound DNS requests with firewall rules.
The biggest limitation of this approach is the need to put all forwarding options in the config.
Leaving out options, especially the 'server=' can break DNS on your whole network, so be careful.
SSH into your USG and run mca-ctrl -t dump-cfg to find your current options and use them to
replace the values in the file here.
I recommend running cat /etc/dnsmasq.conf before and after applying this config to see if you
are missing things you need.
| #!/usr/bin/env sh | |
| pkill -USR1 udhcpc |
| @lombok.extern.log4j.Log4j2 | |
| public class AccessLogValve extends | |
| org.apache.catalina.valves.AbstractAccessLogValve { | |
| @Override | |
| protected void log(java.io.CharArrayWriter message) { | |
| log.info(message.toString()); | |
| } | |
| } |