Skip to content

Instantly share code, notes, and snippets.

View gitfvb's full-sized avatar
👋

Florian von Bracht gitfvb

👋
View GitHub Profile
@gitfvb
gitfvb / read_odata.ps1
Last active April 25, 2018 13:05
load odata v4 sources via powershell
# hints: https://github.com/PowerShell/ODataUtils
# some preparation work for connection to a Redfish endpoint
# enable TLS v1.1 as required by Redfish spec
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::Tls11
# allow self-signed server certificates
if ([System.Net.ServicePointManager]::CertificatePolicy.GetType().Name -ne 'TrustAllCertsPolicy')
{
Add-Type 'using System.Net;using System.Security.Cryptography.X509Certificates;public class TrustAllCertsPolicy:ICertificatePolicy {public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate,WebRequest request, int certificateProblem) {return true;}}'
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
@gitfvb
gitfvb / filewatcher.ps1
Created April 25, 2018 15:47
file watcher in powershell
# show file events like in https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
$fi = New-Object -Type System.IO.FileSystemWatcher
$fi | gm -type Event | Select Name
@gitfvb
gitfvb / use_gecko.ps1
Created April 26, 2018 14:58
use firefox browser through powershell and avoid the internal browser
# list enumns
# [enum]::getValues([type]"System.Windows.Forms.DockStyle")
# get value of enum entry
# [System.Windows.Forms.DockStyle]::Fill.value__
# enum link https://blogs.technet.microsoft.com/heyscriptingguy/2015/08/27/working-with-enums-in-powershell-5/
cd "C:\FastStats\Build\salesforce\preload\"
@gitfvb
gitfvb / aws_s3.ps1
Created May 16, 2018 17:41
native powershell for AWS S3
<#########################
LINKS
#########################>
<#
resource: https://devops.profitbricks.com/api/s3/
@gitfvb
gitfvb / change_certificate,ps1
Last active September 29, 2021 20:50
change certificate for rdp to let's encrypt (or other) certificates
# copy the certificate from "Web Hosting\Certificates" to "Personal\Certificates" and then execute this command with changed "<FINGERPRINT>"
# note: the SHA1 fingerprint should be without spaces and with capital letters
wmic /namespace:\\root\cimv2\TerminalServices PATH Win32_TSGeneralSetting Set SSLCertificateSHA1Hash="<FINGERPRINT>"
@gitfvb
gitfvb / press_enter.ps1
Created May 27, 2018 11:24
wait for exit
$NULL = Read-Host "Press enter to exit"
@gitfvb
gitfvb / replace.ps1
Last active May 29, 2018 17:18
replace delimiter in CSV files
# with parsing of csv
$inputfile = "Datentabelle 3.txt"
$outputfile = "export.csv"
$inputdelim = "`t"
$outputdelim = ','
$inputenc = "UTF8"
$outputenc = "UTF8"
rm $outputfile
@gitfvb
gitfvb / regex.ps1
Created June 20, 2018 07:27
regex with powershell examples
# the task is to match everything between SELECT and FROM
$string = "SELECT abc FROM def"
$pattern = '(?<=SELECT\s)(.*)(?=\sFROM)'
# search for pattern and output it
$string | Select-String $pattern -AllMatches | % {$_.Matches}| % {$_.Value}
# replace the match with something else
$string -replace $pattern, 'xyz'
@gitfvb
gitfvb / readme.md
Last active April 14, 2025 07:05
Notes on Quelima R3 WiFi Camera

First

  • Install the app "Sports DV" and change WiFi SSID and password

URLs

  • Wifi and Cam settings are seperated and have different port numbers.
  • Wifi-Settings (just login withoug username and password): http://192.168.25.1
  • Cam LiveStream: http://192.168.25.1:8080/?action=stream
  • Not sure how the configuration is made really... Would need a Man-In-The-Middle-Attack or send the initial ICMP package

Change AP (Cam is the access point) to Station (Cam is a normal WiFi Client)

@gitfvb
gitfvb / merge_csv_files.ps1
Last active April 10, 2019 09:02
merge large files via powershell and load it via sqlite
################################################
#
# PREPARATION / ASSEMBLIES
#
################################################
# Load scriptpath
if ($MyInvocation.MyCommand.CommandType -eq "ExternalScript") {
$scriptPath = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition