Skip to content

Instantly share code, notes, and snippets.

@meoso
meoso / export.json
Created June 29, 2022 14:51
Enhancer For Youtube export includes script to hid recommended
{
"version": "2.0.115",
"settings":
{
"blur": 0,
"brightness": 100,
"contrast": 100,
"grayscale": 0,
"huerotate": 0,
"invert": 0,
@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
@meoso
meoso / gist:38c6bb84e450906e0593b9c020e82d3e
Last active March 7, 2022 20:24
KeepForeverFALSE__ALLLLL -- for https://script.google.com/ and gDrive file revision "KeepForever" modification
function setRevisionPurge() {
//var search = '(title contains .BBL) or (title contains .bbl)';
var files = DriveApp.getFiles(); //DriveApp.searchFiles(search);
while (files.hasNext()) {
var file = files.next();
var fileName = file.getName();
var fileId = file.getId();
@meoso
meoso / datastore-stats.ps1
Last active January 26, 2022 17:14
VMWare DataStore Statistics
[CmdletBinding()]
param(
[Parameter(Mandatory=$True,Position=0,HelpMessage="The script will output to .CSV datastore statistics for the provided vCenter Server hostname or FQDN")]
[string]$vCenter
)
Import-Module VMware.VimAutomation.Core | Out-Null
try {
Connect-VIServer -Server $vCenter -Protocol https -Force -ErrorVariable err -ErrorAction SilentlyContinue | Out-Null
$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 / check-hamachi.sh
Last active April 13, 2021 20:14
bash script to check hamachi status and perform reset tasks if applicable
#!/opt/bin/bash # Synology (requires bash from entware-ng or optware[-ng])
# #!/bin/bash # Other *nix
############# EDIT BLOCK ##############
array_ping_list=("25.1.2.3" "25.2.3.4" "25.3.4.5") #only the IP's expected always-on
array_network_list=("my.net" "my-other.net") #all your networks independent of IP's
log_file=~/check-hamachi.log
#### OS dependent config:
## Linux:
hamachi_service_stop="sudo /etc/init.d/logmein-hamachi stop"
@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 / .ElementaryOS.md
Last active February 3, 2020 04:28
base setup for converting Windows user to ElementaryOS Loki release

For converting Windows users to Linux, I'd choose ElementaryOS for it's simplicty and ubuntu base.

Firstly changing min,max,& close window-manager icons to traditional right-side positioning.

Install Firefox and LibreOffice.

Modify launch bar for standard apps.

See attached shell commands.

@meoso
meoso / shift_state.c
Last active February 3, 2020 04:28
linux keyboard return shift-key pressed state
#include <sys/ioctl.h>
#include <asm/ioctls.h>
#include <stdio.h>
#include <fcntl.h>
// code by "dma" via https://forums.gentoo.org/viewtopic-p-2455159.html#2455159
int main(int argc, char *argv[]) {
int fd;
char shift_state;
@meoso
meoso / awesomeview.sh
Created June 15, 2017 20:35
AwesomeView.sh - Largest Folders and Files - Found this script online somewhere and modified it slightly
#!/bin/sh
if [ "$1" = "" ] ; then
folder=$(pwd)
else
folder=$1
fi
echo ""
date