Skip to content

Instantly share code, notes, and snippets.

@manualbashing
manualbashing / em.sh
Last active March 30, 2020 13:21
Install Emacs26 on Ubuntu WSL (SpaceEmacs)
#!/usr/bin/env bash
# Checks if there's a frame open
emacsclient -n -e "(if (> (length (frame-list)) 1) 't)" 2> /dev/null | grep t &> /dev/null
if [ "$?" -eq "1" ]; then
emacsclient -a '' -nqc "$@" &> /dev/null
else
emacsclient -nq "$@" &> /dev/null
fi
@manualbashing
manualbashing / backup.bat
Created March 28, 2020 13:55
Robocopy simple backup
@echo off
cls
echo Backup starten? ([y]/n)
set INPUT=
set /P INPUT=Type input: %=%
If /I "%INPUT%"=="n" goto end
Robocopy A:\ B:\ /MIR /w:5 /r:5 /Z /V /NFL /NDL /XD "$RECYCLE.BIN" "System Volume Information"
@manualbashing
manualbashing / InstallWindowsUpdates.ps1
Last active April 1, 2020 13:46
Install all available windows update
$updates = Start-WUScan
if ($updates.Count -gt 0) {
$null = Install-WuUpdates -Updates $updates
if (Get-WuIsPendingReboot) {
Write-Host "Updates applied. Rebooting system."
Restart-Computer
}
}
@manualbashing
manualbashing / ansible_windows_target.md
Created March 26, 2020 16:23
Ansible with windows host as target
@manualbashing
manualbashing / Fallback_to_BOINC.md
Last active March 24, 2020 09:11 — forked from daniilyar/BOINC_Rosetta_home_Ubuntu_18
How to install BOINC and start calculating for Rosetta@home on Ubuntu 18.04 LTS

Install BOINC

sudo -i
apt -qqy update && apt install -y --auto-remove libsm6 libxext6 libnotify-bin libcurl3 && apt -qqy clean
cd /opt
wget -q https://boinc.berkeley.edu/dl/boinc_7.4.22_x86_64-pc-linux-gnu.sh -O boinc.sh
chmod ugo+x boinc.sh && ./boinc.sh # Will print 'use /opt/BOINC/run_manager to start BOINC'
cd BOINC
@manualbashing
manualbashing / Test-AzDOPipeline.ps1
Created March 14, 2020 12:24 — forked from JustinGrote/Test-AzDOPipeline.ps1
Test Azure Devops Pipeline YAML
function Test-AzDOPipeline {
<#
.SYNOPSIS
Tests an Azure Devops Pipeline YAML configuration
.DESCRIPTION
This can be used to validate an Azure Devops pipeline configuration within a particular pipeline project.
#>
param (
#Your Azure Devops Organization Name
@manualbashing
manualbashing / sec_clear.ps1
Created March 5, 2020 15:54
Clear Text Password from Secure String
$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($secString)
$ClearTextPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)
@manualbashing
manualbashing / sabnzb.md
Last active February 11, 2020 14:46
[Install SabNZB and NZBHydra on Pi4] #raspi

SABnzb

Add the following to the sources list:

deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free

Install with the following commands:

@manualbashing
manualbashing / mount_unmount.ps1
Created February 2, 2020 21:21
[Unmount and Detach Datastore from ESXi Host] #PowerCLI
$esx = Get-VMHost *esx01*
$ds = Get-Datastore -VMHost $esx
$lun = Get-ScsiLun -VmHost $esx
$hostStorageSystem = Get-View $esx.Extensiondata.ConfigManager.StorageSystem
foreach ($uuid in $ds.ExtensionData.info.Vmfs.uuid)
{
Write-Host -ForegroundColor Magenta "Unmounting Volume $uuid"
$hostSTorageSystem.UnmountVmfsVolume($uuid)
@manualbashing
manualbashing / remove_cert.md
Created January 24, 2020 17:02
[Remove Certificates from store on VCSA] #vSphere

Alias des Zertifikats ermitteln

openssl x509 -text -noout -in /cert/vmca.cer

Die Werte mit den Zertifikaten im Store vergleichen: