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 / 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 / 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 / submodule2subtree
Created December 29, 2014 10:58
Git: converts a submodule to a subtree
#!/bin/bash
# Converts a submodule to a subtree
PREFIX=$1
set -euv
mkdir -p "/tmp/$PREFIX"
cp -R "$PREFIX" "/tmp/$PREFIX"
git rm $PREFIX
@bblanchon
bblanchon / manifest.json
Created September 14, 2014 10:12
syncfusion-ebook-links
{
"manifest_version": 2,
"name": "Syncfusion e-book links",
"description": "Replace DOWNLOAD buttons by convenient links",
"version": "1.0",
"content_scripts": [ {
"js": [ "jquery-1.11.1.min.js", "script.js" ],
"matches": [ "https://www.syncfusion.com/resources/techportal/ebooks" ]
} ]
@bblanchon
bblanchon / avr-nm.bat
Created July 8, 2014 11:58
avr-nm the you can associate with .elf files
"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-nm" --size-sort -C -r %1
pause
@bblanchon
bblanchon / ArduinoJsonTypesSize.ino
Last active August 29, 2015 14:03
Size of types of the Arduino JSON library
#include <ArduinoJson.h>
using namespace ArduinoJson;
#define PRINT_VALUE(X) {Serial.print(#X" =\t");Serial.println(X);}
#define PRINT_SIZE(X) {Serial.print("sizeof("#X") =\t");Serial.println(sizeof(X));}
void setup()
{
Serial.begin(9600);
@bblanchon
bblanchon / ArduinoJson2.ino
Last active August 29, 2015 14:03
Comparison of JSON encoding libraries for Arduino
#include <JsonGenerator.h>
using namespace ArduinoJson::Generator;
void setup()
{
Serial.begin(9600);
char sensor[] = "outdoor";
float value = 25.6;
@bblanchon
bblanchon / ArduinoJson2.ino
Last active January 4, 2020 15:36
Comparision of JSON parsing libraries for Arduino
#include <JsonParser.h>
using namespace ArduinoJson::Parser;
char json[] = "{\"sensor\":\"outdoor\",\"value\":25.6}";
void setup()
{
Serial.begin(9600);
Serial.println(json);
@bblanchon
bblanchon / git-stats.sh
Last active August 29, 2015 14:03
GIT: build a CSV with the number of file vs time
#!/bin/bash
OUTPUT=stats.csv
[ -f $OUTPUT ] || echo "date;sln;proj;cs;cpp" > $OUTPUT
count() {
git ls-tree -r --name-only $COMMIT | grep -e $1 | wc -l | sed 's/ //g'
}
@bblanchon
bblanchon / logrotate ghost
Last active August 29, 2015 14:01
logrotate configuration for Ghost service
# /etc/logrotate.d/ghost
/var/log/ghost.log {
rotate 12
monthly
compress
prerotate
service ghost stop
endscript
postrotate