Skip to content

Instantly share code, notes, and snippets.

View ciberado's full-sized avatar

Javier Moreno ciberado

View GitHub Profile
var fs = require('fs');
var ejecutar = function(ruta, fnFichero, fnFinal) {
var numFicherosPendientes = 1;
var numRecursivas = 0;
var procesarCarpeta = function(ruta) {
fs.lstat(ruta, function(err, stats) {
if (err) {
numFicherosPendientes = numFicherosPendientes - 1;
@ciberado
ciberado / gist:ec89b8beb591d88edc26
Created August 19, 2014 15:37
Parche al gruntfile de yeoman para angularjs con los cambios necesarios para actualizar los less de bootstrap
// Generated on 2014-08-19 using generator-angular 0.9.5
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
@ciberado
ciberado / RiverSongWebservice.js
Last active August 29, 2015 14:19
RiverSongWebservice
var http = require('http');
var server = http.createServer(function (request, response) {
console.log('Knock knock.');
response.writeHead(200, {"Content-Type": "application/json"});
var data = { 'message' : 'Hello Sweetie' };
response.end(JSON.stringify(data) + '\n');
});
server.listen(8888);
@ciberado
ciberado / instalar-bower
Last active December 16, 2015 16:54
Docker orquestration with Swarm (haproxy)
Container Orchestration with Docker Swarm
==================================================
Key concepts quick review
--------------------------------------------------
+ Images
+ Dockerfile
+ Docker Hub
+ Host
@ciberado
ciberado / index.php
Created November 2, 2015 13:35
Hello world en php
<html>
<head>
<title>Prueba de PHP</title>
</head>
<body>
<?php echo '<p>Hola Mundo</p>'; ?>
</body>
</html>
@ciberado
ciberado / java8install.sh
Last active November 11, 2015 08:49 — forked from mikakoivisto/java7install.sh
Ubuntu 14.04 Java 7 automated install script
#!/bin/bash
cat - <<-EOF >> /etc/apt/sources.list.d/webupd8team-java.list
# webupd8team repository list
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
# deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
EOF
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xEEA14886
@ciberado
ciberado / 01_preparar_storage.md
Last active April 6, 2016 11:12
Instrucciones para preparar un storage account usando el cli
#!/bin/bash
delete-vpc() {
local teamName=${1:-ciberadok8s}
local region=${2:-eu-west-1}
aws ec2 describe-vpcs --region ${region} | jq -r ".Vpcs[] | select(.Tags[].Value | contains(\"${teamName}\")) | .VpcId" 2>/dev/null |
while read vpcID; do
echo "# deleting vpc (${vpcID}) ..."
# sudo apt update; sudo apt install graphviz
# pip3 install diagrams
# python3 diagrams-aws.py
from diagrams import Cluster, Diagram, Edge
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB
from diagrams.custom import Custom
from urllib.request import urlretrieve
#!/bin/bash
if [[ $# -eq 0 ]] ; then
echo 'Provide the name of the owner, please.'
exit 0
fi
OWNER=$1
VPC_ID=$(aws ec2 create-vpc \