This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Case | |
# -------- | |
# You have solely SSH (port 22) access to a box on a remote LAN. | |
# You have no Admin access to the firewall to forward ports. | |
# You need to browse the website on the box via a Web browser. | |
# From your local, desktop machine: | |
sudo ssh -NL 80:localhost:80 root@<IP or hostname> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste these 7 lines into Chrome JS console. | |
var script = document.createElement("script"); | |
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"); | |
script.addEventListener('load', function() { | |
var script = document.createElement("script"); | |
document.body.appendChild(script); | |
}, false); | |
document.body.appendChild(script); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Changelog Generator | |
# Right now, this is date-based. | |
# TODO: Changelog between two Tags, eg: --tags=1.0.0..1.0.1 | |
from_date = ARGV[0] | |
cmd = `git log --no-merges --since='#{from_date}' --pretty='format:%ci::%an <%ae>::%s'`.split /\n/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Author: Russ Brooks, TelVue Corporation (www.telvue.com) | |
# Description: Migrates GitHub Issues to Pivotal Tracker. | |
# Dependencies: Ruby 1.9.2+ | |
# GitHub API gem: https://github.com/peter-murach/github | |
# Pivtal Tracker gem: https://github.com/jsmestad/pivotal-tracker | |
# 1. Change the constants below accordingly for your project. | |
# 2. Change the options in list_repo() method for your GitHub project. | |
# 3. Change the options in stories.create() method accordingly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# tc uses the following units when passed as a parameter. | |
# kbps: Kilobytes per second | |
# mbps: Megabytes per second | |
# kbit: Kilobits per second | |
# mbit: Megabits per second | |
# bps: Bytes per second | |
# Amounts of data can be specified in: | |
# kb or k: Kilobytes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Don't use FFmpeg for metadata extraction. Use FFprobe. | |
# Its output is geared toward parsabilty. | |
# Container and stream information in JSON format: | |
ffprobe -show_format -print_format json 'Serenity - HD Trailer.mp4' | |
ffprobe -show_streams -print_format json 'Serenity - HD Trailer.mp4' | |
# Human-readable values: | |
ffprobe -show_format -pretty -print_format json 'Serenity - HD Trailer.mp4' | |
# Trim video to first 30 seconds, without transcoding. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Do the Find first, as a trial run. | |
find . -type d \( ! -iname "7604e960-3fc9-012f-2342-52540002105a" ! -iname "760660a0-3fc9-012f-2342-52540002105a" ! -iname "cac012a0-46b5-012f-1584-52540002105a" ! -iname "981fc740-8bf0-012f-2d2b-52540002105a" ! -iname "e268a4d0-95f6-012f-c815-52540002105a" \) | |
# Then do the actual delete. | |
find . -type d \( ! -iname "7604e960-3fc9-012f-2342-52540002105a" ! -iname "760660a0-3fc9-012f-2342-52540002105a" ! -iname "cac012a0-46b5-012f-1584-52540002105a" ! -iname "981fc740-8bf0-012f-2d2b-52540002105a" ! -iname "e268a4d0-95f6-012f-c815-52540002105a" ! -iname "a6e42e40-66fc-012f-f998-525400977599" \) -execdir rm -rfv {} + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -qr dir dir2 | grep -v -e '.DS_Store' -e '.git' -e '.log' | sort > diffs.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Match from beginning of line to last occurrence of slash (/). Great for parsing filename off full paths. | |
# ^.*/(?!.*/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 4:3 | |
1.333.to_r.rationalize(Rational('0.001')) | |
# => (4/3) | |
# 16:9 | |
1.778.to_r.rationalize(Rational('0.001')) | |
# => (16/9) | |
# Common PAR: | |
1.212.to_r.rationalize(Rational('0.001')) |
OlderNewer