Skip to content

Instantly share code, notes, and snippets.

View kmulvey's full-sized avatar

Kevin Mulvey kmulvey

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kmulvey on github.
  • I am kmulvey (https://keybase.io/kmulvey) on keybase.
  • I have a public key ASAvM54EYV8SZ1cWqopt1ZMzJaZX6EkMLy1xSDuzNpvLcQo

To claim this, I am signing this object:

@kmulvey
kmulvey / rhel-install.sh
Last active March 4, 2016 22:06
run your own tmate server on RHEL
dnf update -y
dnf install -y git automake libevent libevent-devel ncurses ncurses-devel msgpack msgpack-devel libssh libssh-devel
dnf groupinstall -y "Development Tools"
git clone https://github.com/tmate-io/tmate-slave.git && cd tmate-slave
mkdir -p keys
ssh-keygen -b 4096 -t rsa -f "keys/ssh_host_rsa_key" -N '' -E md5
ssh-keygen -b 256 -t ecdsa -f "keys/ssh_host_ecdsa_key" -N '' -E md5
./autogen.sh && ./configure && make
./tmate-slave -k keys -p 2222
@kmulvey
kmulvey / upgrade_kernel.sh
Created May 26, 2015 18:21
upgrade kernel
git checkout master
git pull
cat `/bin/ls -t /boot/config-* | head -n1` > .config
yes "" | make oldconfig
make -j`grep processor /proc/cpuinfo | wc -l`
sudo cp arch/`uname -p`/boot/bzImage "/boot/vmlinuz-"`make kernelrelease`
sudo make modules_install
sudo cp System.map "/boot/System.map-"`make kernelrelease`
sudo dracut "" `make kernelrelease`
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
read -s MESSAGE
echo $MESSAGE | gpg -e -r D4457E3A -o `date +"%Y-%m-%d-%H-%M-%S"`.gpg
Date Open High Low Close Volume Adj Close
2014-02-03 178.97 179.39 174.84 175.17 38748500 174.39
2014-02-04 175.96 176.86 175.35 176.37 5725900 175.59
2014-02-05 175.79 176.59 174.72 176.14 4705500 175.36
2014-02-06 176.61 178.51 176.61 178.49 5247300 177.70
2014-02-07 179.37 180.92 178.78 180.82 5945300 180.02
2014-02-10 180.75 181.12 180.27 181.07 4264300 180.27
2014-02-11 181.25 183.51 181.13 183.07 4634400 182.26
2014-02-12 183.31 183.90 182.79 183.22 5400900 182.41
2014-02-13 181.91 184.28 181.91 184.11 5104600 183.29
{"js":{"beaker.js":[{"date":1396392961000,"size":2631},{"date":1396393174000,"size":2653},{"date":1396393220000,"size":2679},{"date":1396393255000,"size":2674},{"date":1396393284000,"size":2691},{"date":1396393284000,"size":2691},{"date":1396393284000,"size":2691},{"date":1396393390000,"size":2649},{"date":1396393528000,"size":2654},{"date":1396393583000,"size":2659},{"date":1396393747000,"size":2686},{"date":1396393827000,"size":2744},{"date":1396393862000,"size":2745},{"date":1396393962000,"size":2737},{"date":1396394002000,"size":2781},{"date":1396394033000,"size":2791},{"date":1396394058000,"size":2683},{"date":1396394105000,"size":2724},{"date":1396394384000,"size":2706},{"date":1396394523000,"size":2751},{"date":1396394523000,"size":2751}],".beaker.js.swp":[{"date":1396393176000,"size":12288},{"date":1396393225000,"size":12288},{"date":1396393259000,"size":12288},{"date":1396393288000,"size":12288},{"date":1396393408000,"size":12288},{"date":1396393532000,"size":12288},{"date":1396393607000,"size":12288
@kmulvey
kmulvey / even_fib.java
Created January 26, 2013 17:33
By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
public class EvenFibs {
public static void main(String[] args) {
int term1 = 0, term2 =1, i =0, result=0;
while (term1 <= 4000000) {
i = term1;
term1=term2;
term2 += i;
if (term2%2 == 0) {
result += term2;
@kmulvey
kmulvey / even_fib.js
Last active December 11, 2015 18:38
By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
var term1 = 0, term2 =1, i =0, result=0;
while (term1 <= 4000000) {
i = term1;
term1=term2;
term2 += i;
if (term2%2 === 0) {
result += term2;
}
}
@kmulvey
kmulvey / 35.js
Created January 26, 2013 02:00
Find the sum of all the multiples of 3 or 5 below 1000.
// Find the sum of all the multiples of 3 or 5 below 1000.
var result = 0;
for(var i=0; i<1000; i++){
if(i%3 === 0 || i%5 === 0){
result += i;
}
}
console.log(result);
@kmulvey
kmulvey / stochastic_raw.js
Last active December 11, 2015 00:08
get raw calc'd data out of technicals
// stochastic
var tech = new Rickshaw.Technicals.FStochastic();
var period = new Array();
period['%d'] = 3;
period['%k'] = 14;
var data = tech.calc({
datum: graph.series[0].data,
period: period
});
console.log(JSON.stringify(graph.series[0].data));