Skip to content

Instantly share code, notes, and snippets.

View xoner's full-sized avatar
🐍
Python Rocks!

David Pascual Rocher xoner

🐍
Python Rocks!
View GitHub Profile
@xoner
xoner / solve-blksnap-error-ol9.md
Last active November 22, 2023 08:40
Solve [error] Neither [blksnap] nor [veeamsnap] module was found on Oracle linux

When running veeam agent for linux free on a freshly intalled oracle linux with uek kernel machine I got the error:

[error] Neither [blksnap] nor [veeamsnap] module was found

I'v discovered that the blksnap module not was loaded, it had an error at compilation time, this error was due to the fact that installing veeam through dnf installed dependend kernel-devel package, but the package needed to compile this module on this kind of installations is kernel-uek-devel.

In order to get veeam running execute:

dnf install kernel-uek-devel -y
@xoner
xoner / pending-updates.ps1
Created February 18, 2021 12:53 — forked from Grimthorr/pending-updates.ps1
PowerShell script to list the pending/missing Windows updates.
$UpdateSession = New-Object -ComObject Microsoft.Update.Session
$UpdateSearcher = $UpdateSession.CreateupdateSearcher()
$Updates = @($UpdateSearcher.Search("IsHidden=0 and IsInstalled=0").Updates)
$Updates | Select-Object Title
@xoner
xoner / termux-url-opener
Created January 29, 2021 07:01 — forked from LordH3lmchen/termux-url-opener
termux-url-opener
#!/data/data/com.termux/files/usr/bin/zsh
#
# This is a termux-url-opener script to do diffrent tasks on my Android phone
#
#
#
# How to use this script
#############################
# Create the bin directory
# ➜ ~ mkdir bin
@xoner
xoner / upgrade-lxd-vms.sh
Created August 1, 2017 07:49
run apt update and apt dist-upgrade in all lxd vms running in your box
lxc list | grep \|\ | tail -n +2 | awk '{print $2}' | xargs -I {} bash -c 'printf "\nUpdating {}\n\n"; lxc exec {} -- bash -c "apt-get update && apt-get dist-upgrade -y";'
@xoner
xoner / TorKiller.ps1
Created May 12, 2017 06:30
Powershell script that runs in backgroud and randomly kills the tor and the tor browser processes.
while ($true) {
$randomSleep = Get-Random -minimum 20 -maximum 45;
Write-Output "Sleeping $randomSleep";
Start-Sleep $randomSleep;
$torProcess = Get-Process | Where { $_.ProcessName -eq "tor" }
$torFirefox = Get-Process | Where { $_.Description -eq "Tor Browser" }
taskkill.exe /F /PID $torProcess.Id
@xoner
xoner / shutdown-runnning-vms.sh
Created November 7, 2016 08:51
Bash script that shuts down all the running machines in a kvm host
#!/bin/bash
#
# Shuts down all the machines that are currently running in a kvm host
for machine in $(virsh list | tail -n +3 | awk '{print $2}');
do
echo "Sutting down $machine"
virsh shutdown $machine
done;
@xoner
xoner / random_cowsay_fortune
Created May 8, 2015 10:33
Random animals showing random quotes at your terminal
#!/bin/bash
# before running
# apt-get install cowsay fortune
COW_FILES_DIR="/usr/share/cowsay/cows/"
COW_FILE_ORDER=$(( (RANDOM %51) + 2))
RDM_COW_FILE=$(ls -l $COW_FILES_DIR | tail -n +$COW_FILE_ORDER | head -n 1 | awk '{print $9}')
RDM_COW_PATH="$COW_FILES_DIR$RDM_COW_FILE"
@xoner
xoner / Recurively-Find-Owned-By-User.ps1
Last active August 29, 2015 14:13
Recursively looks for files owned by a specified user in a folder and exports them to a csv (excel) spreadsheet.
Get-ChildItem -Force -Recurse -File |
Select *,@{n='Owner';e={(Get-Acl -LiteralPath $_.FullName).Owner}} |
Where {$_.Owner -eq 'DOMAINNAME\username'} | Select FullName, Owner, Length |
Export-Csv Files-User.csv
@xoner
xoner / copy-java-security-options.ps1
Created April 17, 2014 09:56
Java security options deployer
$javaDeployment = ''
$profilesDir = ''
## We are runnig Windows Vista, 7, 8 , Server 2008, 2008 R2, 2012 or highter
if ([System.Environment]::OSVersion.Version.Major -ge 6)
{
Write-Host -ForegroundColor Green "OS Windows Vista, 7, 2008, 2008R2 or highter"
$javaDeployment = 'AppData\LocalLow\Sun\Java\Deployment'
$profilesDir = 'C:\Users'
}
$OutputEncoding = New-Object -typename System.Text.UTF8Encoding
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding