Skip to content

Instantly share code, notes, and snippets.

View amar-sanakal's full-sized avatar

Amar Sanakal amar-sanakal

  • Sanakal Systems Ltd.
  • UK
View GitHub Profile
@amar-sanakal
amar-sanakal / mergepdfs.py
Last active August 29, 2015 14:21
Merge multiple PDF files into one file
import os
import sys
from PyPDF2 import PdfFileReader, PdfFileMerger
files_dir = os.path.expanduser("~/pdf")
if not os.path.isdir(files_dir):
print("ERROR: input directory {} does not exist\n".format(files_dir))
sys.exit(1)
pdf_files = [f for f in os.listdir(files_dir) if f.endswith("pdf")]
@amar-sanakal
amar-sanakal / unstash.rb
Last active August 29, 2015 13:58
ruby version of the script to 'decode ibm stash file's - http://goo.gl/6wbXzI
#!/bin/env ruby
abort("usage: #{$0} stash_file\nuse to descrypt IBM HTTP server stash files") if (ARGV.length < 1)
password = ''
File.open(ARGV[0], 'r') do |fh|
password = fh.read(1024)
end
decoded = password.unpack("C*").map {|c| c^0xf5}