Skip to content

Instantly share code, notes, and snippets.

View j1cs's full-sized avatar
😺
Im on #cat-v mostly

Juan Cuzmar j1cs

😺
Im on #cat-v mostly
View GitHub Profile
@j1cs
j1cs / lowerit
Created March 25, 2015 01:14
Letras minúsculas
#!/bin/sh
# lowerit
# Convertir todos los nombres de los archivos en el directorio actual a minúsculas
# Sólo opera en archivos planos - no cambia el nombre de los directorios
# Solicitará la verificación antes de sobrescribir un archivo existente
for x in `ls`
do
if [ ! -f $x ]; then
continue
fi
@j1cs
j1cs / ssh_utils
Created March 25, 2015 01:17
ssh utiles
ssh -L 5901:127.0.0.1:5901 -N -f -l juan juan-server
ssh-keygen -f "/home/user/.ssh/known_hosts" -R gitlab.option.cl
@j1cs
j1cs / compiz-check
Last active August 29, 2015 14:17
Revisa si corre compiz o si tu driver de video está vien instalado
#!/bin/bash
# Compiz-Check -- script to test if your system is able to run Compiz
#
# Copyright (c) 2008 Nick Bauermeister <Forlong@gmx.de>
#
# This program is free software. Feel free to redistribute and/or
# modify it under the terms of the GNU General Public License v3
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful
@j1cs
j1cs / dir2utf8
Created March 25, 2015 01:22
convertir todos los archivos de un directorio a UTF8
#!/bin/bash
# converting all files in a dir to utf8
for f in *
do
if test -f $f
then
echo -e "\nConverting $f"
CHARSET="$( file -bi "$f"|awk -F "=" '{print $2}')"
if [ "$CHARSET" != utf-8 ]; then
@j1cs
j1cs / free
Last active August 29, 2015 14:17
Libera los buffers de la ram
#!/bin/bash
# Flush file system buffers by executing
sync;
# free page cache
echo 1 > /proc/sys/vm/drop_caches;
# free dentries and inodes
echo 2 > /proc/sys/vm/drop_caches
@j1cs
j1cs / battery-alert
Created March 25, 2015 02:33
Notificar batería baja
#!/bin/bash
# must install notification-daemon package
# low battery in %
LOW_BATTERY="15"
# critical battery in % (execute action)
CRITICAL_BATTERY="10"
# action
ACTION="/sbin/poweroff"
# display icon
ICON="/usr/share/icons/gnome/32x32/status/battery-caution.png"
@j1cs
j1cs / random_wallpaper
Last active August 29, 2015 14:17
Random wallpaper
#!/bin/bash
# Reads a given directory and set a random
# wallpaper using the images on that dir.
# fluxbox wm
WALLPAPERDIR="$HOME/wallpapers"
if [[ -d "${WALLPAPERDIR}" ]]
then
while(true)
#!/bin/bash
IN="LVDS1"
EXT="VGA1"
if (xrandr | grep "$EXT disconnected"); then
xrandr --output DVI1 --off --output VIRTUAL1 --off --output LVDS1 --mode 1024x768 --pos 0x0 --rotate normal --output VGA1 --off
else
xrandr --output DVI1 --off --output VIRTUAL1 --off --output LVDS1 --mode 1024x768 --pos 0x0 --rotate normal --output VGA1 --mode 1440x900 --pos 1024x0 --rotate normal
fi
@j1cs
j1cs / foreach.php
Last active August 29, 2015 14:19
repite el proceso a medida que se eliminan tuplas reinicianado el contador
<?php
for ($i = $start; $i < $end; true) {
if ($batch > ($end - $i)) {
$batch = ($end - $i);
}
if ($end !== $companyRepo - > getCountCompanyByAccount($this - > accountId)) {
$end = $companyRepo - > getCountCompanyByAccount($this - > accountId);
$i = 0;
} else {
$i += $batch;
@j1cs
j1cs / multilikes.js
Last active August 29, 2015 14:23
Likes on antronio forum
$(document).ready(function(){$(".LikeLink.like").each(function(){$(this).trigger('click')}).promise().done(setTimeout(function(){ window.location = $(".pageNavHeader").next("nav").find("a.text:last").attr("href");}, 10000));})