Skip to content

Instantly share code, notes, and snippets.

View ikks's full-sized avatar

Igor Támara ikks

View GitHub Profile
@ikks
ikks / createopenvpncertificate.sh
Created March 28, 2016 14:28
Unified OpenVPN certificate for clients
#!/bin/bash
# Creates a file for clients, just put the name of the cert and answer y to every question
# Based on https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-debian-8
if [ $# -ne 1 ]; then
echo $'Make sure you put a name for your new client i.e.:\n'
echo " $0 loginandroid"
echo $''
exit 1
fi
#!/bin/bash
if ! grep 205 /etc/resolv.conf; then
sed -i '1s;^;nameserver 192.168.1.205\n;' /etc/resolv.conf
fi
@ikks
ikks / aq-canairio-screenshot.png
Created May 18, 2019 05:11
Taking screenshots from IBOCA and IQCN
#!/bin/bash
# This script grabs a screenshot both from aiqcn and iboca in order to make a daily snapshot of the service
# Feel free to suggest improvements, or clone it and make it happen in your own server
# thanks to the kind service in the free tier provided by https://api.browshot.com
# No warranties and make sure you get people to know that we should be able to see what are we breathing
curl -L "https://api.browshot.com/api/v1/simple?url=https://aqicn.org/map/bogota/&key=$BROWSHOT_KEY" -o $PATH_PUBLIC_CANAIRIO/canairio-$(TZ='America/Bogota' date +"%Y%m%d%H%M%S")-aiqcn.png
curl -L "https://api.browshot.com/api/v1/simple?url=http://iboca.ambientebogota.gov.co/mapa&key=$BROWSHOT_KEY" -o $PATH_PUBLIC_CANAIRIO/canairio-$(TZ='America/Bogota' date +"%Y%m%d%H%M%S")-iboca.png