Skip to content

Instantly share code, notes, and snippets.

View jcalonso's full-sized avatar

Juan Carlos Alonso jcalonso

View GitHub Profile
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active March 21, 2024 16:55
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@TheHippo
TheHippo / Makefile
Created March 31, 2016 22:32
Golang Makefile example
OUT := binariy-name
PKG := gitlab.com/group/project
VERSION := $(shell git describe --always --long --dirty)
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/)
all: run
server:
go build -i -v -o ${OUT} -ldflags="-X main.version=${VERSION}" ${PKG}
@xkr47
xkr47 / xkr-clipboard.pl
Created October 6, 2015 11:45
rxvt-unicode: Enable Ctrl-Insert/Ctrl-Shift-c to copy to CLIPBOARD (as opposed to PRIMARY) selection. Pasting works by Meta-<middle button>
#! perl
# Store this file as /usr/lib/urxvt/perl/xkr-clipboard
#
# To enable, add to ~/.Xresources:
#
# URxvt.perl-ext-common: default,xkr-clipboard
# URxvt.iso14755: false
# URxvt.keysym.Shift-Control-C: perl:clipboard:copy
# URxvt.keysym.Control-Insert: perl:clipboard:copy
<?php
/**
* @BeforeScenario
*/
public function captureConsoleLog() {
if (!($this->getSession()->getDriver() instanceof \Behat\Mink\Driver\Selenium2Driver)) {
// Not a Selenium driver (e.g. PhantomJs).
return;
}
@acolyer
acolyer / service-checklist.md
Last active January 30, 2024 17:39
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@zcourts
zcourts / install-zmq-on-osx.sh
Created May 7, 2014 11:39
Because the standard install doesn't always work!
cd /tmp
git clone git@github.com:zeromq/zeromq4-x.git
cd zeromq4-x
./autogen.sh
./configure
make
make install
@jameshfisher
jameshfisher / restore-file-from-package.sh
Created April 12, 2014 17:44
Restore a file from the package that provides it.
#!/bin/bash
# Usage:
#
# sudo ./restore-file-from-package.sh <filepath>
#
# Restore a file from the package that provides it.
#
# Source: http://askubuntu.com/a/67028/30482
@miguelmota
miguelmota / README.md
Last active March 16, 2024 12:52
Multiple accounts with Mutt E-Mail Client (gmail example)

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
@mremond
mremond / boxcar_push.php
Created February 6, 2014 11:36
Send a Boxcar notification to your device in PHP
<?php
curl_setopt_array(
$chpush = curl_init(),
array(
CURLOPT_URL => "https://new.boxcar.io/api/notifications",
CURLOPT_POSTFIELDS => array(
"user_credentials" => 'ACCESS_TOKEN',
"notification[title]" => 'message title',
"notification[long_message]" => '<b>Some text or HTML for the full layout page notification</b>',
@rothgar
rothgar / main.yml
Last active March 8, 2024 07:16
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']