Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Simple bash script to crop scanned receipts etc.
#
# Dependencies:
# sudo apt-get install unpaper poppler-utils netpbm imagemagick
echo "usage: scan-crop.sh filename.pdf"
pdftoppm -singlefile "$1" /tmp/scan-crop-tmp
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=44358b4f-884c-408a-904d-3d4944f8c746 / ext4 discard,noatime,nodiratime,commit=600,errors=remount-ro 0 1
/dev/mapper/cryptswap1 none swap sw 0 0
# tmpfs section
# encoding: utf-8
require 'rubygems'
require 'sequel'
require 'fileutils'
require 'yaml'
require 'nokogiri'
require 'open-uri'
# NOTE: This converter requires Sequel and the MySQL gems.
require 'rubygems'
require 'sequel'
require 'fileutils'
require 'yaml'
# NOTE: This converter requires Sequel and the MySQL gems.
# The MySQL gem can be difficult to install on OS X. Once you have MySQL
# installed, running the following commands should work:
# $ sudo gem install sequel
# $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
*PPD-Adobe: "4.3"
*%================================================
*% Copyright(C) 2006 Brother Industries, Ltd.
*% "Brother MFC7440N for CUPS"
*%================================================
*%==== General Information Keywords ========================
*FormatVersion: "4.3"
*FileVersion: "1.00"
*LanguageEncoding: ISOLatin1
#!/usr/bin/python
import gobject
import sys
import dbus
import dbus.service
import dbus.mainloop.glib
class Rejected(dbus.DBusException):
#!/bin/sh
# Script by Black God (http://www.karuppuswamy.com)
# This script uploads pictures to Picasa from current directory,
# or in the selected directory
base="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"
if [ -z "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
dir="$base"
else
while [ ! -z "$1" -a ! -d "$base/$1" ]; do shift; done
#!/bin/sh
# Recodes specified file to UTF-8, except if it seems to be UTF-8 already
result=`grep -c [åäöÅÄÖ] $1`
if [ "$result" -eq "0" ]
then
echo "Recoding $1 from ISO-8859-1 to UTF-8"
recode ISO-8859-1..UTF-8 $1 # overwrites file
else
echo "$1 was already UTF-8 (probably); skipping it"
@x2q
x2q / netradio.opml
Last active October 13, 2019 12:21
<?xml version="1.0" encoding="UTF-8" ?>
<opml version="1.1">
<head><title>Dansk Radio HD</title><ownerEmail>x2q@x2q.net</ownerEmail></head>
<body>
<outline text="DR Netradio">
<outline type="audio" text="DR P1" url="http://live-icy.gss.dr.dk/A/A03H.mp3.m3u" />
<outline type="audio" text="DR P2 Klassisk" url="http://live-icy.gss.dr.dk/A/A04H.mp3.m3u" />
<outline type="audio" text="DR P3" url="http://live-icy.gss.dr.dk/A/A05H.mp3.m3u" />
<outline type="audio" text="DR P4 Østjylland" url="http://live-icy.gss.dr.dk/A/A14H.mp3.m3u" />
<outline type="audio" text="DR P5" url="http://live-icy.gss.dr.dk/A/A25H.mp3.m3u" />
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
*
* */