Skip to content

Instantly share code, notes, and snippets.

@jordansissel
jordansissel / main.go
Created November 21, 2019 17:35
go-elasticsearch w/ setting custom trusted CA certs and custom headers
package main
import (
"encoding/base64"
"crypto/x509"
"fmt"
"github.com/elastic/go-elasticsearch/v8"
"io/ioutil"
"log"
"net/http"
@jordansissel
jordansissel / Why JRuby.md
Created May 18, 2011 16:38
logstash, why jruby?

Long story, short: I'm totally open to supporting more rubies if possible. Details follow.

Related issue: http://code.google.com/p/logstash/issues/detail?id=37

Summary:

  • core and stdlib ruby changes violently and without notice and without backwards compatibility. I want nothing of that.
  • need a cross-ruby date library that isn't part of stdlib (see previous point) and is also good.
  • need an easy way to use multiple cpus that is cross-ruby (threads are not it)
@jordansissel
jordansissel / tutorial.md
Created May 15, 2011 21:23
Understanding Ruby's &:foo shortcut

Example usage of the '&:foo' syntax

# You can do this:
p ["hello", "world"].collect(&:upcase)

Output:

["HELLO", "WORLD"]

What just happeend? What does '&:upcase' mean?

@jordansissel
jordansissel / keyboardcapture.go
Created September 26, 2017 05:08 — forked from obonyojimmy/keyboardcapture.go
go lang keyboard capture
package main
import (
"fmt"
"syscall"
//~ "time"
"unsafe"
"golang.org/x/sys/windows"
)
@jordansissel
jordansissel / zoom.md
Last active March 16, 2023 00:48
Zoom on Linux notes

In a zoom?

xdotool search --name "Zoom Meeting ID:"

This will exit non-zero if no meeting matching this name is found. "Zoom Meeting ID:"

This window exists regardless of sharing or not sharing, in my tests.

@jordansissel
jordansissel / README.md
Created July 6, 2011 05:04
Sorting windows in tmux by hostname.

For this to work, it requires my tmux fork that includes what I use as the hostname in the window list.

At any rate, it'll sort my tmux sessions alphabetically by the host I'm using.

my tmux fork: https://github.com/jordansissel/tmux

Starts with:

(0) -    nightfall: zsh - /home/jls/projects/tmux/trunk                                                            

(1) carrera: screen -x irc

@jordansissel
jordansissel / main.js
Created December 9, 2022 08:01
Napster URL conversion to Sonos UPnP -- Using node-songs to play music.
const { DeviceDiscovery } = require('sonos');
DeviceDiscovery((device) => {
//console.log('found device at ' + device.host + " - " + device.friendlyName)
device.deviceDescription().then(descr => {
// look for a sonos named "Sonos Roam"
if (descr.friendlyName.match(/Sonos Roam/)) {
console.log(descr);
// Coheed - Vaxis II - first track
@jordansissel
jordansissel / README.md
Created December 13, 2011 21:16
logstash internal messaging and queues

Logstash internals (Queues and Threading)

The logstash agent is 3 parts: inputs -> filters -> outputs.

Each '->' is an internal messaging system. It is implemented with a 'SizedQueue' in Ruby. SizedQueue allows a bounded maximum of items in the queue such that any writes to the queue will block if the queue is full at maximum capacity.

Logstash sets the queue size to 20. This means only 20 events can be pending into the next phase - this helps reduce any data loss and in general avoids logstash trying to act as a data storage system. These internal queues are not for storing messages long-term.

In reverse, here's what happens with a queue fills.

@jordansissel
jordansissel / Better Usage.md
Created December 20, 2010 12:07
Strip package scripts from .deb packages (postinst, postrm, preinst, prerm)

The best way to use this tool is to hook apt's use of dpkg to run it before doing any package installs.

In your apt.conf, put this:

DPkg::Pre-Install-Pkgs {"xargs -rL1 bash /path/to/stripdeb.sh 2>&1 | logger -t stripdeb"}

Then, a demo:

% sudo apt-get install mysql-server-5.1

@jordansissel
jordansissel / Procfile
Created April 5, 2012 19:29
Jenkins on Heroku
# Only listen on http; disable ajp and https
web: java -jar jenkins.war --httpPort=$PORT --ajp13Port=-1 --httpsPort=-1