Skip to content

Instantly share code, notes, and snippets.

View ryanschwartz's full-sized avatar

Ryan Schwartz ryanschwartz

View GitHub Profile
@ryanschwartz
ryanschwartz / mysql-autosnapper.sh
Created November 6, 2015 15:52
wrapper for zfs snapshot + mysql_snapback.py, cribbed from http://letsgetdugg.com/2010/03/30/automated-zfs-snapshots/
#!/bin/bash
# sample crontab configuration
# # "frequent" snapshots, one every 15 minutes, keep 4
# 0,15,30,45 * * * * /opt/src/autosnapper.sh pool/home frequently 4
# # hourly snapshots, once an hour, keep 24 hours
# 0 * * * * /opt/src/autosnapper.sh pool/home hourly 24
# # daily snapshots, keep 7 days
# 0 0 * * * /opt/src/autosnapper.sh pool/home daily 7
# # weekly snapshots, keep 4 weeks
@ryanschwartz
ryanschwartz / mysql_snapback.py.diff
Created November 6, 2015 15:44
Diff of things I added to mysql_snapback (-q for silent running, -t for formatting time_snapshot)
--- datap02 2015-11-06 15:28:07.800529694 +0000
+++ mysql_snapback.py 2014-02-07 18:42:31.103289360 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/opt/local/bin/python
####################################################################
# FILENAME: mysql_snapback.py
# PROJECT: Miscellaneous Tools
@@ -51,10 +51,14 @@
@ryanschwartz
ryanschwartz / gist:a832d63f479c452e29db
Created November 2, 2015 15:43
openssl negotiation f5 vs f5-staging.vitalsource.com
Last login: Mon Nov 2 09:19:08 on ttys000
✓ ( 09:41:40 ) ⦿ ryan@juniper
▶︎ ~ ▶︎ echo | openssl s_client -connect f5.vitalsource.com:443
CONNECTED(00000003)
depth=1 /C=US/O=DigiCert Inc/CN=DigiCert SHA2 Secure Server CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/C=US/ST=California/L=San Mateo/O=Vital Source Technologies, Inc./CN=*.vitalsource.com
@ryanschwartz
ryanschwartz / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am ryanschwartz on github.
  • I am rts (https://keybase.io/rts) on keybase.
  • I have a public key whose fingerprint is C8B1 553F 0345 06CC EA97 A7F9 C156 785A FF25 B324

To claim this, I am signing this object:

@ryanschwartz
ryanschwartz / ruby 1.8.7 (system)
Last active August 29, 2015 14:02
PDFNetWrappers build attempt output
[lvdcvstmulappd01:/tmp/PDFNetWrappers/Build] root# ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
[lvdcvstmulappd01:/tmp/PDFNetWrappers/Build] root# cmake -D BUILD_PDFNetRuby:BOOL=ON ..
-- The CXX compiler identification is GNU 4.4.7
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found SWIG: /usr/bin/swig (found version "1.3.40")
-- Using SWIG 1.3.40
@ryanschwartz
ryanschwartz / -
Created May 23, 2013 02:21 — forked from anonymous/-
strano diff
diff --git a/Gemfile b/Gemfile
index 30c8aab..451aa31 100644
--- a/Gemfile
+++ b/Gemfile
@@ -12,6 +12,11 @@ group :assets do
gem 'uglifier', '>= 1.0.3'
end
+#uhhhhhhhhhhhhhhhhhhhhhhhhh...
+gem 'therubyracer', '=0.11.4'
@ryanschwartz
ryanschwartz / mount_usbkey_userfiles.sh
Created May 16, 2012 21:44
SMF script to allow global zone user/group modification
#!/usr/bin/bash
case "$1" in
'start')
if [[ -n $(/bin/bootparams | grep '^smartos=true') ]]; then
if [[ -z $(/usr/sbin/mount -p | grep 'passwd') ]]; then
if [[ /etc/passwd -ot /usbkey/passwd ]]; then
cp /usbkey/passwd /etc/passwd
else
cp /etc/passwd /usbkey/passwd
@ryanschwartz
ryanschwartz / compiler_patch
Created April 25, 2012 16:19
Joyent SmartMachine SMF manifest for hand-built nginx with --prefix=/opt/local/nginx
--- lib/phusion_passenger/platform_info/compiler.rb.orig 2012-04-25 16:23:34.773244791 +0000
+++ lib/phusion_passenger/platform_info/compiler.rb 2012-04-25 16:21:21.044674989 +0000
@@ -142,8 +142,8 @@
end
if RUBY_PLATFORM =~ /solaris/
- flags << '-pthreads'
- flags << '-D_XOPEN_SOURCE=500 -D_XPG4_2 -D__EXTENSIONS__ -D__SOLARIS__ -D_FILE_OFFSET_BITS=64'
+ flags << '-pthreads -std=c99'
+ flags << '-D_XOPEN_SOURCE=500 -D_XPG6 -D__EXTENSIONS__ -D__SOLARIS__ -D_FILE_OFFSET_BITS=64'
@ryanschwartz
ryanschwartz / gist:981514
Created May 19, 2011 19:25
Patch Mac OS X's tomcat catalina.sh to remove the pidfile if the PID is not running
--- catalina.sh.dist 2011-05-19 19:22:30.000000000 +0000
+++ catalina.sh 2011-05-19 19:22:45.000000000 +0000
@@ -311,8 +311,14 @@
if [ ! -z "$CATALINA_PID" ]; then
if [ -f "$CATALINA_PID" ]; then
- echo "PID file ($CATALINA_PID) found. Is Tomcat still running? Start aborted."
- exit 1
+ RUNNING=`ps aux|grep \`cat $CATALINA_PID\`|grep [java]|wc -l`
+ if [ $RUNNING -eq 1 ]; then