Skip to content

Instantly share code, notes, and snippets.

@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 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 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 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:
View whatsmyip
#!/bin/bash
ip=$(curl -s https://api.ipify.org)
echo "My public IP address is: $ip"
View gist:f0cb6d49d87b776d70c45b246a71f4a6
In VIM:
:w !sudo tee %
Or in .vimrc, map w!! to the command above:
cmap w!! w !sudo tee > /dev/null %
View gist:ac18185e54e5dcaf598a748823f76832
# 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)