Skip to content

Instantly share code, notes, and snippets.

View angelbladex's full-sized avatar

Luis García angelbladex

View GitHub Profile
@angelbladex
angelbladex / extract
Last active December 14, 2015 00:29 — forked from guerrerocarlos/.bashrc
Un simple script en Bash para facilitar extraer contenido de algunos comprimidos -- An simple script on Bash for extract content from some compressed file
#! /bin/bash
##This can be on /bin/ or /usr/bin or any site of your $PATH
####Based on https://gist.github.com/guerrerocarlos/3977495
if [[ ! -n "$1" ]];then
echo "Archivo no ingresado"
exit
fi
@angelbladex
angelbladex / aMayusculas.sh
Created October 22, 2013 15:32
Script para pasar a mayúsculas, todo lo que recibe
#!/bin/bash
#Convierte a mayúsculas todos los parámetros que recibe
echo $@ | awk '{print toupper($0)}'
@angelbladex
angelbladex / aMinusculas.sh
Created October 22, 2013 15:34
Script para pasar a minúsculas, todo lo que recibe
#!/bin/bash
#Convierte a minúsculas todos los parámetros que recibe
echo $@ | awk '{print tolower($0)}'
@angelbladex
angelbladex / colorear.sh
Created October 22, 2013 15:36
Script para convertir algún código en html con resaltado de colores, usando el paquete highlight
#!/bin/bash
if [[ ! -n "$1" ]];
then
echo "Nombre de archivo no ingresado"
exit
fi
@angelbladex
angelbladex / strikethroughText.sh
Created October 27, 2013 20:35
Este script tacha el texto recibido por parámetro
#!/bin/bash
echo $@ | sed $"s/./&\xCC\xB6/g"
@angelbladex
angelbladex / .bashrc
Last active August 29, 2015 14:02
My alias command on .bashrc
#SomeTimes i delete lnk files on USB drives from my friends,
# i got to directory on /media/USB_DRIVE_NAME and apply next alias
alias deletelnk='sudo find . -iname "*lnk" -exec rm {} \;'
#Using woodim for put blank a cdrom r+w
alias deleteCD='wodim -v dev=/dev/sr0 blank=fast'
#Using woodim for put blank a Dvd r+w
alias deleteDVD='dvd+rw-format -blank=full /dev/sr0'
#Alias for connect to Windows host on one domain via rdesktop,
# require a ip as parameter, e.g.remote 192.168.0.1
alias remote='rdesktop -g 70% -u username -d domanin -a 16'
@angelbladex
angelbladex / tree.sh
Created August 19, 2014 00:04
Displays Structure of Directory Hierarchy
#!/bin/sh
#######################################################
# UNIX TREE #
# Version: 2.3 #
# File: ~/apps/tree/tree.sh #
# #
# Displays Structure of Directory Hierarchy #
# ------------------------------------------------- #
# This tiny script uses "ls", "grep", and "sed" #
# in a single command to show the nesting of #
@angelbladex
angelbladex / validate.sh
Last active September 3, 2024 15:27 — forked from hrwgc/validate.sh
validate a url with wget
#!/bin/bash
# simple function to check http response code before downloading a remote file
# example usage:
# if `validate_url $url >/dev/null`; then dosomething; else echo "does not exist"; fi
function validate_url(){
@angelbladex
angelbladex / fechas.php
Created September 14, 2014 04:19
Prueba de concepto para obtener fechas de operativos Mercal de la página de Mercal
<?php
//original code written by @willicab > https://pastebin.mozilla.org/6456892
error_reporting(E_ALL);
ini_set('display_errors', 1);
$mes = array(
"ENERO" => "01",
"FEBRERO" => "02",
"MARZO" => "03",
"ABRIL" => "04",
@angelbladex
angelbladex / list-parameters.sh
Created October 23, 2014 21:55
List parameters each loead kernel module
#!/bin/bash
# This script was created from source of -> http://serverfault.com/questions/62316/how-do-i-list-loaded-linux-module-parameter-values
#This code list parameters of each loaded kernel modules
cat /proc/modules | cut -f 1 -d " " | while read module; do \
echo "Module: $module"; \
if [ -d "/sys/module/$module/parameters" ]; then \
ls /sys/module/$module/parameters/ | while read parameter; do \
echo -n "Parameter: $parameter --> "; \
cat /sys/module/$module/parameters/$parameter; \