Skip to content

Instantly share code, notes, and snippets.

View pettazz's full-sized avatar
🤷‍♂️
lol

Nick Pettazzoni pettazz

🤷‍♂️
lol
View GitHub Profile
@pettazz
pettazz / reset_qcows.sh
Created February 19, 2013 21:48
Updated reset_vms version to use qemu qcows instead of VirtualBox
#!/bin/bash
function reset_vm {
echo "resetting $1..."
cd /home/pettazz/VMs/
if [ -a $1.pid ]
then
echo "killing existing VM pid:"
@pettazz
pettazz / reset_vms.sh
Last active November 9, 2020 09:01
bash script for deleting and re-cloning VirtualBox VMs from existing base images
#!/bin/bash
function reset_vm {
echo -e "\e[0;32m\n\nresetting $1...\n\n\e[00m"
echo -e "\e[0;34mpoweroff\e[00m"
vboxmanage controlvm "$1 - active" poweroff
sleep 5s
echo -e "\e[0;34munregister\e[00m"
vboxmanage unregistervm "$1 - active" --delete
echo -e "\e[0;34mclone\e[00m"
@pettazz
pettazz / selenium.sh
Created May 8, 2012 16:00
bash script for starting/stopping selenium server from python 2.7's SeleniumLibrary
#!/bin/bash
if [ "$1" == 'stop' ]; then
echo "Stopping selenium server..."
pid=`ps -eo pid,args | grep selenium-server.jar | grep -v grep | cut -c1-6`
kill -9 $pid
elif [ "$1" == 'start' ]; then
echo "Starting selenium server..."
cd /Library/Python/2.7/site-packages/SeleniumLibrary/lib/
java -jar selenium-server.jar &> /dev/null &
else