Skip to content

Instantly share code, notes, and snippets.

@timfreund
timfreund / cjs.js
Created May 6, 2019
Capture youtube views
View cjs.js
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);
View 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
Star Trek NG inspired white noise script
View startrek.sh
#!/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 Jul 20, 2017
question about docker build --build-arg
View gist:8f1f370da1a6cb0aba9ff59b53cca2a4
# 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 Feb 21, 2017
openshift via docker on centos 7
View openshift-via-cloud-init.sh
#!/bin/bash
# install docker
yum install -y docker
systemctl enable docker
systemctl start docker
# download openshift image
docker pull openshift/origin:v1.4.1
View cjs-www.youtube.com
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"];
View keybase.md

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:

View docker-compose.yml
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
View docker-compose.yml
elasticsearch:
image: elasticsearch
ports:
- "9200:9200"
- "9300:9300"
grafana:
image: grafana/grafana
environment:
GF_SECURITY_ADMIN_PASSWORD: secret
ports:
View gist:9d5a08c1bba14c873d6c
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',