Skip to content

Instantly share code, notes, and snippets.

View tomconte's full-sized avatar
💻
Working from home

Thomas Conté tomconte

💻
Working from home
View GitHub Profile
@tomconte
tomconte / upload_to_blobs.py
Last active September 25, 2015 12:38
Uploads a directory tree to Windows Azure Blob Storage
#!/usr/bin/env python
import os
import sys
import mimetypes
from azure.storage import BlobService
BLOB_ACCOUNT = "foo"
BLOB_KEY = "bar"
DEST_CONTAINER = "test"
@tomconte
tomconte / wp2tumblr.py
Created April 16, 2011 16:18
WordPress to Tumblr migration
#!/usr/bin/env python
"""
wp2tumblr.py
Python script for migrating your Wordpress blog to Tumblr
Karteek Edamadaka
Modified by Thomas Conte for his own needs
"""
import os
import sys
@tomconte
tomconte / Program.cs
Created August 10, 2011 16:28
Sample command-line utility to enable Storage Analytics on Windows Azure
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using Microsoft.WindowsAzure;
using System.IO;
using System.Xml.Linq;
using NDesk.Options;
@tomconte
tomconte / genc64clut.py
Created September 16, 2012 18:32
Generate a Color Look Up Table (CLUT) for the Commodore 64 palette, using the Python Image Library (PIL)
#!/usr/local/bin/python
import math
import Image
# C64 color palette
COLOR_BLACK = (0, 0, 0)
COLOR_WHITE = (255, 255, 255)
COLOR_RED = (104, 55, 43)
@tomconte
tomconte / extractwazdashrss.sh
Created October 5, 2012 12:38
Extract Windows Azure Dashboard RSS Feed URLs
curl https://www.windowsazurestatus.com/windowsazure/support/status/servicedashboardcontent.aspx | grep RSSFeedCode | perl -ne '/href=\"(.+)\" target=/; print "https://www.windowsazurestatus.com/windowsazure/support/status/", $1, "\n";' | sort -u
@tomconte
tomconte / iftt_blink1.py
Created January 9, 2013 19:56
This is a very basic Python script that will let you poll ThingM's IFTT event service. You need to change the "IFTT key" in the URL, and use that same key in your IFTT blink(1) channel. I think any 16-character string will work but you should generate your own unique value, possibly including the blink(1) serial number (blink1-tool --list). The …
#!/usr/bin/python
import urllib2
import json
import time
import calendar
import subprocess
url = 'http://api.thingm.com/blink1/events/01234567DEADC0DE'
# Parameters
#$publishSettingFilePath = "C:\Users\tconte\Downloads\Hermes-Recette-11-21-2013-credentials.publishsettings"
$publishSettingFilePath = "C:\Users\tconte\Downloads\Windows Azure BizSpark 1111-JeromeSAS-4-19-2013-credentials.publishsettings"
#$subscriptionName = "Hermes-Recette"
$subscriptionName = "Windows Azure BizSpark 1111"
$outfiledisks="C:\dev\result_disks.txt"
$outfilefiles="C:\dev\results_files.txt"
$outfilenetworks="C:\dev\results_network.txt"
$outfileendpoints="C:\dev\results_endpoints.txt"
$outfilevms="C:\dev\results_vms.txt"
@tomconte
tomconte / GetWikiStats.ps1
Created July 9, 2014 06:43
Complete sample scripts for the article "Analyzing page view logs using Pig on Windows Azure HDInsight"
$wc=New-Object System.Net.WebClient
foreach ($i in 0..23) {
$n = "{0:D2}" -f $i
echo $n
$url = "http://dumps.wikimedia.org/other/pagecounts-raw/2013/2013-04/pagecounts-20130401-" + $n + "0000.gz"
$wc.DownloadFile($url, $url.SubString($url.LastIndexOf("/")+1))
}
@tomconte
tomconte / Vagrantfile
Created July 9, 2014 06:50
Vagrant configuration and bootstrap shell script to create a PHP development box on an Azure VM
Vagrant.configure('2') do |config|
config.vm.box = 'trusty64'
config.vm.provider :azure do |azure, override|
override.vm.box = 'azuredummybox'
override.ssh.username = 'tom' # assigned below
override.ssh.password = 'Pass123!' # assigned below
azure.mgmt_certificate = 'C:\Users\tconte\Dropbox\Dev\management_cert.pfx'
azure.mgmt_endpoint = 'https://management.core.windows.net'
@tomconte
tomconte / ams_client.ino
Last active September 4, 2017 17:54
This sample Arduino sketch uploads telemetry data to Azure Mobile Services
/*
** This sample Arduino sketch uploads telemetry data to Azure Mobile Services
** See the full article here: http://hypernephelist.com/2014/07/11/arduino-uno-azure-mobile-services.html
**
** Thomas Conté @tomconte
*/
#include <SPI.h>
#include <Ethernet.h>