Skip to content

Instantly share code, notes, and snippets.

View fukawi2's full-sized avatar

Phillip Smith fukawi2

View GitHub Profile
@fukawi2
fukawi2 / gist:099f23673c0d6a3cbdb510358a76fdd3
Created June 12, 2019 08:06
seal a redhat vm for deployment/conversion to template
# Source: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.5/html/Administration_Guide/sect-Sealing_Virtual_Machines_in_Preparation_for_Deployment_as_Templates.html
touch /.unconfigured
yum clean all
rm -rf /etc/ssh/ssh_host_*
rm -rf /etc/udev/rules.d/70-*
sed -e '/HWADDR=/d' -i /etc/sysconfig/network-scripts/ifcfg-*
find /var/log -type f -delete
history -c
shutdown -h now
@fukawi2
fukawi2 / git-root-wrapper
Created August 1, 2019 01:57
Avoid committing to git as root
#!/usr/bin/env bash
#
# avoid accidentally committing to git repos as root.
# save to /usr/local/bin/git
#
set -eu
git_cmd="${1:-}"
@fukawi2
fukawi2 / google-earth-studio-ffmpeg.sh
Created September 2, 2019 01:56 — forked from daz/google-earth-studio-ffmpeg.sh
Google Earth Studio stitch image sequence with FFmpeg
#!/bin/bash
set -eu
FRAMERATE="$1"
ffmpeg -framerate $FRAMERATE -pattern_type glob -i '*.jpeg' -c:v libx264 -pix_fmt yuv420p output.mp4
@fukawi2
fukawi2 / unifi-video.service
Created October 14, 2019 07:04
unifi-video systemd service
# /etc/systemd/system/unifi-video.service
[Unit]
Description=Unifi Video NVR Daemon
[Service]
Type=forking
ExecStart=/usr/sbin/unifi-video start
ExecStop=/usr/sbin/unifi-video -D stop
@fukawi2
fukawi2 / unifi-sdn.xml
Last active December 6, 2019 05:37
firewalld service file for Unifi SDN Controller Software. Save to /etc/firewalld/services/
<?xml version="1.0" encoding="utf-8"?>
<!-- Refer to: https://help.ubnt.com/hc/en-us/articles/218506997-UniFi-Ports-Used -->
<service version="1.0">
<short>unifi-video</short>
<description>UniFi Video Controller</description>
<port port="3478" protocol="udp"/><!-- STUN -->
<port port="8080" protocol="tcp"/><!-- Device and Controller Communication -->
<port port="8443" protocol="tcp"/><!-- WebUI -->
@fukawi2
fukawi2 / needs-restarting.py
Created September 25, 2020 04:46
needs-restarting
#!/usr/bin/python -tt
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the