Skip to content

Instantly share code, notes, and snippets.

@eloycoto
eloycoto / consul.service
Last active August 29, 2015 14:26 — forked from yunano/consul.service
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d

Exposing your clipboard over SSH

I frequently administer remote servers over SSH, and need to copy data to my clipboard. If the text I want to copy all fits on one screen, then I simply select it with my mouse and press CMD-C, which asks relies on m y terminal emulator (xterm2) to throw it to the clipboard.

This isn't practical for larger texts, like when I want to copy the whole contents of a file.

If I had been editing large-file.txt locally, I could easily copy its contents by using the pbcopy command:

@eloycoto
eloycoto / 0_reuse_code.js
Last active August 29, 2015 14:06
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.33.10"
@eloycoto
eloycoto / registrar.js
Created February 21, 2012 17:42 — forked from mheadd/registrar.js
A simple SIP registrar that uses Node.js and Redis
var sip = require('sip');
var sys = require('sys');
var redis = require('redis');
//Trim leading and trailing whitespace from string values.
function trim(str) {
return str.replace(/^\s+|\s+$/g, '');
}
sip.start({},function(request) {