Skip to content

Instantly share code, notes, and snippets.

@aboron
aboron / watch.sh
Created July 20, 2022 17:17
Emulated "watch" command for use in limited smartos global zone
#/bin/bash
while [ "$key" != "q" ]
do
clear
uptime
echo "`$* | head -n 35`"
read -n 1 -t 2 -s -r key
done
@aboron
aboron / ips_in_use.sh
Created July 20, 2022 17:15
Show the IP addresses assigned to all smartos zone nics
#!/usr/bin/bash
if [ "$#" -ne 1 ]; then
vmadm list -p -o uuid | while read line ;do
vmadm get $line | /usr/xpg4/bin/grep -E 'mac|"ip"|zonename|interface|alias'
echo
done
exit 0
fi
@aboron
aboron / vm-backup.sh
Created July 20, 2022 17:13
quick smartos backup for LX and OS zones (not KVM)
#!/usr/bin/bash
if [ "$#" -ne 1 ]; then
echo " *** Illegal number of parameters"
echo
echo "Usage: vm-backup <UUID>"
echo
echo "Note: Backups will dump into the current directory"
echo
exit 0
@aboron
aboron / add-lofs.txt
Created March 2, 2019 18:36
Adding lofs filesystems to smartos zones
When adding filesystems using json at initial creation, include:
"filesystems": [
{
"type": "lofs",
"source": "tank/Movies",
"target": "/Movies"
},
{
"type": "lofs",
"source": "tank/TV",
Verifying my Blockstack ID is secured with the address 1LxvyqzjSq9aQLQhjxGKf7WQ5N5rhjjZ8N https://explorer.blockstack.org/address/1LxvyqzjSq9aQLQhjxGKf7WQ5N5rhjjZ8N
@aboron
aboron / repo-rinse.sh
Last active June 17, 2021 20:37 — forked from nicktoumpelis/repo-rinse.sh
Clean, reset, and update a git repo and its submodules
git clean -xfdf
git reset --hard
git update
git submodule foreach --recursive git clean -xfdf
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@aboron
aboron / setup-vm.sh
Last active August 8, 2017 15:24
Script to automate setup of lx ubuntu zones on joyent triton
#/bin/bash
set_tzdata ()
{
# Change this to the timezone in your area
ln -fs /usr/share/zoneinfo/US/Eastern /etc/localtime
dpkg-reconfigure -f noninteractive tzdata
}
fix_fstab ()
{

Keybase proof

I hereby claim:

  • I am aboron on github.
  • I am aboron (https://keybase.io/aboron) on keybase.
  • I have a public key ASBTpuVBqQ5Qbex7AuRNbbGsCQLmXpCHNuZHY08RbsrmtAo

To claim this, I am signing this object:

@aboron
aboron / start.sh
Created February 26, 2013 18:55
Script for starting minecraft (craftbukkit) on smartos (solaris)
#!/bin/bash
cd /opt/local/minecraft
java -d64 -Xms1G -Xmx6G -XX:-UseVMInterruptibleIO -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=4 -XX:+AggressiveOpts -jar craftbukkit.jar nogui