Random commands I've used for various things.
mca-ctrl -t dump-cfg
renew dhcp interface eth0
show interfaces
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
#!/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)}' |
#!/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 & |
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) = @_; |
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 |
#!/bin/bash | |
# | |
# Amazon Linux cloud-init script | |
# | |
# Amit Bakshi | |
# 10/2014 | |
# | |
if [ `id -u` -ne 0 ]; then | |
sudo exec /bin/bash -x "$0" "$@" | |
fi |
# First install database | |
brew install postgres | |
# Clone and build the PL/pgSQL server-side debugger | |
srcdir=/usr/local/src | |
[ -e "$scrdir" ] || \ | |
sudo sh -c "mkdir $srcdir && chgrp admin $srcdir && chmod g+w $srcdir" | |
cd "$srcdir" |
#!/usr/bin/bash | |
export INSTANCE_ID=$(curl http://169.254.169.254/latest/meta-data/instance-id) | |
export INSTANCE_NAME=$( ec2-describe-instances ${INSTANCE_ID} |grep -E "^TAG.+" |cut -f 4,5 |grep -E "^Name" |cut -f 2 ) |