Skip to content

Instantly share code, notes, and snippets.

View jcalonso's full-sized avatar

Juan Carlos Alonso jcalonso

View GitHub Profile
@h4cc
h4cc / rsyslog_openvz_fix.sh
Created November 5, 2013 21:54
Using rsyslog on OpenVZ like Proxmox can lead to a problem, which symtoms are mostly >= 100% CPU usage of rsyslogd. Error message is "Cannot read proc file system: 1 - Operation not permitted.", because the file /proc/kmsg could not be read.
sed -i -e 's/^\$ModLoad imklog/#\$ModLoad imklog/g' /etc/rsyslog.conf
service rsyslog restart
# Source: https://github.com/devananda/openvz-tools/blob/master/install-openvz-kernel.sh
@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>',
@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
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@XenGi
XenGi / 99-displaymagic.rules
Last active September 18, 2021 02:11
display magic
#/etc/udev/rules.d/99-displaymagic.rules
# enable LVDS on HDMI disconnect
SUBSYSTEM=="drm", ACTION=="change", RUN+="/usr/local/bin/displaymagic.sh"
@elidupuis
elidupuis / handlebars-helpers.js
Last active December 7, 2021 02:24
Simple Handlebars.js helpers
/*! ******************************
Handlebars helpers
*******************************/
// debug helper
// usage: {{debug}} or {{debug someValue}}
// from: @commondream (http://thinkvitamin.com/code/handlebars-js-part-3-tips-and-tricks/)
Handlebars.registerHelper("debug", function(optionalValue) {
console.log("Current Context");
console.log("====================");
@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
@rishiloyola
rishiloyola / gist:79f869749bf54d135f7f6fe61e0e99a7
Last active February 21, 2022 14:21
[ELK Stack] Generate TLS certs for filebeat and logstash
1. Generate new domain name for logstash server.
For this tutorial
domain name = logstash-prod.xyz.com
ip = 1.2.3.4
* Enter to following directory
```
$ sudo mkdir /etc/pki
$ cd /etc/pki
@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}
@johnstcn
johnstcn / ethminer_ubuntu_nvidia.md
Last active October 1, 2022 16:34
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04

Headless Ethminer (nVidia) Setup Guide

Cian Johnston, July 2017

WARNING: THESE WORDS ARE OLD AND MAY NOT WORK FOR YOU IN THESE NEW AND INTERESTING TIMES.

A couple of weeks ago, I decided I should put my gaming rig to work crypto mining. I did not expect to make any significant profit on this, it was more of a fun project to set up. However, there were a large number of tutorials and guides already out there, and many were more than a year out of date.

This guide assumes the reader already has a crypto wallet set up, is comfortable with Linux and the command line, and knows how to use Google if they run into problems.

The end result is an Ubuntu 16.04 LTS headless server running CUDA ethminer via systemd.