Skip to content

Instantly share code, notes, and snippets.

View chadcatlett's full-sized avatar

Chad Catlett chadcatlett

  • Somewhere in Texas
View GitHub Profile
$ file *
PORSCHE 996 TWIN TURBO INTERCOOLER INSTALLATION.pdf: PDF document, version 1.5
jpg_to_pdf.pdf: PDF document, version 1.3
test.pdf: PDF document, version 1.4
From 9a5a4343f378cf5dbd35f113e374a50db36560a4 Mon Sep 17 00:00:00 2001
From: Alex Samorukov <samm@os2.kiev.ua>
Date: Fri, 8 Aug 2014 14:41:44 +0200
Subject: [PATCH] Fix broken build on systems w/o system versioning support
---
Makefile.am | 2 ++
configure.ac | 13 +++++++++++++
2 files changed, 15 insertions(+)
[url "https://github.com/"]
insteadOf = git://github.com/
require 'formula'
class Weechat < Formula
homepage 'http://www.weechat.org'
url 'http://www.weechat.net/files/src/weechat-0.4.1.tar.bz2'
sha1 'a5185d6b8a2b330713ea354f06601a205270e3a2'
depends_on 'cmake' => :build
depends_on 'gnutls'
depends_on 'libgcrypt'
#!/usr/bin/env python
get_lenlist = lambda input_data: dict([(key,max([len(str(key))]+[len(str(i[key])) for i in input_data])) for key in input_data[0].keys()])
get_rowformat = lambda length_data: " | ".join('%%-%ss' % max_length for key, max_length in length_data.iteritems())
get_divider = lambda length_data: "-|-".join("-"*max_length for key, max_length in length_data.iteritems())
get_header = lambda length_data: get_rowformat(length_data) % tuple(length_data.keys())
records = [
{ 'name':'Billy Bob', 'Hobby': 'Guns'},
#!/bin/sh
dur=$1
if [ "$dur" = "" -o ! -e "$dur" ]; then
echo "no package supplied" 1>&2
exit 1
fi
leadsize=96
o=`expr $leadsize + 8`
set `od -j $o -N 8 -t u1 $dur`
il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
def disable_proxy(kick_token):
path = '/etc/sysconfig/rhn/up2date'
mode = 0600
tempfd, temp_path = mkstemp()
try:
new_file = open(temp_path, 'w')
old_file = open(path)
except (IOError, OSError) as err:
klog(kick_token, 'Problem disabling proxy for RHN <%s>.' % str(err))
return False
diff --git a/configure.yml b/configure.yml
index 3ee5669..7ade25e 100644
--- a/configure.yml
+++ b/configure.yml
@@ -1,4 +1,4 @@
-- hosts: 127.0.0.1
+- hosts: localhost
connection: local
gather_facts: False
roles:
# Usage: convert os_device
# Convert an OS device to the corresponding GRUB drive.
# This part is OS-specific.
convert () {
# First, check if the device file exists.
if test -e "$1"; then
:
else
echo "$1: Not found or not a block device." 1>&2
exit 1
@chadcatlett
chadcatlett / urldecode.jq
Created February 16, 2019 01:05
no idea where i found this
def urldecode:
def unhex:
if 48 <= . and . <= 57 then . - 48 elif 65 <= . and . <= 70 then . - 55 else . - 87 end;
def bytes:
def loop($i):
if $i >= length then empty else 16 * (.[$i+1] | unhex) + (.[$i+2] | unhex), loop($i+3) end;
[loop(0)];
def codepoints: