Skip to content

Instantly share code, notes, and snippets.

@leogallego
leogallego / ubuntu-cloud-virtualbox.sh
Last active Mar 5, 2021 — forked from smoser/ubuntu-cloud-virtualbox.sh
Ubuntu Cloud images with cloud-init and cloud-config for virtualbox
View ubuntu-cloud-virtualbox.sh
## 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 Jul 16, 2018
user-data examples from documentation for cloud-init cloud-config
View user-data
# 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:
View keybase.md

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:

View rio.sh
#!/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;
View bna.sh
#!/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;
View neovim-update-plugins
:PlugClean
:PlugInstall
:PlugUpdate
:UpdateRemotePlugins
View zimbra-delete-queue-from.sh
#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@domain.com") 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 Nov 23, 2020 — 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
View Cloud_VPS_Price_Breakdown.md
View whatsmyip
#!/bin/bash
ip=$(curl -s https://api.ipify.org)
echo "My public IP address is: $ip"