Skip to content

Instantly share code, notes, and snippets.

View drscream's full-sized avatar
🕶️
Focusing

Thomas Merkel drscream

🕶️
Focusing
View GitHub Profile
#!/usr/bin/env bash
# Set basedir and default config file
SSH_HOSTS='/var/ssh'
# Update mdata information from SSH host keys
for key in dsa_key dsa_key.pub rsa_key rsa_key.pub ecdsa_key ecdsa_key.pub ed25519_key ed25519_key.pub; do
cat ${SSH_HOSTS}/ssh_host_${key} |\
mdata-put ssh_host_${key}
done
openvpn_enable="YES"
openvpn_configfile="/usr/local/etc/openvpn/openvpn.conf"
openvpn_if="tap"
{
"variables": {
"ssh_username": "root",
"ssh_password": "vagrant",
"variant": "minimal",
"box_ver": "7.1.20171229",
"vagrant_username": "vagrant",
"vagrant_password": "vagrant",
"vagrant_group": "vagrant",
"num_cpus": "2",
# /etc/inet/ndpd.conf
# Send router advertisements not on all interfaces
ifdefault AdvSendAdvertisements 0
ifdefault StatelessAddrConf 0
ifdefault StatefulAddrConf 0
prefixdefault AdvOnLinkFlag on AdvAutonomousFlag on
# local prefix using the default lifetimes
if net1 AdvSendAdvertisements 1
prefix 2a01:138:a015:14::/64 net1
awk -v pat='zonename|create_timestamp|billing_id|owner_uuid|mac|uuid|zone_state|zonepath|zoneid|last_modified|server_uuid|datacenter_name|state|boot_timestamp|pid|zfs_root_recsize|zfs_filesystem|zpool|zfs_data_recsize' '$0~pat {n=2}; n {n--; next}; 1' x.json
.required label:after {
color: #e32;
content: ' *';
display:inline;
}
{
"brand": "joyent",
"resolvers": ["8.8.8.8", "8.8.4.4"],
"ram": 2048,
"nics": [{
"nic_tag": "switch0",
"ips": [ "192.168.200.200/24" ],
"gateways": [ "192.168.200.1" ],
"primary": true
}]
static const char colors[NUMCOLORS][ColLast][13] = {
{ "#286e75", "#286e75", "#002b36" }, /* [0] 01 - Client normal */
...
}
static const char *colors[][17] = {
[0] = { "#928374", "#282828", "#282828" },
...
}
  1. If needed generate self-signed ssl certificate for nginx (if your config need ssl now):
# Folder need to exists and *.crt and *.key file is used in nginx.conf
$ mkdir -p /opt/local/etc/nginx/ssl
$ /opt/core/bin/ssl-selfsigned.sh -d /opt/local/etc/nginx/ssl -f nginx
  1. Add web information for let's encrypt to nginx into server { ... } content:
476 # If ctypes is available, use it to find system routines for UUID generation.
477 # XXX This makes the module non-thread-safe!
478 _uuid_generate_time = _UuidCreate = None
479 try:
480 import ctypes, ctypes.util
481 import sys
482
483 # The uuid_generate_* routines are provided by libuuid on at least
484 # Linux and FreeBSD, and provided by libc on Mac OS X.
485 _libnames = ['uuid']