Skip to content

Instantly share code, notes, and snippets.

View ironpinguin's full-sized avatar

Michele Catalano ironpinguin

View GitHub Profile
@ironpinguin
ironpinguin / cleanup_docker_registry_after_gc.sh
Last active April 8, 2018 16:15
cleanup_docker_registry_after_gc
#!/bin/bash
REGISTRY_BASE_PATH="/var/lib/registry"
REGISTRY_DATA_PATH="${REGISTRY_BASE_PATH}/docker/registry/v2/"
for hashLinkFile in `ls ${REGISTRY_DATA_PATH}/repositories/*/_layers/*/*/link`; do
hashType=`cat $hashLinkFile | cut -d':' -f1`
hashValue=`cat $hashLinkFile | cut -d':' -f2`
blob="store/docker/registry/v2/blobs/${hashType}/${hashValue:0:2}/${hashValue}/data"
if [ ! -f $blob ]; then
@ironpinguin
ironpinguin / test_consol_color.sh
Created February 22, 2018 01:23
Test the console Colors
#!/usr/bin/env bash
fontColor=38
backgroundColor=48
colortable() {
base=$1
count=0
for colorCode in `seq -w 0 255`; do
count=$(($count + 1))
@ironpinguin
ironpinguin / test_consol_color.sh
Created February 22, 2018 01:23
Test the console Colors
#!/usr/bin/env bash
fontColor=38
backgroundColor=48
colortable() {
base=$1
count=0
for colorCode in `seq -w 0 255`; do
count=$(($count + 1))
/*
ESP8266 Blink by Simon Peter
Blink the blue LED on the ESP-01 module
This example code is in the public domain
The blue LED on the ESP-01 module is connected to GPIO1
(which is also the TXD pin; so we cannot use Serial.print() at the same time)
Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
*/
import jenkins.model.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import org.jenkinsci.plugins.plaincredentials.*
import org.jenkinsci.plugins.plaincredentials.impl.*
import hudson.util.Secret
import hudson.plugins.sshslaves.*
@ironpinguin
ironpinguin / build_lxc_boxes.sh
Last active February 2, 2016 15:44
build lxc boxes
#!/bin/bash
sudo aptitude install -y bzr mercurial git lxc
sudo add-apt-repository -y ppa:ubuntu-desktop/ubuntu-make
sudo apt-get update
sudo apt-get install -y ubuntu-make
echo -n "$HOME/.local/share/umake/go/go-lang" | umake go
source $HOME/.profile
echo 'GOPATH=$HOME/go' >> $HOME/.bashrc
@ironpinguin
ironpinguin / display_ip_info.sh
Created November 30, 2013 11:48
Script to Display the RaspberryPi IP Addresses on Startup in the LCD dogl-128 Display. (rpi-gpio + rpi-dog128). add in /etc/network/interfaces at the end: post_up /usr/local/bin/display_ip_info.sh
#!/bin/bash
socket=/var/lib/gpiod/socket
set_backlight="LCD BACKLIGHT 30\n"
lcd_clear="LCD CLEAR\n"
lcd_start=${set_backlight}${lcd_clear}
lcd_show="LCD SHOW\n"
pos_x=0
pos_y=0
lcd_text_pre="LCD TEXT 8 "
if_count=0
@ironpinguin
ironpinguin / FreeType2_Mono.c
Last active July 23, 2021 09:52
Simple example to use FreeType for get a monochrome text output rendering. build linux: gcc -g -o freeTypeDemo FreeType2_Mono.c -I/usr/include/freetype2 -L/usr/lib/x86_64-linux-gnu -lz -lfreetype -lm
/* First test with FreeType2 library */
/* Output to console of mono rendered font */
/*
* FreeType2_Mono.c
*
* Created by Michele Catalano <michele@catalano.de>.
*
* Copyright (c) 2013 Michele Catalano
* All rights reserved.
*
@ironpinguin
ironpinguin / client.php
Created September 8, 2012 12:31
Simple use of php_rsync (librsync implementation)
<?php
/**
* Simple client for librsync handshake.
*/
$opts = "s:f:n:p:";
$longOpts = array("signature:", "file:", "newfile:", "patch:");
class rsyncClient