Here are some helpful commands for managing ZFS and ZPool on Ubuntu
Useful for populating /etc/zfs/vdev_id.conf
:
printDisks() {
for i in /dev/sd[b-i]; do
fdisk -l $i
# Based on https://gist.github.com/kmatt/71603170556ef8ffd14984af77ff10c5 | |
# prompt ">" indicates Powershell commands | |
# prompt "$" are Linux shell commands | |
# https://docs.microsoft.com/en-us/windows/wsl/install-win10 | |
> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | |
# install https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi |
set-option -g status-right '#{client_tty} (#(TZ=US/Mountain date +%%H:%%M)MT #(TZ=UTC date +%%H:%%M)Z) %Y-%m-%d %H:%M' |
"Linux: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
"PowerShell: iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |` ni $HOME/vimfiles/autoload/plug.vim -Force | |
let g:pymode_python = 'python3' | |
let g:python3_host_prog = expand('C:\Users\mkeranen\Python\Python310\python.exe') | |
call plug#begin() | |
Plug 'mattn/vim-gist' | |
Plug 'mattn/webapi-vim' |
# http://dwm.suckless.org/ | |
# s/dnf/rpm-ostree/ for Silverblue | |
# Xorg requirements | |
sudo dnf install xorg-x11-server-Xorg xorg-x11-drv-evdev xorg-x11-xinit xorg-x11-xinit-session xterm lightdm | |
# Build deps | |
sudo dnf install git make automake gcc gcc-c++ | |
sudo dnf install libX11-devel libXft-devel libXinerama-devel libXrandr-devel |
# To configure for MinGW instead of nmake | |
# | |
# C:\TDM-GCC-64\mingwvars.bat | |
# cmake . -G "MinGw Makefiles" | |
# | |
# Makefile: cmake ... -DCMAKE_TOOLCHAIN_FILE=TDM.cmake | |
set(CMAKE_SYSTEM_NAME Windows) | |
set(CMAKE_C_COMPILER C:/TDM-GCC-64/bin/gcc.exe) |
[cmdletbinding()] | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string[]]$servers, | |
[ValidateScript({ | |
if(-Not ($_ | Test-Path )) { | |
throw "Folder does not exist" | |
} | |
return $true |
pg_dump database -Fc backup.dump | |
pg_restore -l backup.dump | sed '/MATERIALIZED VIEW DATA/d' > restore.lst | |
pg_restore -L restore.lst -d database backup.dump | |
pg_restore -l backup.dump | grep 'MATERIALIZED VIEW DATA' > refresh.lst | |
pg_restore -L refresh.lst -d database backup.dump |
# dump | |
pg_dump testdb | pv -c -s $(psql -tc "SELECT pg_database_size('testdb')") -N dump | gzip > testdb.sql.gz | |
# restore | |
pv testdb_20120501.sql.gz | zcat | psql testdb |
# From https://fedoramagazine.org/wsl-fedora-33/ | |
# prompt ">" indicates Powershell commands | |
# https://docs.microsoft.com/en-us/windows/wsl/install-win10 | |
> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | |
# install https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi | |
> wsl --set-default-version 2 |