Skip to content

Instantly share code, notes, and snippets.

@meoso
meoso / enable_CBT_on_VMs_where_CBT_notEnabled.ps1
Created January 29, 2020 14:18
PowerCLI enable CBT on VM's where CBT is disabled
$vcenter="vcenter.domain.tld"
Import-Module -Global VMware.VimAutomation.Core
Disconnect-VIServer * -Confirm:$false -Force | Out-Null #Disconnect all previously connected vcenter servers
# new spec
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
# enable ctk
$vmConfigSpec.changeTrackingEnabled = $true
@meoso
meoso / 0_re-encode.scripts.md
Last active December 13, 2024 19:45
ffmpeg re-encoding scripts to reduce filesize and remain "visually" lossless

I've accumulated too many quadcopter (drone) footage files (.mp4, .MOV, etc).

I researched how to ffmpeg re-encode with "practical" losslessness (i.e. not lessless, but human eye acceptable).

These are my resultant scripts. The filenames say "reduce" but should actually be "re-encode".

In the case of GoPro, these scripts should retain the Gyro data.

I recommend footage filenames and folder-names to not include spaces. I rename all existing files in a folder with the command rename "s/[[:space:]]/_/g" * to make certain i have no spaces in filenames. You could rename all files in subfolders as well: e.g. find ~/SYNC/YT-Archive/ -type f -name "*[[:space:]]*" -exec rename "s/[[:space:]]/_/g" "{}" \;.

@meoso
meoso / shotcut.sh
Last active December 3, 2020 17:45
Shotcut launcher bash script
#!/bin/bash
#assumes new downloads of shotcut is always in ~/Downloads
currpath=$(pwd)
cd ~/Downloads
chmod +x ./[Ss]hotcut-*.AppImage
#always choose the latest Shotcut-*.AppImage download
shotcut=$(ls -Art [Ss]hotcut-*.AppImage | tail -n 1 | cut -d' ' -f 9-)
cd "${currpath}"
@meoso
meoso / config.md
Created April 8, 2019 15:33 — forked from 0XDE57/config.md
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable.

I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@meoso
meoso / pulseaudio-bluetooth.conf
Created April 16, 2018 14:42 — forked from dlech/pulseaudio-bluetooth.conf
BlueZ 5 and PulseAudio on Debian jessie
<busconfig>
<policy user="pulse">
<allow send_destination="org.bluez"/>
</policy>
</busconfig>
@meoso
meoso / Delete Obsolete WSUS Updates.sql
Last active February 6, 2018 21:12 — forked from Chris-ZA/Delete Obsolete WSUS Updates.sql
Script to Delete Obsolete WSUS Updates
-- This script deletes all obsolete WSUS updates from a WSUS database.
-- For more information, visit http://thebashfuladmin.com/2016/05/13/workaround-for-wsus-sql-timeout-errors/
USE SUSDB
DECLARE @UpdateID INT
DECLARE @message varchar(1000)
PRINT 'Create table'
CREATE TABLE #ObsoleteUpdatesToCleanup (UpdateID INT)
@meoso
meoso / eachandevery.sh
Created November 15, 2017 20:40
eachandevery.sh - RHEL/CentOS - try to update each and every package individually
#!/bin/bash
#eachandevery.sh - RHEL/CentOS - try to update each and every package individually due to broken behavior
yum check-update | awk '{print $1}' | tee ~/updateable.txt
while read -r packagename ; do
echo "INSTALLING ${packagename}"
yum -y --skip-broken update "${packagename}"
done < ~/updateable.txt
@meoso
meoso / rdpcli.csv
Last active March 24, 2022 16:18
xfreerdp bash commandline wrapper - Simple bash script to launch xfreerdp against csv file of clients
Title Host Username Domain Resolution AdditionalParams
user@example host01 username domain.com 1920x1200 +clipboard /cert-tofu
anothermachine machine74 username domain.com 1920x1200 +clipboard /cert-tofu
admin@thatothermachineiforget examplehostname administrator domain.com 1920x1200 +clipboard /cert-tofu
$OU="OU=TheOUName,DC=yourdomain,DC=com"
$ShadowGroup="CN=ShadowGroupName,OU=TheOUName,DC=yourdomain,DC=com"
Import-Module ActiveDirectory
(Get-ADGroup -Identity $ShadowGroup -properties members).Members | Get-ADUser | Where-Object {$_.distinguishedName –NotMatch $OU} | ForEach-Object {Remove-ADPrincipalGroupMembership –Identity $_ –MemberOf $ShadowGroup –Confirm:$false}
Get-ADUser –SearchBase $OU –SearchScope OneLevel –LDAPFilter "(!memberOf=$ShadowGroup)" | ForEach-Object {Add-ADPrincipalGroupMembership –Identity $_ –MemberOf $ShadowGroup}
@meoso
meoso / remmina.sh
Last active July 19, 2017 18:42
remmina wrapper - script to launch remmina from xfce panel launcher; also re-focuses; also kills
#!/bin/bash
shift_state=$(sudo ~/scripts/shift_state) #https://gist.github.com/meoso/b46b441b31344804c6837829e059c2b8
if (( $shift_state )) ; then
killall remmina
rm -f ~/.freerdp/known_hosts
else
RWindow=""
RWindow=$(wmctrl -l | grep "Remmina Remote Desktop Client")
if [ -z "$RWindow" ]