Skip to content

Instantly share code, notes, and snippets.

View daryltucker's full-sized avatar

Daryl Tucker daryltucker

  • Neo-Retro Group
  • Salem, Or
View GitHub Profile
#!/bin/bash
#
# MongoDB Backup Script
# VER. 0.1
# Note, this is a lobotomized port of AutoMySQLBackup
# (http://sourceforge.net/projects/automysqlbackup/) for use with
# MongoDB.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@MicahElliott
MicahElliott / colortrans.py
Created November 29, 2010 07:57
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code
@rtuin
rtuin / HTML5 Skeleton template.html
Created March 25, 2011 22:06
HTML5 skeleton template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
@stevenhaddox
stevenhaddox / server_certificates_to_pem.md
Last active December 14, 2023 05:42
Convert .crt & .key files into .pem file for HTTParty

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hostname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hostname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample

@theirishpenguin
theirishpenguin / irssi-libnotify-plugin-ubuntu-installer.sh
Created October 11, 2012 13:46
irssi libnotify installer for ubuntu
#!/bin/bash
# This is a wrapped up version of the instructions at
# http://code.google.com/p/irssi-libnotify/wiki/MainPage for ubuntu
#
# Usage: Just run this script from the command line with no arguments
#
# Tested on Ubuntu 12.04.1 (64 bit)
echo ""
@ryankearney
ryankearney / ComcastInject.html
Last active June 10, 2023 14:40
This is the code Comcast is injecting into its users web traffic.
<script language="JavaScript" type="text/javascript">
// Comcast Cable Communications, LLC Proprietary. Copyright 2012.
// Intended use is to display browser notifications for critical and time sensitive alerts.
var SYS_URL='/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do';
// var image_url='http://servicealerts.comcast.net:8080/images/mt';
var image_url='http://xfinity.comcast.net/constantguard/BotAssistance/notice/images';
var headertext1='<strong>Comcast Courtesy Notice</strong>';
var textline1='You have reached 90% of your <b>monthly data usage allowance</b>.';
var textline2='Please sign in for more information and to remove this alert.';
var acknowledgebutton='<a href=\"#\" onClick="document.location.href=\''+SYS_URL+'?dispatch=redirect&redirectName=login&paramName=bmUid\'" title="Sign in to acknowledge" style="color: #FFFFFF;"><img alt="Sign in to acknowledge" src="'+image_url+'/mt_signin.png"/></a>';
@r35krag0th
r35krag0th / Get-TLS-Fingerprint.sh
Created November 30, 2012 02:10
Get Pandora TLS Fingerprint
#!/bin/bash
##
## A simple little shell script that will return the current
## fingerprint on the SSL certificate. It's crude but works :D
##
## Author: Bob Saska (r35krag0th) <git@r35.net>
openssl s_client -connect tuner.pandora.com:443 < /dev/null 2> /dev/null | \
openssl x509 -noout -fingerprint | tr -d ':' | cut -d'=' -f2
@npcardoso
npcardoso / force_resolution.sh
Last active August 30, 2018 20:59
This is a script that will change the resolution in Linux on a Macbook Pro Retina computer. Parts of this script were taken from https://gist.github.com/Garland-g/4552263
#!/bin/zsh
if [[ $# != 2 ]]; then
echo "Usage: Res.sh <device> <resolution_width>";
exit 1;
fi
DEV=$1
WIDTH=$(xrandr | grep $DEV -A1 | tail -n1 | sed 's/ *\([0-9]*\).*$/\1/')
HEIGHT=$(xrandr | grep $DEV -A1 | tail -n1 | sed 's/.*x\([0-9]*\).*$/\1/')
CURRENT_WIDTH=$(xrandr | grep $DEV | cut -d ' ' -f 3 | sed 's/ *\([0-9]*\).*$/\1/')
@codenamezjames
codenamezjames / floatdiv.js
Created June 12, 2014 20:18
add the class "magic-floating-stuff" to any bootstrap column and it will follow your screen when you pass it
$(function(){
var MFS = $('.magic-floating-stuff')
var ogScrollTop = $('body').offset().top,
ogElementOffset = MFS.offset().top,
ogDistance = (ogElementOffset - ogScrollTop);
MFSheight = MFS.outerHeight()
documentHeight = $(document).outerHeight()
$('body').change(function(){
MFSheight = MFS.outerHeight()