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 / strong-passwords.php
Last active February 12, 2026 11:25 — forked from tylerhall/strong-passwords.php
A user friendly, strong password generator PHP function.
#!/usr/bin/php
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
#!/bin/bash
PORT=1234
APPEND="Ganagato"
if [[ "$1" = "listener" ]]; then
counter=0
while read line; do
echo "${line}${APPEND}${counter}"
counter=$((counter+1))
done < "${2:-/dev/stdin}"
elif [[ "$1" = "-h" ]]; then
@compermisos
compermisos / mostCPUused.sh
Created March 5, 2018 19:01
the process whit more use of cpu
ps amux |awk '{ print $3,$2,$11}'|sort -h |tail -n 1|{ read test; echo $test; >&2 echo $test; }|awk '{ print $2}'|{ read pid;ps -ocommand= -p $pid; }
import string, re
particle = re.split('1?\d\d', "85128997411668")
for for i in reversed(particle):
print(chr(int(i)))
#!/usr/bin/php
<?php
// Code FROM http://stackoverflow.com/questions/14079703/str-shuffle-and-randomness
header("Content-type: image/png");
$im = @imagecreatetruecolor(512, 512) or die("Cannot Initialize new GD image stream");
$white = imagecolorallocate($im, 255, 255, 255);
for($y = 0; $y < 512; $y ++) {
for($x = 0; $x < 512; $x ++) {
if (testMTRand()) { //change each function here
imagesetpixel($im, $x, $y, $white);
@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
clear;while :;do echo $LINES $COLUMNS $(($RANDOM%$COLUMNS));sleep 0.1;done|gawk '{a[$3]=0;for(x in a) {o=a[x];a[x]=a[x]+1;printf "\033[%s;%sH ",o,x;printf "\033[%s;%sH*\033[0;0H",a[x],x;}}'
@compermisos
compermisos / gist:6798328
Created October 2, 2013 18:30
Convert domain TLD`s to hosts.conf deny list
wget -qO- http://data.iana.org/TLD/tlds-alpha-by-domain.txt | sed -e '/^#/d' | sed 's/^/0.0.0.0 *./'
@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 #
@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