Skip to content

Instantly share code, notes, and snippets.

View donalod's full-sized avatar
🏠
Building PanSift so you can WFH

Donal donalod

🏠
Building PanSift so you can WFH
View GitHub Profile
@donalod
donalod / squash.sh
Created May 25, 2020 10:23
Squash Current Git Commits
#!/usr/bin/env bash
echo -e "Squashing last commits since push...\n"
git reset --soft HEAD~$(git log @{u}.. | grep -i commit | wc -l | tr -d ' ') && git commit -am "$1"
#!/usr/bin/env bash
if [[ ${#1} = 0 ]]; then
echo "Note: First edit the script to update the JSON key and value to change."
echo "Usage: ./jq_replace_key_value_in_input_files.sh <file_glob_pattern>"
exit 0;
fi
key="og_image_url"
@donalod
donalod / covid_19_ie_stats
Created April 11, 2020 12:31
COVID_19_IE_STATS
# Taken from https://geohive.maps.arcgis.com/apps/opsdashboard/index.html#/29dc1fec79164c179d18d8e53df82e96
curl -s -G https://services1.arcgis.com/eNO7HHeQ3rUcBllm/arcgis/rest/services/Covid19CountyStatisticsHPSCIrelandOpenData/FeatureServer/0/query -d "f=json" -d "where=1=1" -d "returnGeometry=false" -d "spatialRel=esriSpatialRelIntersects" -d "outFields=*&groupByFieldsForStatistics=CountyName" -d "outStatistics=[{\"statisticType\":\"sum\",\"onStatisticField\":\"ConfirmedCovidCases\",\"outStatisticFieldName\":\"value\"}]" -d "cacheHint=true" | jq '.features[].attributes | "\(.CountyName),\(.value)"' | sort -nr -k2 -t","
@donalod
donalod / covid_improved.rb
Last active March 17, 2020 22:12
covid_improved.rb
#!/usr/bin/env ruby
# Requires you to install "spark" with ports or homebrew + the below gems.
require "csv"
require 'time'
require 'httparty'
require 'colorize'
require 'tty-progressbar'
@donalod
donalod / aib2xero.rb
Last active October 4, 2019 23:11
aib2xero
#!/usr/bin/env ruby
# Turns an AIB CSV export in to a Xero friendly import.
# This script is quick and dirty, feel free to DRY it up and improve....
# Xero likes: https://central.xero.com/s/article/Import-a-CSV-bank-statement
# Date, Amount (-/+ prefix), Payee, Description, Reference, Cheque Number, Analysis Code, Transaction Type
# AIB : IB(Internet Banking) : Historical
# Posted Account, Posted Transactions Date, Description1, Description2, Description3, Debit Amount, Credit Amount,Balance,Posted Currency,Transaction Type,Local Currency Amount,Local Currency
@donalod
donalod / Mov_to_GIF
Last active August 6, 2019 16:24
Mov_to-GIF
ffmpeg -i dash_01.mp4 -vf scale=800:-1 -r 15 -f image2pipe -vcodec ppm - | convert -delay 5 -layers Optimize -loop 0 - dash01_v1.gif
ffmpeg -i in3.mov -vf scale=600:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 3 -layers Optimize -loop 3 - out3.gif
ffmpeg -i hiring_v1.mp4 -vf scale=400:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 6 -layers Optimize -loop 2 - hiring_v1.gif
@donalod
donalod / check_links.sh
Last active May 29, 2019 13:47
One_Line_Broken_Link_Spider
@donalod
donalod / tito_to_slack_ticket_counts.rb
Last active May 12, 2019 23:13
tito_to_slack_ticket_counts.rb
#!/usr/bin/env ruby
require "httparty"
p "Running iNOG Tito ticket script at #{Time.now.to_s}"
# Replace <replace_with_yours> with your specific tokens, data, or urls
slack_webhook_url = "<replace_with_yours>"
tito_token = "<replace_with_yours>"
@donalod
donalod / youtube_to_twitter.rb
Last active March 6, 2019 13:12
youtube_to_twitter.rb
#!/usr/bin/env ruby
require "twitter"
require "yt"
p "Running iNOG random tweeter script at #{Time.current.to_s}"
$tumbler = []
$plucked
def yt_get_urls
@donalod
donalod / yamlfornetworkengineers_index.html
Last active January 14, 2019 17:21
yamlfornetworkengineers_index.html
<!DOCTYPE html>
<html class="no-js" lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>YAML for Network and Cloud Engineers</title>
<meta name="author" content="irldexter">
<link rel="canonical" href="https://yamlfornetworkengineers.com">
<meta name="keywords" content="nre, sre, network reliability engineering, netdevops, technical recruitment, YAML, Yet Another Markup Language, yamllint, code, network automation, sdn, software defined networking, network function virtualization">