Skip to content

Instantly share code, notes, and snippets.

View compermisos's full-sized avatar

Jesus Christian Cruz Acono compermisos

  • Tlaxcala, Mexico
View GitHub Profile
@compermisos
compermisos / network_chek.sh
Created November 4, 2011 01:07
Reboot network cards on Network Lost
#! /bin/bash
#(c)2011-2012 Jesus Christian Cruz Acono JesusChristian (At) Tequilavalley.com
#constant check network connectivity, on lost
#re-start Cards if lost are "more large"
#reboot the system.
#the script check connectivity by ping to "arbitrary IP"
######config zone######
#IP to make the ping to check, in this moment uses GOOGLE IP (google cant negate the ping)
#you can use a "domain name" to "aditional" check de dns resolv
PINGIP="64.233.169.103"
@compermisos
compermisos / gist:1356936
Last active September 28, 2015 00:37
A simple PHP Template Manager
/*please see https://github.com/compermisos/coSimpleTemplate */
/* example usage
some.php>>>
<?php
$template = new coSimpleTemplate("rute/to/archive.tpl");
$template->set("foo", "bar");
$template->set("foo2", 1);
print $template->output();
?>
rute/to/archive.tpl>>>
@compermisos
compermisos / gist:1819942
Created February 13, 2012 20:27
comparativo de cresimiento de consumo de disco duro (72 horas de separacion)
thor:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p1 56435164 5819196 47749172 11% /
tmpfs 3060912 0 3060912 0% /lib/init/rw
udev 10240 792 9448 8% /dev
tmpfs 3060912 0 3060912 0% /dev/shm
/dev/cciss/c0d0p2 76896348 3624276 69365868 5% /var/www
thor:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p1 56435164 6136896 47431472 12% /
@compermisos
compermisos / gist:1830383
Created February 14, 2012 20:58
upload ssh keys
#!/bin/sh
KEY="$HOME/.ssh/id_dsa.pub"
if [ ! -f ~/.ssh/id_dsa.pub ];then
echo "private key not found at $KEY"
echo "* please create it with "ssh-keygen -t dsa" *"
echo "* to login to the remote host without a password, don't give the key you create with ssh-keygen a password! *"
exit
fi
@compermisos
compermisos / MyBakup.sh
Created June 1, 2012 23:10
backup mysql db's "table a table"
#!/bin/sh
# MySQL backup script Table based
# Copyright (c) 2012 Jesus Christian Cruz Acono <JCCruz@openintelligence.mx>
# This script is licensed under GNU GPL version 2.0 or above
# ---------------------------------------------------------------------
#########################
######TO BE MODIFIED#####
### System Setup ###
@compermisos
compermisos / coSimpleContentCleaner.php
Created June 4, 2012 17:29
a coSimpleContentCleaner
<?php
/*
coSimpleContentCleaner is a simple class to clean user imput from XSS and SQL injection atack
coSimpleContentCleaner is a work in progress.
a simple example
<?php
$clean = new coSimpleContetnCleaner();
@compermisos
compermisos / changepassword.php
Created October 4, 2012 03:00 — forked from mattrude/changepassword.php
LDAP PHP Change Password Page
<?php
/**
* LDAP PHP Change Password Webpage
* @author: Matt Rude <http://mattrude.com>
* @website: http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/
*
*
* GNU GENERAL PUBLIC LICENSE
* Version 2, June 1991
@compermisos
compermisos / .travis.yml
Created April 4, 2013 22:02
Travis-ci.org base definition to proyects use Phix
language: php
php:
- 5.4
- 5.3
matrix:
  allow_failures:
    - php: 5.5
@compermisos
compermisos / Java.rc.sh
Last active May 8, 2017 07:10
Java code statical analysis
# Java static analysis (very simple) functions
# by Enrique Alfonso Sanchez Montellano
# http://security-dojo.com/programming-bits/static-source-code-audit-on-terminal-aka-glorified-greps-part-2/
auditjava ()
{
if [ -z "$1" ]; then
echo "Missing directory to audit!"
echo "Usage: auditjava <directory>"
else
@compermisos
compermisos / .gitignore
Created September 13, 2013 04:11
my used gitignore
jccruz@oi:~/proyectos/Sysadmin-tools$ cat ~/.gitignore
*.[oa]
*.lo
*.la
*.gmo
semantic.cache
*~
*.pyc
.hgignore
# Compiled source #