Skip to content

Instantly share code, notes, and snippets.

@timfreund
timfreund / cjs.js
Created May 6, 2019 18:25
Capture youtube views
function reportview(){
var length = $('.ytp-progress-bar')[0].getAttribute('aria-valuemax');
var title = $('h1.title')[0].innerText;
var payload = {};
payload['length'] = length;
payload['title'] = title;
jQuery.get("http://localhost:8000/youtube", payload);
}
setTimeout(reportview, 10000);
@timfreund
timfreund / labterm-demo.py
Created March 5, 2019 02:55
labterm-demo.py
import tornado.web
from tornado.ioloop import IOLoop
from terminado import TermSocket, SingleTermManager, UniqueTermManager
if __name__ == '__main__':
# term_manager = SingleTermManager(shell_command=['bash'])
term_manager = UniqueTermManager(shell_command=['/bin/login'])
handlers = [
(r"/websocket", TermSocket, {'term_manager': term_manager}),
(r"/()", tornado.web.StaticFileHandler, {'path':'index.html'}),
@timfreund
timfreund / startrek.sh
Created May 3, 2018 16:40
Star Trek NG inspired white noise script
#!/usr/bin/env bash
play -c2 -n synth whitenoise band -n 100 24 band -n 300 100 gain +20 flanger
@timfreund
timfreund / gist:8f1f370da1a6cb0aba9ff59b53cca2a4
Created July 20, 2017 20:00
question about docker build --build-arg
# Just used default remote package mirrors
docker history 58733688722f
IMAGE CREATED CREATED BY SIZE COMMENT
58733688722f About a minute ago /bin/sh -c git clone https://github.com/fu... 1.06GB
19b893454708 7 minutes ago /bin/sh -c apt-get update && apt-get upgra... 118MB
c30daf46b0f9 16 hours ago /bin/sh -c #(nop) MAINTAINER "Tim Freund"... 0B
3bcf97f6f832 4 weeks ago /bin/sh -c #(nop) CMD ["bash"] 0B
<missing> 4 weeks ago /bin/sh -c #(nop) ADD file:ede5a88363e3848... 79.2MB
# Set a ENV http_proxy line, saved 2 minutes on the build, but that proxy setting persists
@timfreund
timfreund / openshift-via-cloud-init.sh
Created February 21, 2017 01:55
openshift via docker on centos 7
#!/bin/bash
# install docker
yum install -y docker
systemctl enable docker
systemctl start docker
# download openshift image
docker pull openshift/origin:v1.4.1
function findForDisabling(searchTerm){
$(searchTerm).each(disableDisplay);
}
function disableDisplay(index, element){
element.style.display = 'none';
}
window.setInterval(function(){
var searches = ["#feed", ".watch-sidebar", "#watch-discussion", ".feed-item-container"];

Keybase proof

I hereby claim:

  • I am timfreund on github.
  • I am timfreund (https://keybase.io/timfreund) on keybase.
  • I have a public key ASAFntwXUE0GBkwyDuo79EXvuHwANi-vDdJJpr0r8EB5NQo

To claim this, I am signing this object:

beat:
build: .
command: ./manage.py celery beat -l DEBUG
links:
- rabbitmq
volumes:
- .:/usr/src/app
web:
build: .
command: ./manage.py runserver 0.0.0.0:8000
elasticsearch:
image: elasticsearch
ports:
- "9200:9200"
- "9300:9300"
grafana:
image: grafana/grafana
environment:
GF_SECURITY_ADMIN_PASSWORD: secret
ports:
class { 'ceph':
fsid => generate('/usr/bin/uuidgen'),
mon_host => $::ipaddress_eth0,
authentication_type => 'none',
}
ceph::mon { 'a':
public_addr => $::ipaddress_eth0,
osd_pool_default_size => 1,
authentication_type => 'none',