Skip to content

Instantly share code, notes, and snippets.

View cernoel's full-sized avatar
🍉
One in a mellon!

Markus Gombocz cernoel

🍉
One in a mellon!
View GitHub Profile
@cernoel
cernoel / Save-KeyValue-ToFile.ps1
Last active June 22, 2017 06:01
Store and Load a KeyValue-Object to File - EasyMode
#Save File
##################
$MyDict = @{}
$MyDict.Add($SomeKey1, $SomeValue1)
$MyDict.Add("KEY2", "Value2")
$MyDict.Add("KEY3", "Value3")
try {
$MyDict | Export-Clixml $FilePathToDict
@cernoel
cernoel / qv_load_db2_scheme.qvs
Created June 28, 2017 08:03
QlikView Load Script to get some DB2 Metadata
SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
SET MoneyFormat='#.##0,00 €;-#.##0,00 €';
SET TimeFormat='hh:mm:ss';
SET DateFormat='DD.MM.YYYY';
SET TimestampFormat='DD.MM.YYYY hh:mm:ss[.fff]';
SET MonthNames='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';
SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';
@cernoel
cernoel / config.txt
Last active March 7, 2022 02:58
Mikrotik <> Fortigate IPSEC with NAT (dynamic IP on Client Side) .. fast draft.. use at your own risk
###################
Forti
###################
FG80C-HQ # config vpn ipsec phase1-interface
FG80C-HQ (phase1-interface) # show
config vpn ipsec phase1-interface
edit "BRO-IPSEC"
set type dynamic
set interface "wan1"
@cernoel
cernoel / configger.psm1
Created September 14, 2017 12:17
PowerShell JSON Config-File-Reader
#Module
filter timestamp {"$(Get-Date -Format yyyy-MM-dd-HH:mm:ss.fff): $_"}
$CConfig = @{}
function Import-CConfig{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=1)]
[ValidateNotNullorEmpty()]
@cernoel
cernoel / .gitignore
Last active March 17, 2020 07:20
musescore gitignore
# musescore gitignore
# https://stackoverflow.com/questions/987142/make-gitignore-ignore-everything-except-a-few-files
# Ignore everything
*
# But not these files...
!.gitignore
!README.md
!*.mscx
!*.musicxml
@cernoel
cernoel / README.txt
Created August 3, 2020 15:30
btrfs + beesd dedup setup on debian 10
# install btrfs + bees (dedup daemon)
# ---------------------------------
# add new "big" disk to vm (edit vm, add new disk)
# be root
su -
# check for new disk in guest
@cernoel
cernoel / backup-vm-data.ps1
Created August 6, 2020 08:18
get guest data from vmware cluster with powercli
# https://communities.vmware.com/thread/278559
$Destination = "/mnt/backup0/vmx/"
Connect-VIServer -Server <server> -User <user> -Password <password>
$ClusterReport=@()
$vms = Get-VM
foreach($item in $vms){
@cernoel
cernoel / backup-vmx.ps1
Created August 6, 2020 08:21
backup vmx and vmxf files from vsphere cluster with powercli
# https://communities.vmware.com/thread/278559
$Destination = "/mnt/backup0/vmx/"
Connect-VIServer -Server <server> -User <user> -Password <password>
Get-VM | `
Get-View | `
@cernoel
cernoel / bash_filedate_checker.sh
Created March 6, 2022 11:22
check receiving of a new file via filedate
#!/bin/bash
set -e
filename="./my-file"
waitseconds=30
now=$(date +%s)
timeout=$(( now + waitseconds ))
file_modified=$(stat -c '%Y' $filename)
@cernoel
cernoel / etc_hosts_syncer.sh
Created May 17, 2022 17:25
syncs /etc/hosts from mydns1 and restart dnsmasq if file has changed
#!/bin/bash
# more strict, if something goes wrong, script stops
set -e
workdir=/root/dns_syncer
newhostsfile=$workdir/newhosts
# copy file from primary
scp -q -o LogLevel=QUIET unpriv@mydns1:/etc/hosts $newhostsfile