Skip to content

Instantly share code, notes, and snippets.

View russianryebread's full-sized avatar

Ryan Hoshor russianryebread

View GitHub Profile
@russianryebread
russianryebread / diskCheck.sh
Created December 26, 2012 17:25
Check the status of a ZFS pool and mail the admin it if it's not ok.
#!/bin/bash
# Emails the status of a FreeNAS ZFS RAID Array to the Admin.
ADMIN="admin@example.com"
POOL="ZFS_POOL_NAME"
STATE=`zpool status $POOL | grep 'state:' | awk '{ print $2 }'`
if [ "$STATE" = "ONLINE" ]; then
exit 0
@russianryebread
russianryebread / Speeds.sh
Created August 9, 2013 18:45
CCWIS ZFS RAID Speeds
[root@storage] /mnt/CCWIS# /usr/bin/time -h dd if=/dev/zero of=speedtestfile bs=1024 count=30000000
30720000000 bytes transferred in 295.915848 secs (103813298 bytes/sec [99.00 MB/s])
[root@storage] /mnt/CCWIS# /usr/bin/time -h dd if=speedtestfile of=/dev/zero bs=1024 count=30000000
30720000000 bytes transferred in 115.172637 secs (266730021 bytes/sec [254.37 MB/s])
# Array Read Speed: 254.37 MB/s
# Array Write Speed: 99.00 MB/s
<!-- Support for Twitter's New API -->
<div id="comments">
<a class="twitter-timeline" width="100%" height="300" href="https://twitter.com/search?q=<?php echo urlencode($post_link) ?>" data-widget-id="NEW_TWITTER_WIDGET_ID" data-chrome="transparent noborders">Comments:</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>

Compiling/Installing Node 0.10.24 (and Python 2.6, required by Node) on CentOS 5

Update system packages -- will migrate system forward to CentOS 5.10. (Optional?)

$ sudo yum update

Install the EPEL Repo:

@russianryebread
russianryebread / index.html
Last active August 29, 2015 14:04
Bootstrap Basic Template (CDN URLs & Local Paths)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
@russianryebread
russianryebread / gist:398490f3326429023a4d
Last active August 29, 2015 14:09 — forked from anonymous/gist:67659f5c5734a7dd14dc
Uninstalling Firefox installs Thunderbird?
user@lubuntubox:~$ sudo apt-get remove firefox
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
thunderbird <----------------------- WHAT????
Suggested packages:
thunderbird-gnome-support ttf-lyx
The following packages will be REMOVED:
firefox
@russianryebread
russianryebread / passgen.html
Created December 15, 2014 16:01
Random Password Generator
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Generate Secure Password</title>
<script type="text/javascript">
var specials = '!@$%^&*()_+{}:<>?\|[];,./~';
var lowercase = 'abcdefghijklmnopqrstuvwxyz';
var uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var numbers = '0123456789';
@russianryebread
russianryebread / UITableViewDelegate.m
Last active August 29, 2015 14:17
Default UITableView Delegate Methods
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 0;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete method implementation.
@russianryebread
russianryebread / FSScrollController.cs
Last active June 25, 2023 04:27
Inertial Scrolling for Unity 3D
using UnityEngine;
using System.Collections;
using Holoville.HOTween;
namespace FS.Handlers
{
public class FSScrollController : MonoBehaviour {
public float contentOverflowY = 0f;
public float contentHeight = 0f;
@russianryebread
russianryebread / getQueryVariable.js
Last active August 29, 2015 14:17
Parses the URL Query String in Javascript
function getQueryVariable(qvar) {
var query = window.location.search.substring(1);
var vars = query.split("&");
var len = vars.length;
for (var i=0;i<len;i++) {
var kv = vars[i].split("=");
if(kv[0] == qvar){return kv[1];}
}
return(false);
}