Skip to content

Instantly share code, notes, and snippets.

@justone
justone / circle-artifacts
Last active November 2, 2020 18:15
Script to grab artifacts for a given CircleCI project. Call like this: ./circle-artifacts github borkdude grasp linux
#!/usr/bin/env bb
(require '[babashka.curl :as curl])
(require '[cheshire.core :as json])
(def recent-build-count 40)
(defn recent-builds-url
[ci user project limit status]
(str "https://circleci.com/api/v1.1/project/" ci "/" user "/" project "?limit=" limit "&filter=" status))
@justone
justone / tmux-urls.clj
Last active November 2, 2020 18:16
Script to print out all the visible URLS in your tmux pane.
#!/usr/bin/env bb
(ns urls
(:require
[clojure.tools.cli :refer [parse-opts]]
[clojure.java.shell :as sh]
[clojure.string :as string]
))
(def cli-options

This logback configuration is an example of diverting debug level logs for a specific package to a separate file, while maintaining info level in the main log. This allows viewing all package logs in context, and then when an info or warn level log appears, you can switch to the debug log and see that line in context with debug statements.

This is particularly useful for debugging a new or troublesome package in production without cluttering up your main log stream.

The main appender is the primary appender to which all application logs are

@justone
justone / Dockerfile
Last active March 17, 2016 15:33
Docker Size and VirtualSize reported differently on v1.9 and v1.10
FROM alpine
LABEL FOO=Bar
@justone
justone / gatling.scala
Created November 17, 2015 20:41
Demo Gatling script
package cdb
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class BasicSimulation extends Simulation {
@justone
justone / dedupe.cljs
Last active September 4, 2015 13:12
Using planck to dedupe a weechat log file.
#!/usr/bin/env planck
(ns dedupe.core
(:require [planck.io :refer [read-line]]
[clojure.string :refer [split]]))
(defn line-seq
"Create a lazy sequence of stdin, from http://blog.fikesfarm.com/posts/2015-08-01-planck-scripting.html."
[]
(take-while identity
@justone
justone / Vagrantfile
Created November 11, 2013 17:29
Vagrant shell provisioner to set up cpanm/carton
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# change to whatever box you want
config.vm.box = "ubuntu1204"
@justone
justone / build_gitolite_deb.sh
Created August 1, 2012 23:47
gitolite v3 debian package
#!/bin/bash
# install rvm
aptitude install -y curl libz-dev
curl -L https://get.rvm.io | bash -s stable --ruby
source /usr/local/rvm/scripts/rvm
gem install fpm
# git clone
aptitude install -y git
@justone
justone / salt-master
Created July 30, 2012 20:47
saltstack on lenny
#!/bin/sh
#
# Salt master
###################################
# LSB header
### BEGIN INIT INFO
# Provides: salt-master
# Required-Start: $remote_fs $network
@justone
justone / oscon.com.js
Created July 18, 2012 18:41
dotjs for hacking the OSCON 2012 schedule
var highlighting_chosen_sessions = false;
var hidden = false;
function highlight_chosen_sessions() {
// look for all hightlighted icons and update the session div to have a border
$('img[src="/images/personal-schedule-icon2.png"]').each(function(index, icon) {
$(icon)
.closest('.session')
.not('.highlighted')
.addClass('highlighted')