Skip to content

Instantly share code, notes, and snippets.

@jacksenechal
jacksenechal / ocr-script.sh
Last active March 23, 2024 20:16
Gnome simple-scan post processing script to run OCR with ocrmypdf
#!/bin/bash
# ocr-script.sh
#
# Useage: set this file as the post-processing script in the simple-scan preferences. No extra arguments needed.
#
# Requirements:
# - simple-scan
# - ocrmypdf
#
# For reference, at the time of writing the arguments from simple-scan are:
@jacksenechal
jacksenechal / p52-ubuntu-install-notes.md
Last active February 22, 2019 22:31
Installation Notes for Ubuntu 18.10 on Thinkpad P52

Installation Notes for Ubuntu 18.10 on Thinkpad P52

Update BIOS

DO NOT SKIP THIS STEP We have already bricked a few laptops by switching from hybrid to discreet graphics mode before updating the BIOS.

After this I switched to discreet mode for installation. I don't know if that was necessary.

Install Ubuntu

@jacksenechal
jacksenechal / README.md
Last active August 22, 2020 16:49
General-purpose browser orientation locking
@jacksenechal
jacksenechal / readscale.py
Last active January 24, 2019 16:51
Python script to read a USB scale in the Linux
#!/usr/bin/python
import os, time
import usb.core
import usb.util
import pygtk
pygtk.require('2.0')
import gtk
from sys import exit
import math
@jacksenechal
jacksenechal / backup-home
Created November 9, 2011 21:57
A simple backup script which makes daily and weekly backups of your home directory using rsync, and monthly backups using tar
#!/usr/bin/ruby
#
# Backup script by Jack Senechal
# configuration variables
@source = "/home/jack"
@destination = "/media/Elements/Backups"
@end_of_week = "Friday"
@rsync_command = "rsync -av --delete"
@tar_command = "tar -cjvf"
@jacksenechal
jacksenechal / scramble.js
Created February 21, 2011 09:07
JavsScript word scrambler
/* Called on document.ready */
$(function () {
$("body *").replaceText(/\b([A-z]{4,})\b/g, scramble_inner );
});
/* Scramble the inner characters of a word */
function scramble_inner(word) {
return word[0]
+ force_shuffle(word.slice(1, word.length - 1))
+ word[word.length - 1];
}
@jacksenechal
jacksenechal / encode-for-android
Created February 12, 2011 10:45
A simple script to encode video files for Android using the h264 codec. Requires ruby, grep, and ffmpeg.
#!/usr/bin/ruby
#
# Copyright (C) 2011 by Jack Senechal
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
CmdUtils.makeSearchCommand({
name: "Wolfram|Alpha",
synonyms: ["wolfram", "compute"],
icon: "http://www62.wolframalpha.com/favicon_calculate.png",
url: "http://www.wolframalpha.com/input/?i={QUERY}",
});