Skip to content

Instantly share code, notes, and snippets.

View wnasich's full-sized avatar

Walter Nasich wnasich

  • Rosario, Santa Fe, Argentina
View GitHub Profile
@wnasich
wnasich / inta_weather.php
Last active August 30, 2020 20:54
[INTA hizo cambios en su sitio. Este código no funciona] Obtención de datos históricos meteorológicos desde http://siga2.inta.gov.ar/en/datoshistoricos/
<?php
class IntaWeather {
public $endPointUrl = 'http://siga2.inta.gov.ar/en/datoshistoricos/getDatosTabla';
// Locations and fields scrapped from http://siga2.inta.gov.ar/en/datoshistoricos/
public $locations = [
'eea-reconquista-reconquista' => ['id' => 294, 'idP' => 55],
'eea-oliveros-villa-cañas' => ['id' => 299, 'idP' => 55],
];
@wnasich
wnasich / outgoing_emails_with_sendgrid.sh
Last active March 23, 2022 16:52
Install outgoing email from Debian/Ubuntu system through SendGrid
$ sudo apt install postfix mailutils
# Choose host type 'No configuration'
$ sudo cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf
$ sudo vi /etc/postfix/main.cf
# Add lines below
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:apikey:paste_your_key_here
smtp_sasl_security_options = noanonymous
@wnasich
wnasich / afip-cuit.sh
Last active January 31, 2019 12:16
Información en JSON sobre un CUIT desde webservices de AFIP usando bash (AFIP deshabilito este acceso)
#! /bin/bash
if [ -z "$1" ]; then
echo "Ingrese un CUIT"
exit 1
fi
curl https://soa.afip.gob.ar/sr-padron/v2/persona/$1
@wnasich
wnasich / segtail.sh
Last active August 29, 2015 14:19
Report changes in log file by email
#!/bin/bash
# Adapted from http://stackoverflow.com/a/4657776/641892
file=$1
subject=$2
size=0
offset=0
recipients="foo@bar"
@wnasich
wnasich / renaming-camel-case.sh
Created December 16, 2013 03:21
Renaming files from under_score_name to CamelCaseName
#!/bin/bash
for file in `ls -1`
do
mv $file `echo $file | sed -e 's/_\([a-z]\)/\u\1/g' -e 's/^\([a-z]\)/\u\1/g' -`
done