Skip to content

Instantly share code, notes, and snippets.

Avatar

Ethan J. Brown Iristyle

  • Puppet, Inc.
  • Portland, OR
View GitHub Profile
@Iristyle
Iristyle / search-connected-device.sh
Last active May 22, 2020
Search APKs for string
View search-connected-device.sh
# this assumes you've already connected to the target device with
# adb connect 192.168.X.X
# grab all the APKS off the device to local machine
# based on https://stackoverflow.com/a/4033005
# this works for firetv stick 4k, but didn't work on a slightly older device for some reason
# for i in $(adb shell pm list packages | awk -F':' '{print $2}'); do adb pull "$(adb shell pm path $i | awk -F':' '{print $2}')"; mv base.apk $i.apk 2&> /dev/null ;done
# use -f to grab path along with app and split it out in the loop
# additionally -3 lists only separately installed packages
# adb shell pm list packages -f -3
@Iristyle
Iristyle / docker-compose.yml
Created May 17, 2020
Pi-Hole Synology config
View docker-compose.yml
version: '2.4'
services:
# https://hub.docker.com/r/pihole/pihole/
pihole:
container_name: pihole
image: pihole/pihole:latest
restart: unless-stopped
environment:
- TZ=America/Los_Angeles
- DNS1=1.1.1.1
@Iristyle
Iristyle / output.txt
Last active Apr 1, 2020
POSIX shell error-handling with set -e
View output.txt
# ./test.sh
140529043738688:error:20087002:BIO routines:BIO_lookup:system lib:../crypto/bio/b_addr.c:694:Name or service not known
connect:errno=2
else branch - ignored error - output: foo
command output:
bar
140510615253056:error:20087002:BIO routines:BIO_lookup:system lib:../crypto/bio/b_addr.c:694:Name or service not known
connect:errno=2
entered loop - ignored error
bar
@Iristyle
Iristyle / synology-check-transmission-tunnel-kill-if-dead.sh
Last active Apr 26, 2020
Check tunnel from inside Transmission openvpn container
View synology-check-transmission-tunnel-kill-if-dead.sh
# based on tunnelChecker from
# https://github.com/mrjackyliang/tunnelChecker
# modified to work on Alpine and doesn't require a script in the container
CONTAINER=transmission
# alpine container will always have ash (even if bash installed)
docker exec -i $CONTAINER sh <<'EOF'
PORT_FORWARD=12345
IP_CHECK=http://ipinfo.io/ip
@Iristyle
Iristyle / docker-agent-clean.ps1
Last active May 12, 2020
Script to clean images, volumes and networks, hyper-v VMs and disk cache from degraded Azure CI system / agent
View docker-agent-clean.ps1
Write-Host "Waiting for containers to exit." -NoNewLine
while ($(docker ps -q))
{
Write-Host "." -NoNewLine
Start-Sleep 1
}
Write-Host
Write-Host "Stopping Azure Agent"
Stop-Service vstsagent*
View disable-windows-defender.ps1
# must be run as an admin
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\' -Name DisableAntiSpyware -Value 1
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\' -Name DisableRoutinelyTakingAction -Value 1
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\' -Name ServiceKeepAlive -Value 0
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender' -Name 'Exclusions' -ErrorAction Ignore
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Exclusions' -Name 'Exclusions_Paths' -Value 1
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Exclusions' -Name Paths -ErrorAction Ignore
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Exclusions\Paths' -Name 'Complete Drive' -Value 'C:\'
@Iristyle
Iristyle / notes.md
Last active Aug 5, 2019
Setting up DashWare to understand GoPro Hero 7
View notes.md
  • In DashWare, create a new profile and name it GoPro Hero7 Black
  • From the GoPro add, there will already be a number of files in C:\Program Files\GoPro\GoPro Desktop App\telemetrydata\DataProfiles, including the file Hero7BlackGPMF.xml
  • Copy the file from the above directory, overwriting the file at C:\Users\Parity\Documents\DashWare\DataProfiles that is created when the new profile is created inside Dashware

NOTE: There is also a folder at C:\Program Files\DashWare\DataTool\DataProfiles which is irrelevant

More info at:

@Iristyle
Iristyle / gotchas.md
Last active Feb 28, 2019
Migrating Emby from Diskstation package to Docker Container
View gotchas.md
@Iristyle
Iristyle / docker-helpers.ps1
Last active Sep 14, 2018
Docker / LCOW helpers for Windows
View docker-helpers.ps1
function Get-DockerConfigFilePath
{
$path = "${ENV:ALLUSERSPROFILE}\docker\config\daemon.json"
# retrieve the path to daemon.json from docker service config, if present
sc.exe qc docker |
? { $_ -match 'BINARY_PATH_NAME\s*:\s*(.*)' } |
? { $_ -match '--config-file\s*(.*daemon\.json)' }
# found BINARY_PATH_NAME which contains --config-file *AND* file exists
@Iristyle
Iristyle / Pluginsync as Administrator.txt
Created Aug 1, 2018
Pluginsyc as admin vs pluginsync as SYSTEM permission differences
View Pluginsync as Administrator.txt
Path : Microsoft.PowerShell.Core\FileSystem::C:\ProgramData\PuppetLabs\code
Owner : NT AUTHORITY\SYSTEM
Group : NT AUTHORITY\SYSTEM
Sddl : O:SYG:SYD:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)
Path : Microsoft.PowerShell.Core\FileSystem::C:\ProgramData\PuppetLabs\facter
Owner : NT AUTHORITY\SYSTEM
Group : NT AUTHORITY\SYSTEM
You can’t perform that action at this time.