Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View narkisr's full-sized avatar
⌨️
bashing keybindings

Ronen narkisr

⌨️
bashing keybindings
View GitHub Profile
@yuvadm
yuvadm / client.ovpn
Created June 7, 2012 19:47
OpenVPN Installation on Ubuntu 12.04
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
@terjesb
terjesb / gist:3898036
Created October 16, 2012 08:26 — forked from devn/gist:3866927
(use '[datomic.api :as d])
(def uri "datomic:free://localhost:4334/git")
(def conn (d/connect uri))
(def rules
'[[(node-files ?n ?f) [?n :node/object ?f] [?f :git/type :blob]]
[(node-files ?n ?f) [?n :node/object ?t] [?t :git/type :tree]
[?t :tree/nodes ?n2] (node-files ?n2 ?f)]
[(object-nodes ?o ?n) [?n :node/object ?o]]
[(object-nodes ?o ?n) [?n2 :node/object ?o] [?t :tree/nodes ?n2] (object-nodes ?t ?n)]
[(commit-files ?c ?f) [?c :commit/tree ?root] (node-files ?root ?f)]
@jalogisch
jalogisch / logstash_syslog_to_gelf
Created April 11, 2013 07:31
This Logstash Configuration takes Syslog Messages, add some additional Fields and Information to them and send them via GELF to graylog2-radio which put them into rabbitmq transport Inspiration from: http://cookbook.logstash.net/recipes/syslog-pri/ (but little modified to match my needs) http://blog.torch.sh/post/43651465177/introducing-graylog2…
input {
tcp {
port => 514
type => syslog
}
udp {
port => 514
type => syslog
}
}
@cromwellryan
cromwellryan / Guardfile
Last active December 19, 2015 08:19
Guardfile for elixirc
guard 'shell', :elixirc_bin => "/usr/local/elixirc" do
watch(/(.+\.ex$)/) { |m| `elixirc #{m[0]}` }
end
guard 'shell', :elixir_bin => "/usr/local/elixir" do
watch(/(.+\.exs$)/) { |m| `elixir #{m[0]}` }
end
@pdamoc
pdamoc / README.md
Last active March 26, 2016 18:11
Integrating ports with Elm Architecture

Instructions

  • compile the SendToPort.elm to elm.js
    elm-make SendToPort.elm --output elm.js
  • open SendToPort.html

Observations

@mpeven
mpeven / setup.sh
Last active July 21, 2017 07:34
Pi3 Hotspot Huawei-in WiFi-out
# This version:
# brings WiFi in from the Huawei adapter on eth1
# pushes WiFi out from the built in adapter on wlan0
# sets up an ip address on 192.168.5.2 to ssh into from another computer
##################################################
# Update
#
#sudo apt-get update
#sudo apt-get -qq upgrade
@ztellman
ztellman / foami.clj
Last active September 22, 2017 16:05 — forked from cgrand/foami.clj
(ns foami.core
"FOreign Asynchronous Mechanism Interop"
(:require [clojure.core.async :as async]))
(defn put!
"Takes a `ch`, a `msg`, a single arg function that when passed `true` enables backpressure
and when passed `false` disables it, and a no-arg function which, when invoked, closes the
upstream source."
[ch msg backpressure! close!]
(let [status (atom :sending]
@andrewhavck
andrewhavck / still-horsin.clj
Created December 11, 2013 05:38
async channels with udp
(ns udp-ping.core
(:require [clojure.core.async :refer [>! <! chan go close! thread]])
(:import (java.net DatagramPacket InetAddress MulticastSocket)))
(def port 10001)
(def group (InetAddress/getByName "224.1.0.0"))
(def buffer-size 1000)
(defprotocol Socket
(send! [this msg])
@philoskim
philoskim / cljs-ns.adoc
Last active May 4, 2018 08:49
How to get *ns* string in ClojureScript

How to get *ns* string in ClojureScript

It’s not so easy to get *ns* string in ClojureScript as you might expect but here is a tip.

It is impossible to get *ns* string at run-time in ClojureScript (except in self-hosted ClojureScript) but it can be accessed at compile-time only. So you have to use a macro to get it as the following example.

I came up with this idea in the course of implementing set-ns-blacklist! and set-ns-whitelist! (https://github.com/philoskim/debux#debux-config) in my debux library.

@nberger
nberger / gist:fc636d8c2712b38a39f5
Last active December 18, 2018 03:19
riemann - send email when there are more than 5 critical events every 30 seconds
; http://stackoverflow.com/questions/31269170/event-count-at-certain-time-interval-in-riemann
(let [email (mailer {:host "localhost"
:port 1025
:from "abc@gmail.com"})]
(streams
(where (and (service "system_log")
(description "IE")
(not (expired? event)))
; we are interested in the event count, so let's fix to :metric 1