Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am geoghegan on github.
  • I am number6 (https://keybase.io/number6) on keybase.
  • I have a public key whose fingerprint is FA22 C3AE 4D96 CA2E 556A CFDD 82FC 0F6A 4C59 2135

To claim this, I am signing this object:

@geoghegan
geoghegan / ImgurDownload.sh
Created November 20, 2013 21:40
Download images from Imgur Sub-Reddit
# Downloads the first 100 pages of images from SUBREDDIT
for I in `seq 1 100`; do wget -q "http://imgur.com/r/SUBREDDIT/page/$I" -O - | grep '"post"' | grep class | cut -d\" -f 2 | while read ID; do echo "Downloading $ID.jpg"; wget -q -c "http://i.imgur.com/$ID.jpg"; done; done
@geoghegan
geoghegan / numerals.c
Created July 16, 2018 18:59
Commas in C Numerals
#include <stdio.h>
#include <locale.h>
int main()
{
/*
This will print out as 999,999,999
The magic is in the %'d but you need the locale set first
*/
@geoghegan
geoghegan / weather.sh
Created August 15, 2018 09:52
Command line weather
###
# Shows your local weather using curl
# Defaults to Dublin, Ireland (DUB) if the Weather server cannot determine your location
# instead of Oymyakon, Russia (coldest place on earth)
###
LOCAL_WEATHER=$(curl -s -N http://wttr.in/?m | head -n 7 | grep "Weather report: Oymyakon, Russia")
if [[ $LOCAL_WEATHER == 'Weather report: Oymyakon, Russia' ]]
then
syntax on
set autoindent " keep indentation when starting new lines
set tabstop=2 " spaces per tab
set softtabstop=1 " spaces per tab (when tabbing/backspacing)
set shiftwidth=2 " spaces per tab (when shifting)
set expandtab " always use spaces instead of tabs
au BufWinEnter,BufNewFile * silent tab
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
@geoghegan
geoghegan / nick.css
Created March 6, 2019 11:04
CSS problems
[data-darkreader-inline-bgcolor] {
background-color: var(--darkreader-inline-bgcolor) !important;
}
[data-darkreader-inline-bgimage] {
background-image: var(--darkreader-inline-bgimage) !important;
}
[data-darkreader-inline-border] {
border-color: var(--darkreader-inline-border) !important;
}
[data-darkreader-inline-border-bottom] {
@geoghegan
geoghegan / 8fit-gdpr.txt
Created March 14, 2019 14:44
8Fit GDPR request - 14th Feb 2019
Hi,
I wish to make an access request under Article 15 of the General Data Protection Regulation (GDPR) for a copy of any information, including but not limited to on computer or in manual form.
If you are making automated decisions about me or this account, including profiling, whether or not on the basis of Article 22 of the GDPR, please provide me with information concerning the basis for the logic in making such automated decisions, and the significance and consequences of such processing.
I would like to know whether or not my personal data has been disclosed inadvertently by your company in the past, or as a result of a security or privacy breach.
If you are additionally collecting personal data about me from any source other than me, please provide me with all information about their source, as referred to in Article 14 of the GDPR.
@geoghegan
geoghegan / z-push.example.com.conf
Created March 20, 2019 16:00
z-push apache config
Alias /Microsoft-Server-ActiveSync /domains/z-push.example.com/public_html/index.php
<Directory "/domains/z-push.example.com/public_html">
Options -Indexes
AllowOverride None
Require all granted
php_flag magic_quotes_gpc off
php_flag register_globals off
php_flag magic_quotes_runtime off
php_flag short_open_tag on
@geoghegan
geoghegan / config.php
Created March 20, 2019 16:46
z-push main config.php
define('TIMEZONE', 'Europe/Dublin');
define('STATE_DIR', '/domains/z-push.example.com/state/');
define('LOGFILEDIR', '/domains/z-push.example.com/logs/');
define('BACKEND_PROVIDER', 'BackendIMAP');
@geoghegan
geoghegan / config.php
Last active March 20, 2019 16:54
z-push IMAP config
define('IMAP_SERVER', 'imap.example.com');
define('IMAP_PORT', 993);
define('IMAP_OPTIONS', '/ssl/norsh');