Skip to content

Instantly share code, notes, and snippets.

View huberflores's full-sized avatar

Huber Flores (El Magico) huberflores

View GitHub Profile
@huberflores
huberflores / gnuplot_commands.as
Created December 10, 2014 00:46
Common Commands to use with gnuplot scripting
#
# author Huber Flores
#
> using 1:3
X Y1 Y2
1 10 100
2 20 200
...
#takes 1 as x axis, and 3 as y axis
@huberflores
huberflores / Latex_routines.tex
Last active August 29, 2015 14:11
How to of some latex packages
%
% author Huber Flores
%
%minted
-download minted or install it
-located the file minted.sty in the working folder
-add the arguments -shell-scape to the pdflatex command
In Kile(Settings -> Configure Kile -> Tools + Build -> PdfLatex -> "write the command into the box"
@huberflores
huberflores / HigherMonteCarlo.py
Last active October 5, 2015 14:48
Higher-dimensional Monte Carlo Integration
#
# author Huber Flores
#
import numpy as np
from scipy import *
import random
box = ([-1.0,1.0],[-1.0,1.0],[-1.0,1.0])
@huberflores
huberflores / amazonbundle.as
Last active October 5, 2015 14:57
Bundle an Amazon Instance
/*
* author Huber Flores
*/
# Upload your keys to your instance (*.pem files)
$ scp -i your_PrivateKeyFile.pem -r /PrivateKeysPath/huberfloresPrivateCertKeys.zip ubuntu@ec2-x-x-x-x.compute-1.amazonaws.com:/home/ubuntu/
# Connect to your instance (local keys)
$ ssh -i your_PrivateKeyFile.pem ubuntu@ec2-x-x-x-x.compute-1.amazonaws.com
@huberflores
huberflores / data-normalization.R
Created October 23, 2015 13:00
Normalization of data in a range using R
# author Huber Flores
# Normalizing data to a target range (a, b)
#original dataset
mydata <- c(26,33,45,77,15,100,66,21,89,55)
A = min(mydata)
B = max(mydata)
@huberflores
huberflores / file.R
Created November 9, 2015 14:36 — forked from mollietaylor/file.R
Storing a Function in a Separate File in R
# calling the functions
# this is the file where we will call the functions in fun.R and times.R
times <- dget("times.R")
times(-4:4, 2)
source("fun.R")
mult(-4:4, 2)
@huberflores
huberflores / decision-engine.R
Last active November 11, 2015 11:07
A fuzzy logic engine for computational offloading - simulation version
#
# author Huber Flores
#
# The input of the engine is a dataset. For each tuple of the dataset a decision is expected
# Each attribute in the tuple is normalized in a 0-1 interval
library(iterators)
library(foreach)
@huberflores
huberflores / github-quick-tutorial.tex
Last active December 2, 2015 15:41
GitHub quick and short tutorial
#
# author Huber Flores
#
# 1) Basic commands
$ cd yourrepo/
#file that contains instructions, licenses, etc.
$ touch README.md
@huberflores
huberflores / jdk_tomcat_installation.as
Last active December 3, 2015 13:10
Installation of Tomcat along with the JDK
#
# author Huber Flores
#
###Download JDK latest version
Upload the files to the server
put /home/huber/setups/jdk-6u22-linux-i586.bin.zip /home/murakas/huber/software
put /home/huber/setups/apache-tomcat-7.0.4.tar.gz /home/murakas/huber/software
put /home/huber/setups/jdk-6u22-linux-x64.bin /home/murakas/huber/software
@huberflores
huberflores / haproxy.as
Last active December 12, 2015 07:18
Installation and Configuration of HAProxy
/*
* author Huber Flores
*/
# Download latest version of HAProxy from http://haproxy.1wt.eu/#down
# version downloaded for this tutorial
# haproxy-1.4.15.tar.gz (wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.15.tar.gz)
$ tar -xvf haproxy-1.4.15.tar.gz