Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kovacshuni's full-sized avatar

Hunor Kovács kovacshuni

View GitHub Profile
@kovacshuni
kovacshuni / gist:9466066
Created March 10, 2014 14:34
Ansible command ran directly
## So this is how i copied a file from src to dest through an Ansible command.
ansible -i poc gitlab-servers -m file -a "name=copying src=/home/git/gitlab/lib/support/logrotate/gitlab dest=/etc/logrotate./gitlab mode=0640 owner=root group=git"
server | success >> {
"changed": false,
"path": "copying",
"state": "absent"
}
@kovacshuni
kovacshuni / hs_err_pid9709.log
Created September 16, 2014 19:33
Can't set memory settings for `sbt start`
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 715849728 bytes for committing reserved memory.
# Possible reasons:
# The system is out of physical RAM or swap space
# In 32 bit mode, the process size limit was hit
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
@kovacshuni
kovacshuni / app.js
Created October 2, 2014 11:37
Joining promises
app.controller('SomeController', ['$http', function($http) {
var requestA = function () {
$http.post('http://incoming.example.com:9000/v1.0/oauth1/request-token', {})
.success(function(data) {
...
})
.error(function(data, status) {
...
});
@kovacshuni
kovacshuni / findbyuuid
Created September 28, 2015 11:11
Finding in mongoDB by BSON serialised uuid.
db.methode.find({"uuid": BinData(4,UUID("5b175a2e47d711e4a7d4002128161462").base64())})
@kovacshuni
kovacshuni / something
Last active December 19, 2015 10:19
Some modification.
bool Demarc::has(Port p) const throw() {
Mutex::Lock _l(_ports_m);
return (_ports.count(p));
}
@kovacshuni
kovacshuni / ft-video-monitoring.rb
Created July 22, 2013 08:13
Sanity check of video.ft.com
require 'net/http'
def fetch(uri_str, limit = 10)
raise ArgumentError, 'too many HTTP redirects' if limit == 0
response = Net::HTTP.get_response(URI(uri_str))
case response
when Net::HTTPSuccess then
response.body()[/<span class="video\-length">\s*(\d+:\d+ min)\s*<\/span>/]
when Net::HTTPRedirection then
location = response['location']
@kovacshuni
kovacshuni / generate-uuid.rb
Created July 22, 2013 08:45
Generating UUID
require "active_support"
p SecureRandom.uuid
@kovacshuni
kovacshuni / Ady Endre - Misztérium.txt
Created January 28, 2016 11:48
Ady Endre - Misztérium
Csak az a mély és szent igazság,
Amit magába rejt a lélek,
Idétlen semmi, játszi hívság,
Amit leírok, elbeszélek.
Rendelteték, hogy néhány ember.
Tépődjék, sírjon mindhiába
S hogy meg ne értsék... Néhány ember
Ezernyi éve így csinálja...
Rendelteték, hogy dalba sírja
Néhány szegény bolond a lelkét
@kovacshuni
kovacshuni / eventlimiter.go
Created February 18, 2016 14:26
event-limiter
type EventLimiter struct {
ticker time.Ticker
trigger chan bool
timePassed chan bool
}
func NewLimiter() *EventLimiter {
ticker := time.NewTicker(60 * time.Second)
trigger := make(chan bool, 1)
timePassed := make(chan bool, 1)
@kovacshuni
kovacshuni / article.json
Last active May 25, 2016 09:45
different-content-type-responses
{
"id": "http://www.ft.com/thing/0f432c22-2223-11e6-9d4d-c11776a5124d",
"type": "http://www.ft.com/ontology/content/Article",
"bodyXML": "<body><p>Greece’s international creditors have bought time to secure the country’s financial future after agreeing broad but inexact principles to ease its debt mountain and break an impasse between Germany and the <ft-content title=\"IMF urges eurozone to ease Greece’s debt pile with interest cap - FT.com\" type=\"http://www.ft.com/ontology/content/Article\" url=\"http://api.ft.com/content/2bf58684-2102-11e6-9d4d-c11776a5124d\">International Monetary Fund</ft-content>.</p>\n<p>After almost 11 hours of talks in Brussels, eurozone finance ministers and the IMF agreed to a range of measures to restructure <a href=\"http://www.ft.com/indepth/greece-debt-crisis\" title=\"Greece debt crisis in depth - FT.com\">Greece’s debts</a> when its €86bn bailout ends in 2018 — but put no figures on the concessions and left them subject to political decisions by eurozone countries. Mo