mkdir ~/.go
echo "GOPATH=$HOME/.go" >> ~/.bashrc
echo "export GOPATH" >> ~/.bashrc
echo "PATH=\$PATH:\$GOPATH/bin # Add GOPATH/bin to PATH for scripting" >> ~/.bashrc
source ~/.bashrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
-number: input number | |
-min: Minimun number | |
-max: Maximun number | |
given a number and a minimun a maximun | |
calculate the equivalent percentage | |
*/ | |
float valtope(float number, float min, float max){ | |
float res = ((number - min) / (max - min)) * 100; | |
return res; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Everyone knows passphrases. One can choose passphrases from poems, songs, movies names and so on but frequently they can be guessed due to common cultural references. You can get your passphrases stronger by different means. One is the following: | |
// choose a text in capital letters including or not digits and non alphabetic characters, | |
// shift each letter by a given number but the transformed letter must be a letter (circular shift), | |
// replace each digit by its complement to 9, | |
// keep such as non alphabetic and non digit characters, | |
// downcase each letter in odd position, upcase each letter in even position (the first character is in position 0), | |
// reverse the whole result. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /home/sebassdc/.nvm/versions/node/v6.9.1/bin/node | |
// place up there the output of "whereis node" | |
const cp = require('child_process') | |
if (process.argv.length < 3 || process.argv.length > 3) { | |
throw new Error('must be one argument') | |
} | |
cp.exec(`netstat -ap | grep :${process.argv[2]}`, (err, stdout, stderr) => { | |
if (err) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
void print_arr(int matriz[],int size) { | |
cout << "{"; | |
for (int i = 0; i < size; i++) { | |
cout << matriz[i]; | |
if (i < size - 1) cout << ", "; | |
} | |
cout << "}"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ahorra tiempo para compilar c++ | |
#include <cstdlib> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main(int argc, char const *argv[]) { | |
string filename(argv[1]), result, callString; | |
result = filename.substr(0 , filename.length() - 4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
import sys | |
import random as rd | |
from string import ascii_lowercase as beta | |
from string import ascii_uppercase as alfa | |
def passgen(longu): | |
colection = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python3 | |
"""cliube | |
Usage: | |
cliube inverse <moves> | |
cliube optimise <moves> | |
cliube (-h | --help) | |
cliube --version | |
Options: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Guia 10 | |
El Consejo Nacional Electoral, organismo encargado de realizar los procesos | |
electorales a nivel nacional, requiere conocer cierta informacion estadistica | |
del mes de mayo, respecto al numero de inscritos. | |
Dicho organismo desea cuantificar: | |
-> El numero de personas inscritas en el mes | |
-> El numero de personas inscritas cada una de las semanas del mes. | |
-> Y por ultimo desea determinar cual de los dias de inscripcion resulta mas | |
efectivo, es decir, reporta mayor cantidad de inscritos | |
-> Los datos suministrados son: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Guia 10 | |
El Consejo Nacional Electoral, organismo encargado de realizar los procesos | |
electorales a nivel nacional, requiere conocer cierta informacion estadistica | |
del mes de mayo, respecto al numero de inscritos. | |
Dicho organismo desea cuantificar: | |
-> El numero de personas inscritas en el mes | |
-> El numero de personas inscritas cada una de las semanas del mes. | |
-> Y por ultimo desea determinar cual de los dias de inscripcion resulta mas | |
efectivo, es decir, reporta mayor cantidad de inscritos | |
-> Los datos suministrados son: |
OlderNewer