Skip to content

Instantly share code, notes, and snippets.

@r0mdau
r0mdau / HFS.md
Last active October 20, 2024 15:31
How to recover pictures and files from failed MacOS / HFS+ hard drive with Linux

How to recover pictures and files from failed MacOS / HFS+ hard drive with Linux

A couple months ago, a friend ask me to repair a failing macintosh.

It appears the hard drive has multiple failures from SMART anlysis.

Next reboot... Oh crap, the operating system does not start anymore. The drive contains 10 years of pictures to recover. A heart pinch :'(

Important thing to know, if (certainely) the disk is crypted and you don't know the principal user login password,

@samthor
samthor / safari-nomodule.js
Last active February 14, 2024 02:54
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:
@attilavago
attilavago / puck_pp_presenter-v2.js
Last active April 4, 2020 12:18
PowerPoint presenter using a Puck.js beacon's button only!
var kb = require("ble_hid_keyboard");
NRF.setServices(undefined, { hid : kb.report });
var reset_timer;
var next = "n";
var prev = "p";
function sendPrev(){
sendCharPrev();
LED2.set();
@oesterle
oesterle / puck_pp_presenter.js
Last active September 5, 2019 12:39 — forked from attilavago/puck_pp_presenter.js
PowerPoint presenter using a Puck.js beacon's button and magnetic sensor.
var kb = require("ble_hid_keyboard");
var next = "n";
var prev = "p";
var magIsOn = false;
var magTimeoutID = null;
#!/usr/bin/env python
"""
Converts Internet Explorer 'capture network traffic' XML to a HAR file.
Turns out that XML is just a HAR file anyways, but in XML form. So this
just converts it to JSON, and Bob's your uncle.
Requires Python 2.7+ and LXML.
"""
from __future__ import unicode_literals
var app = require('app');
var dockMenu = [
{ label: 'New Window', click: () => newWindow() },
{ label: 'New Private Window', click: () => newWindow({isPrivate:true}) },
];
app.dock.setMenu(dockMenu);
var BrowserWindow = require('browser-window');
@bhavanki
bhavanki / master-protect-pre-push
Created March 10, 2015 21:09
Protects origin/master from your screwed-up pushes
#!/bin/bash
protected_branch='master'
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
remote_name=$1
if [[ $remote_name != "origin" ]]; then
exit 0
fi
@alanb1501
alanb1501 / starwars.sh
Last active April 9, 2016 13:34
Reads a random starwars quote in each voice available via the `say` command. (OS X only)
#!/usr/bin/env bash
for voice in $(say -v ? | perl -pe 's/^(.*?)\s.*$/$1/'); do quote=$(curl -s http://www.iheartquotes.com/api/v1/random?source=starwars | perl -pe 's/\[starwars.*?$//g'); echo $voice; say -v $voice $quote; done
var app = {};
app.createUser = function(user, password) {
crypton.generateAccount(user, password, function (err, account){
if (err) { console.error(err); return;}
console.log(account);
})
};
app.auth = function (username, password) {
@nuxlli
nuxlli / deb2tcz.sh
Last active January 3, 2022 11:55
Convert debian package to tce/tcz package
#!/bin/bash
# Create tce/tcz from Debian package
# Usage: $ scriptname packagename.deb packaganame.tce
# Depends: squashfs-tools, findutils, binutils
# References:
# - http://forum.tinycorelinux.net/index.php/topic,2325.msg12127.html
# - http://pastebin.com/ed5KSPsH
TMP1="`mktemp -d /tmp/tce.1.XXXXXX`"
TMP2="$TMP1"/pkg