Skip to content

Instantly share code, notes, and snippets.

x2q x2q

Block or report user

Report or block x2q

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pagestamp.sh
#!/bin/bash
input="$1"
count=$2
blank=$((count - 1))
output="${1%.pdf}-header.pdf"
pagenum=$(pdftk "$input" dump_data | grep "NumberOfPages" | cut -d":" -f2)
(for i in $(seq "$blank"); do echo; done) | enscript -L1 -B --output - | ps2pdf - > /tmp/pa$$.pdf
(for i in $(seq "$pagenum"); do echo; done) | enscript -a ${count}- -L1 -F Helvetica@10 --header='||Page $% of $=' --output - | ps2pdf - > /tmp/pb$$.pdf
pdfjoin --paper letter --outfile /tmp/join$$.pdf /tmp/pa$$.pdf /tmp/pb$$.pdf &>/dev/null
cat /tmp/join$$.pdf | pdftk "$input" multistamp - output "$output"
View speech.sh
#!/bin/bash
#################################
# Speech Script by Dan Fountain #
# TalkToDanF@gmail.com #
#################################
INPUT=$*
STRINGNUM=0
ary=($INPUT)
echo "---------------------------"
echo "Speech Script by Dan Fountain"
View DR1-rtmp-rpi.strm
rtmp://flash0.11003-live0.dna.qbrick.com/11003-live4 playpath=livedr01astream3 live=1
View DR1-rtmp-rpi.strm
rtmp://flash0.11003-live0.dna.qbrick.com/11003-live4 playpath=livedr01astream3 live=1
View timezone.csv
country region timezone
AD Europe/Andorra
AE Asia/Dubai
AF Asia/Kabul
AG America/Antigua
AI America/Anguilla
AL Europe/Tirane
AM Asia/Yerevan
AN America/Curacao
AO Africa/Luanda
View csv2sqlite.py
#!/usr/bin/env python
# A simple Python script to convert csv files to sqlite (with type guessing)
#
# @author: Rufus Pollock
# Placed in the Public Domain
import csv
import sqlite3
import unicodedata
def strip_accents(s):
View linux-brprinter-installer-2.0.0-1.sh
#! /bin/bash
#
# Copyright(c) 2011-2013 Brother Industries, Ltd.
# All Rights Reserved.
#
#Brother retains any and all copyrights to the Software.
#In no case this Agreement shall be construed to assign
#or otherwise transfer from Brother to User any copyrights
#or other intellectual property rights to whole or any part
#of the Software.
View comp-test.sh
#! /bin/bash
NBLOOP=3
COMPRESS_OBJECT=db/
memstats()
{
(
renice 19 $$ >/dev/null 2>&1
while : ; do
ps --no-headers -o rss -C $1 || break
View securecode-test.rb
#!/usr/bin/env ruby -w
require 'net/http'
require 'net/https'
require 'openssl'
require 'uri'
DIR = File.dirname(__FILE__)
uri = URI.parse("https://test.directory.securecode.com:443/")
View scan-crop.sh
#!/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
You can’t perform that action at this time.