A simple classless PHP regex router function
https://gist.github.com/iiidefix/ea2ba83b51045ed667eaaa40d60cba88
A simple classless PHP regex router function
https://gist.github.com/iiidefix/ea2ba83b51045ed667eaaa40d60cba88
Assuming the following Data:
curl 'http://example.com/webdav'
curl -X MKCOL 'http://example.com/webdav/new_folder'
curl -T '/path/to/local/file.txt' 'http://example.com/webdav/test/new_name.txt'
curl -X MOVE --header 'Destination:http://example.org/webdav/new.txt' 'http://example.com/webdav/old.txt'
File:
curl -X DELETE 'http://example.com/webdav/test.txt'
Folder:
curl -X DELETE 'http://example.com/webdav/test'
curl -i -X PROPFIND http://example.com/webdav/ --upload-file - -H "Depth: 1" <<end <?xml version="1.0"?> <a:propfind xmlns:a="DAV:"> <a:prop><a:resourcetype/></a:prop> </a:propfind> end
View partition table of disk.img:
fdisk -lu disk.img
Disk disk.img: 1.3 GiB, 1361051648 bytes, 2658304 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x6f92008e Device Boot Start End Sectors Size Id Type disk.img1 8192 131071 122880 60M c W95 FAT32 (LBA) disk.img2 131072 2658303 2527232 1.2G 83 Linux
Mount partition by using start multiplied by sector size as offset
mount -o loop,offset=$((131072 * 512)) disk.img /mnt
$hbas = Get-VMHostHba -VMHost $vmHost -Type FibreChannel foreach ($hba in $hbas) { $wwpn = (&{param ($s) for($i=14;$i -gt 0;$i-=2) {$s=$s.insert($i,":")} return $s}("{0:x}" -f $hba.PortWorldWideName)) Write-Host "`t" $hba.Device "|" $hba.model "|" "World Wide Port Name:" $wwpn }
to start tmux on login add the following to your ~/.bashrc
# Start Tmux by default # If not running interactively, do not do anything if command -v tmux>/dev/null; then [[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux fi
to automatically attach to last session or create a new if none available extend your ~/.bashrc and ~/.tmux.conf with the following
~/.bashrc
# Start Tmux by default # If not running interactively, do not do anything if command -v tmux>/dev/null; then [[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux attach fi
~/.tmux.conf
# if run as "tmux attach", create a session if one does not already exist new-session -n $HOST