Skip to content

Instantly share code, notes, and snippets.

View josemarjobs's full-sized avatar

Josemar Magalhaes josemarjobs

  • Vancouver, BC
View GitHub Profile
@josemarjobs
josemarjobs / install-docker.md
Created September 1, 2021 19:44 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@josemarjobs
josemarjobs / curl.md
Created January 12, 2018 18:01 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@josemarjobs
josemarjobs / curl_post_json.md
Created January 12, 2018 18:01 — forked from ungoldman/curl_post_json.md
post a file JSON file with curl

How do POST file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package main
import (
"io/ioutil"
"log"
"strings"
"net/http"
"encoding/json"
"fmt"
"time"
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
stage 'CI'
node {
git branch: 'jenkins2-course',
url: 'https://github.com/g0t4/solitaire-systemjs-course'
// pull dependencies from npm
// on windows use: bat 'npm install'
sh 'npm install'
@josemarjobs
josemarjobs / links.md
Last active January 3, 2017 07:30 — forked from g0t4/links.md
Starting Point Files for Jenkins2 Getting Started course
import os
import struct
import numpy as np
"""
Loosely inspired by http://abel.ee.ucla.edu/cvxopt/_downloads/mnist.py
which is GPL licensed.
"""
def read(dataset = "training", path = "."):
class BayesianClassifier:
def __init__(self, **kwargs):
self.label1 = str(kwargs['label1']).lower()
self.label2 = str(kwargs['label2']).lower()
def dump(self):
print("Mean 1:",self.mu1)
print("Mean 2:",self.mu2)
print("Covariance Matrix 1:",self.cov1)
print("Covariance Matrix 2:",self.cov2)