Skip to content

Instantly share code, notes, and snippets.

View kobaltz's full-sized avatar

David Kimura kobaltz

View GitHub Profile
@kobaltz
kobaltz / install
Created October 16, 2014 16:32
ElasticSearch Install
ElasticSearch for realtime searching. Make sure that it is installed as
described below.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.deb
mv elasticsearch-1.3.2.deb ~
sudo dpkg -i ~/elasticsearch-1.3.2.deb
sudo nano /etc/elasticsearch/elasticsearch.yml
@kobaltz
kobaltz / servo.rb
Created January 6, 2015 04:09
Raspberry Pi Model B+ - GPIO18 Servo Control with PWM
#! /usr/bin/ruby
# Servo Rotation
# Wiring:
# From +5V (PIN2) to Positive on Servo (Red)
# From Ground (PIN6) to Ground on Servo (Brown)
# From GPIO18 to 1kOhm Resistor to Signal on Servo (Orange)
# Requires Ruby (`sudo apt-get install ruby ruby1.9.1-dev`)
#!/usr/bin/env ruby
if ARGV.size != 2
puts "Usage: #{$0} <from_language> <to_language>"
exit -1
end
require 'rubygems'
require 'ya2yaml' # this gem is needed for this to work!
require 'yaml'
class PropertiesController < ApplicationController
include ActionController::Live
before_action :find_county
def index
response.headers["Content-Type"] ||= 'text/csv'
response.headers["Content-Disposition"] = "attachment; filename=#{@county.csv_file_name}"
response.stream.write Property::CSV_HEADERS.to_csv
# Install programs
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y python-virtualenv python-setuptools python-pip libxslt1-dev gcc
sudo apt-get install -y libffi-dev libjpeg-dev libxml2-dev libxslt-dev libyaml-dev python-dev
sudo apt-get install -y python-setuptools python-dev libxslt1-dev gcc libffi-dev libjpeg-dev
sudo apt-get install -y libxml2-dev libxslt-dev libyaml-dev libpq-dev postgresql
sudo apt-get install -y postgresql-server-dev-9.5 supervisor redis-server nginx htop
# Create a user to run Sentry
@kobaltz
kobaltz / convert.rb
Created January 7, 2018 03:51
Convert Audio from MP4 to Text
#!/usr/bin/env ruby
# Install some tools first
# brew install ffmpeg
# brew install lame
# brew install --HEAD watsonbox/cmu-sphinx/cmu-sphinxbase
# brew install --HEAD watsonbox/cmu-sphinx/cmu-pocketsphinx
# Place this file in the directory that you have files to convert.
# Make this file executable
@kobaltz
kobaltz / convert.rb
Last active November 2, 2018 23:39
Watson Speech to Text Conversion
#!/usr/bin/env ruby
require 'json'
require 'net/http'
require 'dotenv/load'
TYPE_OF_FILE_TO_CONVERT = '*.mp4'
# Sign up for an account and confirm your email
# https://console.bluemix.net/registration/
# in Rails Console
Gem.loaded_specs.each do |name, spec|
puts "#{name} - #{spec.license}"
end;
@kobaltz
kobaltz / micro-k8s-setup.md
Created March 7, 2019 01:42 — forked from joestringer/micro-k8s-setup.md
MicroK8s setup for Cilium

Set up microk8s with Cilium for development

Microk8s is a Canonical project to provide a kubernetes environment for local development, similar to minikube but without requiring a separate VM to manage. These instructions describe setting it up for common development use cases with Cilium and may be helpful in particular for testing BPF kernel extensions with Cilium.

Microk8s will run its own version of docker for the kubernetes runtime, so if you have an existing docker installation then this may be confusing, for instance when building images the image may be stored with one of these installations and not the other. This guide assumes you will run both docker daemon instances, and use your existing docker-ce for building Cilium while using the microk8s.docker daemon instance for the runtime of your kubernetes pods.

Requirements

def tick(_args)
initialize_game
display_hud
set_score
move_cubes
check_collision_with_mouse
end
def reset_game
args.state.cubes = [cube]