Skip to content

Instantly share code, notes, and snippets.

View gabrielrojasnyc's full-sized avatar

Gabriel Rojas gabrielrojasnyc

View GitHub Profile
@gabrielrojasnyc
gabrielrojasnyc / file_go.go
Last active October 22, 2017 22:40
file_go.go
package main
import (
//"io/ioutil"
"fmt"
"log"
"io"
"os"
"net/http"
"time"
@gabrielrojasnyc
gabrielrojasnyc / file_python3.py
Created October 22, 2017 22:20
file_python3.py
#!/bin/python3
import time
import shutil
import requests
start_time = time.time()
links_website = {
@gabrielrojasnyc
gabrielrojasnyc / file_bash.sh
Created October 22, 2017 22:00
file_bash.sh
#!/bin/bash
# Tested using bash version 4.1.5
start=$SECONDS
for ((i=1;i<=10;i++));
do
# your-unix-command-here
wget http://ipv4.download.thinkbroadband.com/1GB.zip
echo $i
done
duration=$(( SECONDS - start ))
package main
import "fmt"
import "math"
import "time"
func main() {
for i := 1.0; i < 101; i++ {
switch {
case math.Mod(i,3) == 0 && math.Mod(i,5) == 0:
fmt.Println("Fizz Buzz")
@gabrielrojasnyc
gabrielrojasnyc / gender_submission_2.py
Created February 12, 2017 02:55
gender_submission_2
# coding: utf-8
# In[44]:
import csv
import numpy as np
fh = open('train.csv')
csv_reader = csv.reader(fh)
@gabrielrojasnyc
gabrielrojasnyc / submission_1.py
Created February 11, 2017 21:41
submission_1
# coding: utf-8
# In[24]:
import csv
fh = open('train.csv')
reader_csv = csv.reader(fh)
passanger_list = list(reader_csv)
passanger_list = passanger_list[1:]
@gabrielrojasnyc
gabrielrojasnyc / shutdown_ec2.py
Created February 1, 2017 21:26
Shutdown ec2 instances not tag
#! /usr/bin/env python3
"""
This program terminate instances if proper tag is not used
"""
import time
import boto3
@gabrielrojasnyc
gabrielrojasnyc / attach.py
Created February 1, 2017 18:54
How to add a second interface to specific EC2 instances using Python3
#! /usr/bin/env python3
"""
This program queries all servers in the AWS account
that dont have a second network attached.
Program attach the correct AZ ENI.
It only attach the interface to running instances
"""
import time
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {
"storageAccountName": "virginadraassa"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {
"storageAccountName": "virginadraassa"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",