Skip to content

Instantly share code, notes, and snippets.

@kopertop
kopertop / exportAlgoliaSettings.sh
Last active September 15, 2022 11:15
Export all Algolia Index settings
#!/bin/bash
for index in $( algolia indices list --output jsonpath --template="{..name}" ); do
echo "Export ${index}"
algolia settings get ${index} > ${index}.json
# If you have jq installed, you can get pretty formatted JSON output using:
# algolia settings get ${index} | jq "." > ${index}.json
done
# Add the following to automatically commit and push to a repository
# git add *.json
# git commit -a --m "Automatic Settings Export"
@kopertop
kopertop / hover-export.js
Last active October 3, 2017 14:46
DNS zone file
// Hover.com "Zone file import/export" has been *Planned* since 2011
// https://help.hover.com/entries/471066-Zone-file-import-export
// Here's a brittle approximation of export.
//
// This is a modified version of the original hover-export.js to allow it to be used by a normal person (non-developer)
//
// 1. Add the following Bookmarklet to Chrome
// 2. login to your account: https://www.hover.com/domains
// 3. Go to the domain you want to export
// 4. Click on the HoverDump JS Bookmark
@kopertop
kopertop / gist:10877894
Created April 16, 2014 13:45
Keybase Proof
### Keybase proof
I hereby claim:
* I am kopertop on github.
* I am cmoyer (https://keybase.io/cmoyer) on keybase.
* I have a public key whose fingerprint is E3B5 48DF C07B 68D8 1D16 62EA 8920 F20F 2F20 FBC4
To claim this, I am signing this object:
" SQLUtilities.vim
vmap <silent>sf <Plug>SQLU_Formatter<CR>
@kopertop
kopertop / pingTest
Created August 5, 2013 15:50
Ping to OnSip servers to see your latency, and report using Blink(1) Control program: http://thingm.com/products/blink-1.html
#!/bin/sh
GREEN='#00ff00'
YELLOW='#ffc000'
RED='#ff0000'
PTIME="`ping -c 1 sip.onsip.com|grep time=|awk '{split($7,a,"="); split(a[2],b,".");print b[1]}'`"
echo "PING TIME: $PTIME"
if [ $PTIME -lt 60 ];
then
@kopertop
kopertop / gist:5111618
Created March 7, 2013 20:41
Configure boto to use DreamObjects
# file: /etc/boto.cfg or ~/.boto
[s3]
host = objects.dreamhost.com
calling_format = boto.s3.connection.OrdinaryCallingFormat
# You can configure your credentials here,
# in a separate config file, or in
# environment variables
[Credentials]
access_key_id = MyDHAccessKey
"""
Modified version of cloudsearch.py as provided by https://gist.github.com/2367039#file_cloudsearch.py
"""
from math import ceil
import time
import json
import re
import boto
import boto.jsonresponse
@kopertop
kopertop / add_users.py
Created April 18, 2012 16:01 — forked from imlucas/add_users.py
Using Amazon Cloudsearch with Python and Boto
from cloudsearch import connect_cloudsearch, get_document_service
endpoint = 'paste your doc service endpoint here'
service = get_document_service(endpoint=endpoint) # Get a new instance of cloudsearch.DocumentServiceConnection
# Presumably get some users from your db of choice.
users = [
{
'id': 1,