This file contains hidden or 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
#!/bin/bash | |
# Función que para una lista de imagenes png cuyos nombres son una secuencia de numeros (por ejemplo 1.png, 2.png, 3.png) | |
# permite un renombrado masivo para una región definida por un límite inferior y superior. | |
# El renombrado consiste en agregarle o restarle cierta cantidad denominada salto a los nombres de los archivos | |
# pero sin perder el orden de los archivos. | |
# Sí el salto sera para sumar o restar en los nombres de los archivos dependerá de la presencia del parametro -I. | |
# Sí esta presente el renombrado se hara restando el salto al numero del archivo. | |
# Uso renombrar_imagenesordenadas limite_inferior limite_superior salto -I (opcional) | |
limite_inf=$1; | |
limite_sup=$2; |
This file contains hidden or 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
var fs = require('fs'), | |
wallpaper = require('wallpaper'), | |
path = require('path'); | |
var p = "../Pictures/walls"; | |
fs.readdir(p, function (err, files) { | |
if (err) { | |
throw err; | |
} | |
var images = files.map(function (file) { |
This file contains hidden or 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
#!/bin/bash | |
host="http://www.imagenesbing.com/" | |
file="$HOME/temp1.html" | |
imgfolder="$winhome/Pictures/walls" | |
curl --silent $host -o $file | |
max_value=`grep -E -o '/i/[0-9]+' $file | grep -E -o '[0-9]+' | awk '$0>x{x=$0};END{print x}' ` | |
# Generate multiple values | |
#for i in {1..5}; do echo $((RANDOM %= $max)); done | |
imageid=$((RANDOM %= $max_value)) | |
imageurl="i/$imageid" |
This file contains hidden or 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/env python | |
# -*- coding: utf-8 -*- | |
"""NOMBRE: | |
chg_path - Script para cambiar la barra inclinada o slash en rutas de Windows | |
o convertir las rutas en formato de Cygwin | |
SINOPSIS: | |
chg_path [OPCION] [ruta] | |
DESCRIPCIÓN: |
This file contains hidden or 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
function waitFor(testFx, onReady, timeOutMillis) { | |
var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 9000, //< Default Max Timout | |
start = new Date().getTime(), | |
condition = false, | |
interval = setInterval(function() { | |
if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) { | |
// If not time-out yet and condition not yet fulfilled | |
condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code | |
} else { | |
if(!condition) { |
This file contains hidden or 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
from pylab import * | |
import cx_Oracle | |
# Periodos se refiere a cantidad de semestres | |
periodos = [] | |
# Listas para promedio de notas por periodo y desviación standar | |
prom = [] | |
desstd = [] | |
# Listas para indice academico y su desviación | |
indice = [] |
This file contains hidden or 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
cat /etc/passwd | cut -f 1 -d : >/tmp/users.list | |
Then edit /tmp/users.list to only contain the users you want. Then do: | |
for i in `cat /tmp/users.list` | |
do | |
userdel $i | |
useradd -m -k /etc/skel $i | |
done |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import pygraphviz as pgv | |
# conector a bd generico | |
import conexionbd as conex | |
# Los sqls obedecen a un esquema particular de tablas | |
sql1 = "select * from tablas" | |
filas1 = conex.conexionBd(sql1) | |
sql2 = "select * from tablas2" |
NewerOlder