Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am rbrenton on github.
  • I am rbrenton (https://keybase.io/rbrenton) on keybase.
  • I have a public key whose fingerprint is 00D7 BF36 6F1F DC68 9573 91BB E014 94ED 0819 354B

To claim this, I am signing this object:

@rbrenton
rbrenton / gist:e780c1c5e69233efa46f
Created October 5, 2015 21:04
jQuery to enforce maxlength for textarea elements.
// jQuery to enforce maxlength for textarea elements.
(function(){
var check = function(e) {
var max = $(e).attr('maxlength');
if (e.value.length > max) {
e.value = e.value.substr(0, max);
}
};
$('body').on('keydown', 'textarea[maxlength]', function(){ check(this); });
@rbrenton
rbrenton / awslogs.service
Last active November 28, 2017 21:12
Systemd config for awslogs service.
[Unit]
Description=The CloudWatch Logs agent
After=rc-local.service
[Service]
Type=simple
Restart=always
KillMode=process
TimeoutSec=infinity
PIDFile=/var/awslogs/state/awslogs.pid
@rbrenton
rbrenton / fix_ubuntu16_awslogs.sh
Last active November 28, 2017 21:19
Fix issue on Amazon Ubuntu 16.04 instances where datetime errors are flooding awslog.log
#!/bin/bash
# Fix for Ubuntu 16.04
# Stop
if [ -e /etc/init.d/awslogs ]
then
/etc/init.d/awslogs stop
fi
# Update