Skip to content

Instantly share code, notes, and snippets.

View stonith's full-sized avatar

Darren Foo stonith

  • Shopify
  • Vancouver
View GitHub Profile
@stonith
stonith / z-wave_entities_restore.md
Last active October 16, 2024 16:28
Z-wave Entities Restore
  • Rename devices by comparing restored backup of HA, ordered by Model, choose rename entities
  • Enable SFTP
  • Stop HA container by running ha core stop in terminal
  • scp /homeassistant/.storage/core.entity_registry locally
  • regex search and replace with ("entity_id":\s*".*<entity_name>.*)_2" and $1" as replacement, replace <entity_name> and _2 with each entity name grouping
  • scp updated file back to HAOS and restart HA via ha core start
@stonith
stonith / keybase.md
Created February 21, 2017 00:34
keybase.md

Keybase proof

I hereby claim:

  • I am stonith on github.
  • I am darrenfoo (https://keybase.io/darrenfoo) on keybase.
  • I have a public key whose fingerprint is 7640 9F8F 723C 64C5 F063 CC81 435E 6B79 EB0F BCDD

To claim this, I am signing this object:

@stonith
stonith / sssd.conf
Last active August 29, 2015 14:10
sssd configuration using LDAP/kerberos and Binduser (no samba or domain join required)
[sssd]
config_file_version = 2
domains = test.local
services = nss, pam
debug_level = 0
reconnection_retries = 3
[nss]
filter_groups = root
filter_users = root
@stonith
stonith / gist:709c0fd871eb2320c779
Created November 3, 2014 08:30
Panasonic Globarange SIP Override
# Originally found here: http://bryars.eu/projects/use-the-panasonic-globarange-with-asterisk/
# Implement asterisk as per article as well as iptables entries
# Override dns entries with dnsmasq on ASUS MerlinWRT router where 192.168.1.3 is ip of asterisk server configured above
/jffs/configs/dnsmasq.conf.add
address=/proxy.joip.com/192.168.1.3
address=/www.joip.com/192.168.1.3
address=/provisioning.joip.com/192.168.1.3
# Add port fwd rules to allow voip provider to reach asterisk server for SIP and RTP
@stonith
stonith / gist:ea188565da16581c179c
Last active August 29, 2015 14:08
Kitchen-CI Windows Guests
git clone -b one_session https://github.com/mwrock/test-kitchen
gem build test-kitchen.gemspec
gem install test-kitchen-1.3.0.gem
#git clone -b Transport https://github.com/mwrock/kitchen-vagrant
#gem build kitchen-vagrant.gemspec
#gem install kitchen-vagrant-0.16.0.gem
git clone -b WinRM https://github.com/afiune/kitchen-vagrant.git
gem build kitchen-vagrant.gemspec
@stonith
stonith / knife-windows
Created September 28, 2014 06:42
Successful Auth but failed to return all data
knife winrm -VV -m web01.example.local -R EXAMPLE.LOCAL ipconfig
DEBUG: Adding web01.example.local
DEBUG: :session => :init
DEBUG: :relay_to_servers => ipconfig
DEBUG: :relayed => web01.example.local
DEBUG: web01.example.local => :run_command
DEBUG: web01.example.local[2EA1E844-A274-4774-843B-XXXXXXXXXXXX] => :shell_open
DEBUG: web01.example.local[2EA1E844-A274-4774-843B-XXXXXXXXXXXX] => :run_command[ipconfig]
DEBUG: :relay_output_from_backend => ["web01.example.local", "\r\nWindows IP Configuration\r\n\r\n"]
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.3/lib/winrm/winrm_service.rb:382:in `rescue in send_message': Bad SOAP Packet returned. Sometimes a retry will solve this error. (WinRM::WinRMWebServiceError)
@stonith
stonith / kerberos.output
Created September 27, 2014 07:31
knife-windows kerberos error
$ knife winrm -m 'web01' 'ipconfig' -R 'EXAMPLE.LOCAL'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.3/lib/winrm/http/transport.rb:208: [BUG] Segmentation fault
ruby 1.9.3p547 (2014-05-14 revision 45962) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0015 p:---- s:0079 b:0079 l:000078 d:000078 CFUNC :gss_unwrap_iov
c:0014 p:0568 s:0070 b:0070 l:000069 d:000069 METHOD /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.3/lib/winrm/http/transport.rb:208
c:0013 p:0107 s:0055 b:0055 l:000054 d:000054 METHOD /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.3/lib/winrm/http/transport.rb:124
c:0012 p:0015 s:0045 b:0045 l:000044 d:000044 METHOD /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.3/lib/winrm/winrm_service.rb:368
c:0011 p:0189 s:0037 b:0037 l:000036 d:000036 METHOD /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.3/lib/winrm/winrm_service.rb:198
@stonith
stonith / atomic.repo
Created August 31, 2014 01:42
atomic.repo for ossec
# Name: Atomic Rocket Turtle RPM Repository for CentOS / Red Hat Enterprise Linux 6 -
# URL: http://www.atomicrocketturtle.com/
# Note: This isn't covered by ASL support. -Scott
[atomic]
name = CentOS / Red Hat Enterprise Linux $releasever - atomicrocketturtle.com
mirrorlist = http://updates.atomicorp.com/channels/mirrorlist/atomic/centos-$releasever-$basearch
enabled = 1
priority = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
@stonith
stonith / unattendsysprep_2008r2.xml
Created August 17, 2014 07:28
2008R2 Sysprep unattend.xml
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
<component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PersistAllDeviceInstalls>false</PersistAllDeviceInstalls>
<DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices>
</component>
@stonith
stonith / sentry.rb
Created July 25, 2014 08:25
sentry logstash plugin
require 'logstash/outputs/base'
require 'logstash/namespace'
class LogStash::Outputs::Sentry < LogStash::Outputs::Base
config_name 'sentry'
milestone 1
config :key, :validate => :string, :required => true
config :secret, :validate => :string, :required => true