Skip to content

Instantly share code, notes, and snippets.

Daniele Ricci daniele-athome

View GitHub Profile
@daniele-athome
daniele-athome / oneliner.sh
Created Feb 19, 2019
Sort mounts by used space
View oneliner.sh
df -h |head -1; df -h | tail +2 | sort -t " " -h -k 5
@daniele-athome
daniele-athome / RunningAverage.java
Created Jun 1, 2017
Stupid class to make a running average.
View RunningAverage.java
public class RunningAverage {
private float avg;
private long count;
public void add(long value) {
avg = ((avg * count) + value) / ++count;
}
public float get() {
@daniele-athome
daniele-athome / ConvertPEM.java
Created Jun 8, 2015
SSL: Error parsing certificate
View ConvertPEM.java
import java.io.*;
import java.security.cert.*;
import org.bouncycastle.openssl.*;
public class ConvertPEM {
public static void main(String[] args) throws Exception {
@daniele-athome
daniele-athome / convert-messages.py
Last active May 10, 2017
Convert a Kontalk legacy conversation to HTML
View convert-messages.py
#!/usr/bin/env python
# Convert a Kontalk legacy conversation to HTML
# Usage: ./convert-messages.py messages.db phone_number [display_name]
# HTML goes to standard output
import sys
import hashlib
import sqlite3
from datetime import datetime
You can’t perform that action at this time.