Skip to content

Instantly share code, notes, and snippets.

View kalyco's full-sized avatar

Kayla Comalli kalyco

  • 6 River Systems
  • Boston, MA
View GitHub Profile
@kalyco
kalyco / send() method rails
Last active August 29, 2015 14:24
short example of send() method in rails
class Car
def start
puts "vroom"
end
private
def engine_temp
puts "Just Right"
@kalyco
kalyco / kvm_install.md
Last active December 2, 2016 14:54
installing kvm

Virtualization: Installing KVM

When setting up your network, you may find yourself continuously asking "Why?".
"Why?", you will ask, "am I not monopolizing the modern CPU virtualization technology of Intel and AMD processors, known as Intel-VT and AMD-V?".

It is a question many of us face at some point in our lives, as commonplace as "Did I add that 2nd dryer sheet to the laundry?" or, "Where does the evolutionary progression of mankind stand in relation to the macrocosm?"

The good news is that setting up a virtual machine is much simpler than you think! That's because this "modern" technology has actually been around for over a decade, there are just many out there who have not yet de-hermitted from their physical realm. And that's ok too.

A Kernel-based Virtual Machine, hereafter KVM is the infrastructure used to turn a Linux kernel into a hypervisor, also called a VMM (Virtual Machine Manager), to manage it.

@kalyco
kalyco / kvm-setup.md
Last active December 20, 2016 19:50
setting up a kvm

Virtualization: Switching from OpenVZ to KVM

KVM stands for Kernel-based Virtual Machine. It is the infrastructure used to turn a Linux kernel into a hypervisor, also called a VNM (virtual machine monitor). Think of the main computer as a host machine, and each virtual instance running on it as a guest machine.

Because KVM is already part of the Linux kernel, is doesn't require additional software installations, so is not as complicated as other hypervisors can be.

KVM also executes full virtualization, as opposed to a virtualizor like OpenVZ in this case, where the host's kernel is shared with guest containers inside it.

Now we you have some background let's get started with the moving process:

@kalyco
kalyco / gist:675db74fa51af7f3a43443fe024ddbe5
Last active August 15, 2017 16:09
Boto3.Session.get_available_services()
# Instantiate an instance first, else Error: missing 1 required positional argument: 'self'
['acm', 'apigateway', 'application-autoscaling', 'appstream', 'athena', 'autoscaling', 'batch',
'budgets', 'clouddirectory', 'cloudformation', 'cloudfront', 'cloudhsm', 'cloudsearch', 'cloudsearchdomain',
'cloudtrail', 'cloudwatch', 'codebuild', 'codecommit', 'codedeploy', 'codepipeline', 'codestar',
'cognito-identity', 'cognito-idp', 'cognito-sync', 'config', 'cur', 'datapipeline', 'dax', 'devicefarm',
'directconnect', 'discovery', 'dms', 'ds', 'dynamodb', 'dynamodbstreams', 'ec2', 'ecr', 'ecs', 'efs', 'elasticache',
'elasticbeanstalk', 'elastictranscoder', 'elb', 'elbv2', 'emr', 'es', 'events', 'firehose', 'gamelift', 'glacier',
'greengrass', 'health', 'iam', 'importexport', 'inspector', 'iot', 'iot-data', 'kinesis', 'kinesisanalytics',
'kms', 'lambda', 'lex-models', 'lex-runtime', 'lightsail', 'logs', 'machinelearning', 'marketplace-entitlement',
'marketplacecommerceanalytics', 'meteringmarketplace', 'mturk', '
@kalyco
kalyco / gist:f314f968c66f6f4eb613713ca92acf77
Last active February 5, 2018 22:11
Loopback 2 --> 3 Guide

Loopback 2.x --> 3.0

1. Package-Lock.json:

Change "loopback-datasource-juggler" to "strong-error-handler": “^1.0.1”,

npm install

@kalyco
kalyco / palindrome.cpp
Created July 6, 2018 21:59
Check if the linked list is a palindrome
// Linked List Question
// Check if the linked list is a palindrome
// set a node variable starting with mhead.
// Iterate through first half of LL
// append elements to a string
// if after first half, starting with last elem in array,
// compare to the first node. if != return false
// inc n each time.
@kalyco
kalyco / linked_list_cycle
Created July 10, 2018 20:27
Write an algorithm to detect a cycle in a linked list
// Assume a linked list object with mHead, and mTail LLNodes, and mSize for size of list
// If there is a cycle, the linked list would never break out of a while loop.
// So if it exceeds the length of the list, we know there's a cycle somewhere
bool isCycle() {
if(mHead == NULL) return false;
node * n = mHead;
int lSize = mSize;
while(true) {
@kalyco
kalyco / rescursive_exponent.cpp
Created July 10, 2018 21:02
Write a recursive algorithm to perform x^n
// If exp is even, split in half twice and call each recursively
// otherwise, split in half twice and call each recursively AND multiply x
// Questions:
// What if exponent is 1? -- Then it will return x*1*1
// What if exponent is 3+? -- If even, split. If odd, multiply next split value to x
int power(int base, int exponent) {
if (exponent == 0) return 1;
else if (exponent%2 == 0) // if even
#ifndef SPLAY_TREE_H
#define SPLAY_TREE_H
#include <utility>
#include <iostream>
#include "Array.h"
#include "bst.h"
#include <cassert>
using namespace std;