This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # by 0xSheepdog | |
| # version 0.1.1 | |
| # | |
| # This script creates a new project directory with a specified name, then | |
| # initializes it as a git repo with a README.md file, a .gitignore file, and a | |
| # few required files and directories. Finally it installs Ansible and Ansible | |
| # Navigator in a python virtual environment within the project directory. | |
| # | |
| # ToDo - actually incorporate some VScode stuff :P |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This script provides examples for using the 'virt-customize' command to modify | |
| # a libvirt guest disk image. It demonstrates a few common items as well as | |
| # runs a shell script with more in-depth commands that will be run on the | |
| # appliance and saved to the disk image. See my 'customize-guest.sh' gist for | |
| # an example of the type of script you may use. | |
| # gist.github.com/0xSheepdog/07284a9b1a1a3e2d30cc63a40a89cb77 | |
| $ virt-customize \ | |
| -a rocky-9.0-x86_64.qcow2 \ | |
| --root-password password:S3CRETPA$SW0RD \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # add myuser and grant sudo privileges | |
| useradd -m myuser | |
| echo password | passwd myuser --stdin | |
| echo "myuser ALL=(ALL) ALL" | tee -a /etc/sudoers.d/00-myuser | |
| # enable serial console | |
| systemctl enable --now serial-getty@ttyS0.service | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo systemctl enable --now serial-getty@ttyS0.service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -xe | |
| # This script takes as a parameter the name of the VM | |
| # and creates a linked clone | |
| # Ref: https://unix.stackexchange.com/a/33584 | |
| # The scripts assumes that it runs from the same folder | |
| # where the vm image is located and it coincides with the | |
| # image name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [defaults] | |
| inventory = ./inventory.yml | |
| vault_password_file = .vaultpass | |
| retry_files_enabled = false | |
| roles_path = ./roles | |
| gathering = smart | |
| callback_whitelist = timer, profile_tasks | |
| [privilege_escalation] | |
| become = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/sect-guest_virtual_machine_installation_overview-creating_guests_with_virt_install | |
| The following example installs a virtual machine from an ISO image: | |
| # virt-install \ | |
| --name guest1-rhel7 \ | |
| --memory 2048 \ | |
| --vcpus 2 \ | |
| --disk size=8 \ | |
| --network default \ | |
| --cdrom /path/to/rhel7.iso \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source info: https://access.redhat.com/solutions/641193#comment-1104651 | |
| virt-customize -a rhel-guest-image-7.2-20160302.0.x86_64.qcow2 --root-password password:PASSW0RD --uninstall cloud-init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| virt-sparsify --tmp=. --compress drive.qcow2 new-drive.qcow2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Claas Heuer, November 2015 | |
| # | |
| # Setup Powerline on Debian and Centos for BASH, VIM and TMUX | |
| # source: https://fedoramagazine.org/add-power-terminal-powerline/ | |
| # install on debian | |
| sudo apt-get install python-pip | |
| sudo apt-get install powerline |
NewerOlder