Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Luigi Di Fraia luigidifraia

🎯
Focusing
Block or report user

Report or block luigidifraia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View copy-kube-config.sh
#!/bin/bash
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
echo "export KUBECONFIG=\$HOME/.kube/config" >> ~/.bashrc
export KUBECONFIG=$HOME/.kube/config
@luigidifraia
luigidifraia / update-detached-head-submodules.sh
Last active Nov 2, 2019
Update git submodules that are detached from HEAD (tracking a specific commit)
View update-detached-head-submodules.sh
#!/bin/bash
# From: https://stackoverflow.com/a/49997119
git submodule update
git submodule foreach git checkout master
git submodule foreach git pull origin master
@luigidifraia
luigidifraia / datacube-get-started.sh
Last active Sep 16, 2019
Bash script to get started with Catapult's Data Cube JupyterHub platform
View datacube-get-started.sh
#!/bin/bash
cd
mkdir satapps
cd satapps
git init
git remote add -f origin https://github.com/luigidifraia/jupyterhub-platform-tutorials.git
git config core.sparseCheckout true
echo "datacube/examples" >> .git/info/sparse-checkout
git pull --depth=1 origin master
@luigidifraia
luigidifraia / docker-microk8s-ubuntu-18.md
Last active Jul 8, 2019
Some useful snippets to install Docker and microk8s on Ubuntu 18.04 LTS (Bionic Beaver)
View docker-microk8s-ubuntu-18.md

Base upgrade of Ubuntu 18

sudo apt-get update
sudo apt-get upgrade -y

Docker CE installation

@luigidifraia
luigidifraia / i2c-to-serial-bridge.ino
Last active Jul 8, 2019
Arduino sketch for bridging the I2C and USB serial interfaces
View i2c-to-serial-bridge.ino
/*
* Title: I2C <-> USB serial bridge
* Board: Arduino Pro-Micro (ATMega32U4)
* Author: Luigi Di Fraia
*
* Note: This example is provided as a guideline only, without any warranty!
*/
#include <Wire.h>
@luigidifraia
luigidifraia / tcrep2html.pl
Created Oct 6, 2018
Convert TAPClean's text report to HTML
View tcrep2html.pl
#!/usr/bin/env perl
use strict;
use File::Basename;
my $tag_closed = ">";
my $tag_bold = "<b>";
my $tag_bold_closed = "</b>";
my $tag_font = "<font class=";
my $tag_font_closed = "</font>";
@luigidifraia
luigidifraia / append-boot-name-to-tap-files.sh
Last active Jun 18, 2019
Rename TAP files to include the name of the first CBM ROM file therein
View append-boot-name-to-tap-files.sh
#!/bin/bash
# Pre: make sure you have the find-rom-name binary available in your PATH
# binaries available @ https://www.luigidifraia.com/software/#Filename_extractors
for filename in *.TAP; do
echo -n "Parsing $filename: "
cbm_name=$(find-rom-name "$filename" | grep "^FOUND:" | awk '{ print $2 }' | sed -e "s/\"//g")
if [ ! -z $cbm_name ]; then
mv "${filename}" "${filename%.*}_${cbm_name}.${filename##*.}"
You can’t perform that action at this time.