Skip to content

Instantly share code, notes, and snippets.

@leogallego
leogallego / ubuntu-cloud-virtualbox.sh
Last active November 5, 2024 19:19 — forked from smoser/ubuntu-cloud-virtualbox.sh
Ubuntu Cloud images with cloud-init and cloud-config for virtualbox
## Install necessary packages and latest virtualbox
wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox_2016.asc | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic non-free contrib" >> /etc/apt/sources.list.d/virtualbox.org.list'
sudo apt update
sudo apt install virtualbox-5.2 qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
## WARNING: not needed?
#sudo modprobe -r kvm_amd kvm_intel
#sudo service virtualbox stop
@leogallego
leogallego / user-data
Created July 16, 2018 02:28
user-data examples from documentation for cloud-init cloud-config
# source: https://cloudinit.readthedocs.io/en/latest/topics/examples.html#including-users-and-groups
# Add groups to the system
# The following example adds the ubuntu group with members 'root' and 'sys'
# and the empty group cloud-users.
groups:
- ubuntu: [root,sys]
- cloud-users
# Add users to the system. Users are added after groups are added.
users:

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

sudo update-pciids; sudo update-usbids
@leogallego
leogallego / rio.sh
Last active September 13, 2018 18:21
#!/bin/bash
while [ 1 ];
do echo -n "RIO cotizacion `date` -----> " ;
curl https://banco.santanderrio.com.ar/exec/cotizacion/index.jsp 2> /dev/null | grep -a \<td\> | head -n 3 | cut -d " " -f 2 | cut -d "<" -f 1 | tail -n 1;
sleep 30;
done;
#!/bin/bash
while [ 1 ];
do
echo -n "BNA cotizacion `date` -----> " ;
curl http://www.bna.com.ar/Personas 2> /dev/null | grep -a \<td| sed '3q;d'|sed 's|<[^>]*>||g' | sed -e 's/^[ \t]*//';
sleep 30;
done;
:PlugClean
:PlugInstall
:PlugUpdate
:UpdateRemotePlugins
#To first see what would be deleted. As root:
```
/opt/zimbra/postfix/sbin/postqueue -p | egrep -v '^ *\(|-Queue ID-' \
| awk 'BEGIN { RS = "" } { if ($7 == "[email protected]") print $1} ' | tr -d '*!'
```
#If you get error about egrep, you might need to use this syntax:
@leogallego
leogallego / Cloud_VPS_Price_Breakdown.md
Last active November 28, 2023 12:37 — forked from justjanne/Price Breakdown.md
Cloud VPS and Dedicated Server Price Breakdown for DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net
#!/bin/bash
ip=$(curl -s https://api.ipify.org)
echo "My public IP address is: $ip"