ANNOUNCEMENT
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
1) Login to Cloud Key | |
2) Cloud Key ssh: `curl https://get.acme.sh | sh` | |
3) Cloud Key ssh: `acme.sh --upgrade --auto-upgrade --accountemail "myemail@example.com"` | |
4) Cloud Key ssh: Add `cloudkey-renew-hook.sh` file to `/root/.acme.sh` | |
5) Create free CloudFlare account (if not already member) | |
6) Login to CloudFlare | |
7) On CloudFlare: Create a zone for a domain you own (can add a cheap domain with namecheap.com or any number of alternatives) | |
8) On CloudFlare: Create an A record for your Cloud Key; ie: unifi.CHANGE.ME, 192.168.1.10 | |
9) On UniFi Controller: Go to Settings; Click "Controller"; Change "Controller Hostname/IP" to the name entered in step 8. | |
10) On CloudFlare: go to Overview for your zone; click "Get your API key" |
This is a pretty simple setup: | |
Siri is used to control Homebridge using the HomeKit protocol. | |
Homebridge has a module named Homebridge-ssh that allows you to run commands over ssh. | |
There is a shell script on an OpenWrt box to enable, disable, and check the status of a MAC Address block in the FORWARD table. | |
1. Install node on your platform. I went with 8.9 for no specific reason other than I initially had issues with 10 that probably weren't related.. | |
2. Install homebridge and homebridge-ssh. You should probably also put hombridge-config-ui-x on there too... I used the unsafe-perm parameter after getting a significant number of errors: | |
sudo -i npm install -g homebridge --unsafe-perm | |
sudo -i npm install -g homebridge-ssh --unsafe-perm |
firewall { | |
all-ping enable | |
broadcast-ping disable | |
ipv6-receive-redirects disable | |
ipv6-src-route disable | |
ip-src-route disable | |
log-martians enable | |
name WAN_IN { | |
default-action drop | |
description "WAN to internal" |
# Description: Boxstarter Script | |
# Author: Jess Frazelle <jess@linux.com> | |
# Last Updated: 2017-09-11 | |
# | |
# Run this boxstarter by calling the following from an **elevated** command-prompt: | |
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST> | |
# | |
# Learn more: http://boxstarter.org/Learn/WebLauncher | |
#---- TEMPORARY --- |
# import config | |
configfile=config.env | |
ifdef cnf | |
configfile=$(cnf) | |
endif | |
include $(configfile) | |
export $(shell sed 's/=.*//' $(configfile)) | |
# import deploy config | |
deployfile=deploy.env |
#!/bin/sh | |
set -x | |
set -e | |
# | |
# Docker build calls this script to harden the image during build. | |
# | |
# NOTE: To build on CircleCI, you must take care to keep the `find` | |
# command out of the /proc filesystem to avoid errors like: | |
# | |
# find: /proc/tty/driver: Permission denied |
version: "2" | |
services: | |
data: | |
image: busybox:latest | |
volumes: | |
- ./persistent/html:/var/www/html:cached | |
- ./persistent/mail:/var/mail:cached | |
- ./persistent/sql-data:/var/lib/mysql | |
- ./persistent/backup:/var/backup | |
- ./persistent/logs/apache:/var/apache2/logs |