Local ISOs:
xe sr-create name-label="iso" type=iso device-config:location=/mnt/zfs/iso device-config:legacy_mode=true content-type=iso
#!/bin/bash | |
# Cut a part of a video with FFMPEG | |
if [[ $# -eq 0 ]] ; then | |
echo "Usage:" | |
echo " $0 <filename> <start position timestamp> <duration> [additional params]" | |
echo "" | |
echo "Example:" | |
echo " Cut 50 seconds starting from timestamp 01:23:45 from file myvid.mp4" |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"strings" | |
) | |
func main() { | |
b, _ := ioutil.ReadFile(`/proc/sys/kernel/random/uuid`) |
# Maintainer: Pekka Järvinen | |
# FreeBSD's pkg git (source) version | |
# Intended use is for building FreeBSD binary packages on Arch Linux with: | |
# % pkg create --format txz --root-dir $(PWD) --manifest manifest.sh | |
pkgname=freebsd-pkg-git | |
pkgver=1 | |
pkgrel=1 | |
pkgdesc="FreeBSD pkg from source (for building FreeBSD packages on Linux)" | |
url="https://github.com/freebsd/pkg" |
#!/bin/bash -e | |
# Generate SystemD .network files for network interface automatically | |
# (c) Pekka Järvinen 2019- | |
# Check that there are arguments given | |
if [ "$#" -eq 0 ]; then | |
echo "No arguments were given. See $0 --help or $0 -h for usage instructions." 1>&2 | |
exit 1 | |
fi |
Local ISOs:
xe sr-create name-label="iso" type=iso device-config:location=/mnt/zfs/iso device-config:legacy_mode=true content-type=iso
Quick NAT with GNU/Linux iptables firewall.
First set static IP for LAN adapter:
ip address add 192.168.99.1/24 dev LANeth0
Enable packet forwarding:
echo 1 > /proc/sys/net/ipv4/ip_forward
# List established IPs and ports with DNS resolved names and program names | |
$nfo = @() | |
ForEach ($c in Get-NetTCPConnection -State Established) { | |
if ($c.LocalAddress -eq $c.RemoteAddress) { | |
# skip same IP's | |
Continue | |
} | |
$prog = (Get-Process -Id $c.OwningProcess) |
$items = Get-ItemProperty -Path 'Registry::HKey_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\*' | |
Foreach ($item in $items) { | |
$objUser = New-Object System.Security.Principal.SecurityIdentifier($item.PSChildName) | |
$objName = $objUser.Translate([System.Security.Principal.NTAccount]) | |
$item.PSChildName = $objName.value | |
} | |
Write-Output $items | Select-Object -Property PSChildName, ProfileImagePath |
takeown /f "$path" | |
icacls "$file" /grant administrators:F |
#!/bin/env/python | |
# -*- encoding: utf8 -*- | |
# | |
# Move files based on directory match list | |
# | |
# Example: | |
# /sorted directory has following directories: | |
# - foo | |
# - bar | |
# |