Skip to content

Instantly share code, notes, and snippets.

/* Controllers */
angular.module('dotApp').controller('dotMarkController', ['$scope', 'api', '$routeParams', function ($scope, api, $routeParams) {
$scope.refreshEntries = function(){
api.getDotMarksEntries().success(function (data) {
var elems = new Array();
var etags = new Array();
_.each(data._items, function(item){
elems.push(item);
_.each(item.tags, function(tag) {
@ipedrazas
ipedrazas / gist:4543e8204027ca048650
Last active August 29, 2015 14:01
Eve Patch Validation
-> % curl -H "If-Match: 8c000ac14c61d1810a49418ca8c2147a5310f923" -X PATCH
-d 'views=2' http://dotmarks.dev:5000/dotmarks/5373ae41f3c4d5154270e265
{"_status": "ERR", "_issues": {"views": "must be of integer type"}}
@ipedrazas
ipedrazas / gist:6d6c31144636d586dcc3
Last active July 10, 2023 16:24
Nginx ssl config

The process starts by creating the CSR and the private key:

openssl req -nodes -newkey rsa:2048 -nodes -keyout dotmarks.net.key -out dotmarks.net.csr -subj "/C=GB/ST=London/L=London/O=dotmarks/OU=IT/CN=dotmarks.net"

Generates

  • dotmarks.net.key
  • dotmarks.net.csr
@ipedrazas
ipedrazas / gist:82f2b3fbb87b6c9f8f0e
Created June 3, 2014 22:27
Set Wacom Linux with Dual Monitor
xsetwacom set "Wacom BambooPT 2FG Small Pen stylus" MapToOutput HDMI1
@ipedrazas
ipedrazas / gist:be069cdf333ee65eef3a
Created June 4, 2014 10:26
Creating a Self-Signed SSL Certificate
$ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
...
$ openssl rsa -passin pass:x -in server.pass.key -out server.key
writing RSA key
$ rm server.pass.key
$ openssl req -new -key server.key -out server.csr
...
Country Name (2 letter code) [AU]:UK
State or Province Name (full name) [Some-State]:London
...
@ipedrazas
ipedrazas / gist:b6ee6244b51ba7e75b50
Last active March 28, 2019 04:16
Docker without sudo
sudo groupadd docker
sudo gpasswd -a ${USERNAME} docker
sudo chmod o+rw /var/run/docker.sock
sudo service docker restart
<div class="calculator center">
<form class="form-horizontal" role="form">
<div class="form-group">
<div class="col-xs-6 col-sm-4">
</div>
<div class="col-xs-6 col-sm-4 xrate">
<h1>Megamine Btc-Satoshi Calculator</h1>
</div>
<div class="col-xs-6 col-sm-4">
</div>
@ipedrazas
ipedrazas / gist:3d2786874692e90db3ca
Last active March 28, 2019 04:17
EalsticSearch multiple aggregations example - Term count and Average
GET _search
{
"query" : {
"match" : { "PostCode" : "PO18*"}
},
"aggs" : {
"Food_hygiene_ratings" : {
"terms" : {
"field" : "RatingValue"
@ipedrazas
ipedrazas / gist:3cf8eb6ae8e77c7c97a5
Created August 22, 2014 21:15
IRSSI: IGNORE JOINS, PARTS, QUITS AND NICKS MESSAGES
/ignore -channels #channel * JOINS PARTS QUITS NICKS
@ipedrazas
ipedrazas / gist:4ae3b909af660402bcf1
Created August 27, 2014 00:05
MongoDump with Docker
#!/bin/bash
set -e
export LC_ALL=C
TS=$( date --utc '+%Y-%m-%dT%H:%M:%SZ' )
BACKUP_DIR="/data/backup/${TS}"
docker run -it --rm --link mongodb:mongodb -v /data/mongodb:/data dockerfile/mongodb bash -c 'mongodump --out '${BACKUP_DIR}' --host $MONGODB_PORT_27017_TCP_ADDR'