Skip to content

Instantly share code, notes, and snippets.

@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
#!/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;
@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;
: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@domain.com") print $1} ' | tr -d '*!'
```
#If you get error about egrep, you might need to use this syntax:
#!/bin/bash
ip=$(curl -s https://api.ipify.org)
echo "My public IP address is: $ip"
In VIM:
:w !sudo tee %
Or in .vimrc, map w!! to the command above:
cmap w!! w !sudo tee > /dev/null %
# Set all directories permissions to 755 / rwx-r-x-r-x
find . -type d -exec chmod 755 {} \;
# Set all files permissions to 644 / rw-r--r--
find . -type f -exec chmod 644 {} \;
# Set all directories permissions to 555 / r-x-r-x-r-x (read only)
find . -type d -exec chmod 755 {} \;
# Set all files permissions to 444 / r--r--r-- (read only)