Skip to content

Instantly share code, notes, and snippets.

Javier Aranda javierav

Block or report user

Report or block javierav

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View kubernetes.md

Kubernetes

Guía de uso sencilla para gente que está empezando.

Pods

Obtener la lista de pods

$ kubectl -n CLUSTER get pods
@javierav
javierav / json-to-csv.rb
Created Apr 4, 2018
Convert JSON translations strings into an awesome CSV document
View json-to-csv.rb
require 'json'
require 'csv'
class Key
attr_reader :file, :key, :translations
def initialize(file, key)
@file = file
@key = key
@translations = {}
@javierav
javierav / kernel.sh
Created Mar 5, 2018
How to install latest kernel in Ubuntu
View kernel.sh
sudo add-apt-repository ppa:teejee2008/ppa
sudo apt-get update && sudo apt-get install ukuu
sudo ukuu --install-latest
View system-backup.sh
#!/usr/bin/env bash
#
## Este script ejecuta un backup del sistema en Amazon S3
#
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
export AWS_BACKUP_NAME="example-bucket"
@javierav
javierav / mysql.php
Created Oct 31, 2010
Elimina tablas MySQL en base a un prefijo dado
View mysql.php
<?php
/**
* Script que elimina de una base de datos todas las tablas que empiezan
* por el prefijo dado en $prefix
*
* Javier Aranda <internet at javierav dot com> - Aula de Software Libre
* Universidad de Córdoba
**/
@javierav
javierav / sync.sh
Created Nov 22, 2017
IMAP email migrating with Docker and ImapSync
View sync.sh
#!/usr/bin/env bash
EMAIL="john.doe@example.org"
FROM_PASSWD="foobarfoo"
TO_PASSWD="foobarbaz"
DOCKER_IMAGE_NAME="${EMAIL/@/-}"
DOCKER_CONTAINER=$(docker run -d --name "$DOCKER_IMAGE_NAME" gilleslamiral/imapsync imapsync \
--host1 X.X.X.X --user1 "$EMAIL" --password1 "$FROM_PASSWD" \
View attribute_lazy_loaded.rb
# El atributo manifest se evalua la primera vez que se pide y se cachea su resultado
class A
def manifest
if !@manifest.is_a?(Sprockets::Manifest) && @manifest.respond_to?(:call)
@manifest = @manifest.call
else
@manifest
end
end
attr_writer :manifest
View atom-cheatsheet.md

Atom Cheatsheet

Git Blame

Acción Linux Mac
Toggle Ctrl + b

Terminal Plus

@javierav
javierav / Assetfile.rb
Created Jan 6, 2013
Development with Rake Pipeline and Guard
View Assetfile.rb
# vim: filetype=ruby
require 'rake-pipeline-web-filters'
require 'rake-pipeline-i18n-filters'
class Minispade < Rake::Pipeline::Web::Filters::MinispadeFilter
def initialize(options = {})
super
@sourceURL = options[:source_url]
end
@javierav
javierav / removedir.php
Created Apr 7, 2012
Script PHP para borrar de forma recursiva un directorio
View removedir.php
<?php
/*
* this function removes a directory and its contents.
* use with careful, no undo!
*/
function rmdir_recursive($dir) {
$files = scandir($dir);
array_shift($files); // remove '.' from array
array_shift($files); // remove '..' from array
You can’t perform that action at this time.