Skip to content

Instantly share code, notes, and snippets.

View yzaguirre's full-sized avatar

David yzaguirre

  • Guatemala
View GitHub Profile

Keybase proof

I hereby claim:

  • I am yzaguirre on github.
  • I am yzaguirre (https://keybase.io/yzaguirre) on keybase.
  • I have a public key whose fingerprint is 15F6 DA30 C9A7 7E42 984C CEFF 8A27 6CAE 0A4F 216E

To claim this, I am signing this object:

@yzaguirre
yzaguirre / get-campeones.sh
Created April 5, 2014 14:49
Descarga todos los perfiles de los campeones
#!/bin/bash
# https://stackoverflow.com/questions/10929453/bash-scripting-read-file-line-by-line
#filename="$1"
filename=campeones.txt
mkdir campeones
mv $filename campeones
cd campeones
while read -r line
do
wget $line --adjust-extension
@yzaguirre
yzaguirre / unwrap2.sh
Last active August 29, 2015 13:58
Con la herramienta xidel (licencia GPLv2) por cada campeón, con sus tres categorías, extrae los 10 nombres de campeones
#!/bin/bash
# http://videlibri.sourceforge.net/xidel.html#downloads
filename=champs.txt
while read -r nombre
do
name_nosuff=/home/david/tmp/campeones/$nombre
# ${name_nosuff}.html > ${name_nosuff}.1.html
# xidel aatrox.html -e 'css("#counterpicks-list.picks-list")'| sed 's/[ \t\n]*//' | sed '/^$/d' | tail -n +2 | head -n -1 | awk 'NR%7==1{print $0}' | less
# xidel aatrox.html -e 'css("#goodagainst-list.picks-list")'| sed 's/[ \t\n]*//' | sed '/^$/d' | tail -n +2 | head -n -1 | awk 'NR%7==1{print $0}' | less
# xidel aatrox.html -e 'css("#duopicks-list.picks-list")'| sed 's/[ \t\n]*//' | sed '/^$/d' | tail -n +2 | head -n -1 | awk 'NR%5==1{print $0}' | less
@yzaguirre
yzaguirre / unwrap2.5.sh
Created April 5, 2014 14:37
Transforma las tres categorías de cada campeón en una lista, separado por coma, cada nombre encerrado entre comillas
#!/bin/bash
filename=champs.txt
while read -r nombre
do
name_nosuff=/home/david/tmp/campeones/$nombre
# ${name_nosuff}.html > ${name_nosuff}.1.html
# sed -e 's/[ \t]*$//' aatrox.bad_against.txt | sed ':a;N;$!ba;s/\n/" "/g' | sed '1s/^/"/' | sed '$s/$/"/'
# sed -e 's/[ \t]*$//' aatrox.good_against.txt | sed ':a;N;$!ba;s/\n/" "/g' | sed '1s/^/"/' | sed '$s/$/"/'
# sed -e 's/[ \t]*$//' aatrox.good_with.txt | sed ':a;N;$!ba;s/\n/" "/g' | sed '1s/^/"/' | sed '$s/$/"/'
@yzaguirre
yzaguirre / unwrap3.sh
Last active August 29, 2015 13:58
inserta cada lista de campeones a su respectivo fact
#!/bin/bash
filename=champs.txt
x=0
while read -r nombre
do
name_nosuff=/home/david/tmp/campeones/$nombre
x=$(($x + 13))
while read ba && read -u 3 ga && read -u 4 gw; do
# sed 's/^ )$/ \t(good_against ${ga})\n \t(good_against ${ga})\n \t(good_against ${ga})\n )/' ../src/hechos.clp
@yzaguirre
yzaguirre / backupP3
Last active December 24, 2015 10:29
Crea un .tar.gz de una carpeta como respaldo
#!/bin/bash
# idea http://jstr.se/archives/bash-backup-script-using-tar/
# instalacion:
# $ mkdir ~/bin ~/backup
# $ vim ~/bin/backupP3
# $ chmod u+x ~/bin/backupP3
# uso:
# $ backupP3 "dhcp funcionando"
cd ~/gns3/Projects # donde se ubican proyectos gns3
filename=P3Redes2_`date +'%d-%m-%Y_%H.%M.%S'`\ $1.tar.gz
@yzaguirre
yzaguirre / script.sh
Created August 24, 2013 03:13
configurar IP Estática en Linux Microcore sin utilizar el excelente editor vi. Ejectuar los 2 comandos en calidad de root user
echo $'\nifconfig eth0 LA_IP_MICROCORE netmask LA_MASCARARED up\nroute add default gw LA_IP_GATEWAY eth0' >> /opt/bootloader.sh
filetool.sh -b
http://materias.utags.edu.mx/CCNA/ver3/sem3es/CHAPID=knet-AYhFIomYAAVnSZYg/RLOID=null/RIOID=null/knet/31AYhFIol4BQhZCAUA/chapterframeset.html
@yzaguirre
yzaguirre / ejemplo.tex
Last active December 20, 2015 09:40
Ejemplo LaTex
\documentclass[10pt]{article}
\title{Primer ejemplo usando LaTex}
\author{David Y. Gonzalez}
\begin{document}
\maketitle
\date
\abstract{Esto es un ejemplo de abstract.}
\section{Introduction}
Aqui un parrafo de introduccion.
@yzaguirre
yzaguirre / title_page_1.tex
Created July 28, 2013 03:56
Carátula en LaTex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% University Assignment Title Page
% LaTeX Template
%
% This template has been downloaded from:
% http://www.latextemplates.com
%
% Original author:
% WikiBooks (http://en.wikibooks.org/wiki/LaTeX/Title_Creation)
%