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
$OutputEncoding = New-Object -typename System.Text.UTF8Encoding
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding
@xoner
xoner / movewin.sh
Created June 18, 2012 06:39
Move windows between monitors in a multimunitor setup in linux
#!/bin/bash
#++++++++++++++++
# Monitor Switch
#
# Moves currently focused window from one monitor to the other.
# Designed for a system with two monitors.
# Script should be triggered using a keyboard shortcut.
# If the window is maximized it should remain maximized after being moved.
# If the window is not maximized it should retain its current size, unless
# height is too large for the destination monitor, when it will be trimmed.
@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 / 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'
}
@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 / pshh.ps1
Created November 29, 2012 10:26
Simple function to load putty inside Conemu hosted powershell given a hostname or a saved session name.
function pssh()
{
Param
(
[Parameter(Mandatory=$true)]
[String]
$destinationHost = $null
)