Skip to content

Instantly share code, notes, and snippets.

View bblanchon's full-sized avatar
🌟
No more counting dollars we’ll be counting stars

Benoît Blanchon bblanchon

🌟
No more counting dollars we’ll be counting stars
View GitHub Profile
@bblanchon
bblanchon / VisualStudio for Python 2.7.reg
Created February 17, 2015 14:23
VisualStudio for Python 2.7, also work with distutils
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VC]
"ProductDir"="C:\\Users\\azuretools\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0"
@bblanchon
bblanchon / upgrade-teamcity.sh
Created March 16, 2015 10:45
Automatically upgrade TeamCity server
#!/usr/bin/bash
set -eu
trap "tput sgr0" 0
echo -n "Enter new TeamCity version: "
read VERSION
FILE=TeamCity-$VERSION.tar.gz
@bblanchon
bblanchon / update-ghost
Created April 14, 2015 20:20
Automatically upgrade Ghost
#
# Automatically upgrade Ghost
# Benoit Blanchon 2014-2015 - MIT License
set -eu
GHOST_DIR=/var/www/blog.benoitblanchon.fr
function ghost_version {
@bblanchon
bblanchon / grep-lib
Created April 15, 2015 12:54
Check for symbol presence in a lib file
nm -U -j lib<mylib>.a | grep <myfunc> | c++filt
@bblanchon
bblanchon / delete-vm-status.ps1
Created July 1, 2015 12:43
Azure delete VM status blobs
Get-AzureStorageBlob -Container vhds | Where { $_.Name -like "*.status"} | Remove-AzureStorageBlob
@bblanchon
bblanchon / JsonParserReference.ino
Created August 20, 2015 13:55
Reference program for JSON parser's size
void setup() {
Serial.begin(9600);
char json[] =
"{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}";
const char* sensor = "gps";
long time = 1351824120;
double latitude = 48.756080;
double longitude = 2.302038;
@bblanchon
bblanchon / JsonGeneratorReference.ino
Created August 20, 2015 14:03
Reference program for JSON generator's size
void setup() {
Serial.begin(9600);
Serial.println("{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}");
Serial.println("{\n \"sensor\": \"gps\",\n \"time\":1351824120,\n \"data\": [\n 48.756080,\n 2.302038\n ]\n}");
}
void loop() {
// not used in this example
@bblanchon
bblanchon / checksums.sh
Last active September 18, 2015 15:19
Compute checksums of files in each folder recursivlty
find $(pwd) -type d | while read DIR
do
cd $DIR
FILES=$(find -maxdepth 1 -type f -not -name '*SUMS' -printf '"%f"\n' | sort)
FILE_COUNT=$(echo $FILES | wc -c)
if [ -z "$FILES" ]
then
rm -f *SUMS
else
echo $FILES | xargs md5sum > MD5SUMS
@bblanchon
bblanchon / Azure_RemoveAllVms.ps1
Created September 2, 2015 10:07
Azure: delete all VMs of a subscription
Add-AzureAccount
Select-AzureSubscription -SubscriptionName "Continuous Integration"
Get-AzureVM | Remove-AzureVM -DeleteVHD -Verbose
@bblanchon
bblanchon / Azure_CaptureVm.ps1
Created September 2, 2015 15:03
Azure: Capture a VM
$ErrorActionPreference = "Stop"
Add-AzureAccount
Select-AzureSubscription -Name "Continuous Integration"
Write-Host 'The following VM instances are available:'
Get-AzureVM | foreach { $_.Name }
$vmName = Read-Host 'Enter the name of the VM to capture'
Write-Host 'The following VM images are available:'