Skip to content

Instantly share code, notes, and snippets.

View amedranogil's full-sized avatar

Alejandro Medrano amedranogil

View GitHub Profile
#!/bin/bash
#install everything needed
sudo apt install testdisk fdupes id3ren id3convert libid3-tools exiftool convmv
sudo dd if=/dev/disk of=/somefile.dd bs=512 conv=noerror,sync
#use Photorec to recover files from the disk
sudo photorec /dev/disk #or /somefile.dd
@amedranogil
amedranogil / springer-free-maths-books.md
Created December 29, 2015 17:57 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@amedranogil
amedranogil / UTF8toJavaCode
Created July 3, 2014 21:30
transform Raw UTF8 input from a file to a Java escaped string.
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
/**
* @author amedrano
*