In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @BeforeScenario | |
*/ | |
public function captureConsoleLog() { | |
if (!($this->getSession()->getDriver() instanceof \Behat\Mink\Driver\Selenium2Driver)) { | |
// Not a Selenium driver (e.g. PhantomJs). | |
return; | |
} |
A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."
- Does the design expect failures to happen regularly and handle them gracefully?
- Have we kept things as simple as possible?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /tmp | |
git clone git@github.com:zeromq/zeromq4-x.git | |
cd zeromq4-x | |
./autogen.sh | |
./configure | |
make | |
make install | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
How to set up multiple accounts with Mutt E-mail Client
Thanks to this article by Christoph Berg
Directories and files
~/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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'] |