Skip to content

Instantly share code, notes, and snippets.

@EamonKeane
EamonKeane / Spanish_Postcode__Centroids.geojson
Last active August 23, 2022 13:26
Spanish Postcode Centroids 'Codigo Pos'
We couldn’t find that file to show.
import os, zipfile
import geopandas as gpd
import pandas as pd
import shutil
project_folder = 'Spain_CartoCity/'
extension = '.zip'
root_folder = '/Users/Eamon/Google Drive/Python Scripts/merge_CartoCiudad'
df_list = []
@EamonKeane
EamonKeane / ssh_to_worker_Azure_AKS.sh
Last active January 29, 2018 17:19
SSH to azure worker node on Azure kubernetes service (AKS)
#!/usr/bin/env bash
#This assumes you are attempting to connect to Azure AKS from outside Azure.
#By default Azure doesn't provide any external access or assign an IP address to worker nodes, so this script:
#1. Creates a public ip address in the same region as the cluster
#2. Associates the ip address with the NIC card attached to the worker VM
#Azure creates a separate group for managed clusters e.g. MC_my_cluster_my_cluster_group_my_region
#Azure creates node names in the format aks_agentpool_0000000_0
#The respective NIC cards have the same number as the node_number e.g. aks-agentpool-0000000-nic-0
@EamonKeane
EamonKeane / create-github-webhook.sh
Last active February 1, 2018 18:37
Create a webhook for a github repository.
#!/usr/bin/env bash
# this creates a github webhook that gets all events to a repository, useful with Jenkins Blue Ocean
service_url="https://my_url"
service_port="my_port"
organisation=""
repository=""
git_url="https://api.github.com/repos/${organisation}/${repository}/hooks"
auth_token="" # needs to have admin permissions for the repository
@EamonKeane
EamonKeane / gist:b573737a5ed324e69e45cef0e03b3be2
Created April 25, 2018 09:48
Delete ACS Engine Resources
myResourceGroup=my-azure-resource-group
# To delete VMs:
az vm list -o tsv -g $myResourceGroup |
awk '{print $7}' |
while read line;
do az vm delete --resource-group $myResourceGroup --name $line --yes
done
VM_USERNAME=azureuser
NODE_NAME=aks-nodepool1-47278868-0
CONTAINER_LIFETIME=600
INTERNAL_IP=$(kubectl get nodes --selector=kubernetes.io/hostname=$NODE_NAME -o json | jq .items[0].status.addresses[0].address --raw-output)
DEPLOYMENT_NAME=aksssh
LABELS="app=aksssh"
kubectl run $POD_NAME --image=debian --labels=$LABELS --command sleep $CONTAINER_LIFETIME
sleep 60
POD_NAME=$(kubectl get po --selector=$LABELS -o json | jq .items[0].metadata.name --raw-output)
kubectl exec $POD_NAME -- apt-get update