Skip to content

Instantly share code, notes, and snippets.

@kizzx2
kizzx2 / 03-rabbitmq-input.conf
Last active May 27, 2017 16:32
A docker-compose set up that has nginx -> ELK through RabbitMQ
input {
rabbitmq {
host => "rabbitmq"
exchange => "logstash"
exchange_type => "direct"
key => "logstash"
durable => true
}
}
# Server sending file
server$ socat -u FILE:test.dat TCP-LISTEN:9876,reuseaddr
client$ socat -u TCP:127.0.0.1:9876 OPEN:out.dat,creat
# Server receiving file
server$ socat -u TCP-LISTEN:9876,reuseaddr OPEN:out.txt,creat && cat out.txt
client$ socat -u FILE:test.txt TCP:127.0.0.1:9876
@kizzx2
kizzx2 / hammerspoon-move-resize.lua
Last active December 19, 2022 06:47
Hammerspoon script to move/resize window under cursor
-- Inspired by Linux alt-drag or Better Touch Tools move/resize functionality
function get_window_under_mouse()
-- Invoke `hs.application` because `hs.window.orderedWindows()` doesn't do it
-- and breaks itself
local _ = hs.application
local my_pos = hs.geometry.new(hs.mouse.getAbsolutePosition())
local my_screen = hs.mouse.getCurrentScreen()
@kizzx2
kizzx2 / start-ss.sh
Last active July 17, 2018 10:35
Simple script to start Shadowsocks + GFWList and configures OS X system preferences to use it
#!/bin/sh
# Simple script to start Shadowsocks + GFWList and configures
# OS X system preferences to use it
if [[ $(id -u) -ne 0 ]]
then
sudo sh $0
exit
fi
@kizzx2
kizzx2 / package.json
Created June 30, 2015 18:35
Simple node-http-proxy with HTTPS
{
"name": "node-https-proxy",
"version": "1.0.0",
"description": "",
"main": "auth.js",
"scripts": {
"start": "node_modules/LiveScript/bin/lsc server.ls"
},
"dependencies": {
"LiveScript": "^1.3.1",

Keybase proof

I hereby claim:

  • I am kizzx2 on github.
  • I am kizzx2 (https://keybase.io/kizzx2) on keybase.
  • I have a public key whose fingerprint is C0CD 8083 90F9 F949 183D 9341 B81F 73A5 E3FD 582F

To claim this, I am signing this object:

@kizzx2
kizzx2 / test.rb
Created May 10, 2014 05:09
Run single test with Spring in Rails 4.1
require 'optparse'
$: << Rails.root.join('test')
options = {}
OptionParser.new do |opts|
opts.on('-n TEST_NAME') do |n|
options[:test_name] = n
end
opts.on('-e ENVIRONMENT') do |e|
apply plugin: 'java'
repositories {
mavenCentral()
}
configurations {
apt
}
@kizzx2
kizzx2 / build.gradle
Last active August 29, 2015 13:56
Using Gradle to handle dependencies for (Ant based) Android projects
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
// Define your dependencies here
compile 'com.google.guava:guava:16.0.1'
}
require 'mongoid'
require 'minitest'
require 'minitest/autorun'
class Foo
include Mongoid::Document
field :x, type: Integer
field :y, type: Integer
end