Skip to content

Instantly share code, notes, and snippets.

@jclement
jclement / rotate.sh
Created April 1, 2014 15:30
Really quick script to remove all but latest 60 backups with a given prefix from Tarsnap. Assumes archives have common prefix and a sortable suffix.
#!/bin/sh
for f in `tarsnap --list-archives | grep "^ARCHIVE_PREFIX_HERE_" | sort -r | tail -n+60`
do
echo "Removing $f"
tarsnap -d -f $f
done
@jclement
jclement / login_yubikey.c
Last active August 29, 2015 14:00
Updated "login_yubikey.c" for OpenBSD that adds /var/db/yubi/$user.pin with additional user pin/password that must be entered with Yubikey token.
/* $OpenBSD: login_yubikey.c,v 1.8 2013/11/27 21:25:25 deraadt Exp $ */
/*
* Copyright (c) 2010 Daniel Hartmeier <daniel@benzedrine.cx>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*

Keybase proof

I hereby claim:

  • I am jclement on github.
  • I am jsc (https://keybase.io/jsc) on keybase.
  • I have a public key whose fingerprint is 756B 89B5 9420 424C 5027 1924 120C 8032 A55D 0402

To claim this, I am signing this object:

var express = require('express');
var router = express.Router();
var redis = require('redis').createClient();
var twilio = require('twilio');
/* GET home page. */
router.get('/', function(req, res) {
res.render('index', { title: 'Express' });
});
@jclement
jclement / blink.js
Created July 17, 2014 16:37
Blink(1) when there are outstanding RTDs

Keybase proof

I hereby claim:

  • I am jclement on github.
  • I am jsc (https://keybase.io/jsc) on keybase.
  • I have a public key whose fingerprint is 382A B517 8749 3ACD 7DFA CD6F 44EA FEE7 C51B 2CA8

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am jclement on github.
* I am jsc (https://keybase.io/jsc) on keybase.
* I have a public key whose fingerprint is 6B42 6A57 875A E6A7 C910 EF91 4378 F71A B4EA 336E
To claim this, I am signing this object:
@jclement
jclement / gist:8caf5bfe1fb9df95994f
Created September 17, 2015 21:58
Find files older than 30 days show details and sort by size
find /home/sftp -type f -mtime +30 -exec ls -s {} \; | sort -n -r
@jclement
jclement / gist:2352144
Created April 10, 2012 15:30
Tinkering with Serializers
[DataContract]
public class Contact
{
public Contact()
{
Children = new List<string>();
Other = new Dictionary<string, int>();
}
public Contact(int id, string name, string description)
@jclement
jclement / program.cs
Created July 17, 2012 21:49
Sample API Call
using System;
using System.ServiceModel;
using ConsoleApplication6.TestApi;
namespace ConsoleApplication6
{
class Program
{
static void Main(string[] args)
{