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
#!/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 / strong-passwords.php
Last active December 12, 2023 15:34 — 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
# update the system
sudo apt-get update
sudo apt-get upgrade
# Add puppet repos
wget https://apt.puppetlabs.com/puppetlabs-release-precise.deb
sudo dpkg -i puppetlabs-release-precise.deb
sudo apt-get update
@compermisos
compermisos / pi.out
Created November 4, 2014 04:06
Pi to string base 64
NOb1iYOfltZqlfOxbTS75mcKJ6Tgwr7W7Q06b08iVb3vYhUQ6ORNPVyfRd2u9lr8ex6Ve817nQbvKQs2TJa1cUUJ370tVdY2c3QfrbQ9K27gr9bu4vWkVNe1aL1Zas0U2bh8hVJsqZ0RMmj7Z2wNL98sW026e3XQvQz9TfbcYna710jNb7381Md15vR42zMTN5ydOK8dg586j577S19UVK9QcZKOe5KUv7r0ki0Je3iRUKaXYLacQS1SwLhg3g0r640dV2Mdd eVukS72Qh8dk2M5mU7LceLKWT3vRtL5nyf054L7sZi8RMUMMpKMY8a9 7N8N4r91Vw1q1t2eUkJxOVO4b6bip1i4KUc2S8VnhoQ7QjcMu7di8yW7UMwiihkcN4iy5ge9bP9 R7xXsd3h58dZpzW8Ygr4xiZSeRQ7103MNlKbV6KgTSQp6QQL5N937R1w4bK249K74b XW1NKcKS5NR5N5fQLZP2M0SaW2KS79U0TSYl9z5TJ1v6 aX1c91lRafRddSz311Uc4i590YiolaXgUMzSuaey3JU8psox57xRegK498N3XZK9SQKtktwmeb3640bM13Km0hvRnLUS98i 6L8JuJRSpe3fSYtLNkrdvY1OMuZT744Kh00842TYZ5wLcejM2YYOU4KU05522n63QxSiKYgRq0i6LnXJfuf aoiaZ4ZiVO3RiuQ 89hQU0LSbsVexdb9Rgs363wSU5wsX65Zi4Zb8JOK9dc3fK1hwWTa3f2jv61waSXRhOM14 5PJZ2YaVYyQTQ5t8Y9MMacP0Q06819sXabQfQUu8i1orS94UvPM9O9z3Ugu5oTd4qUWfm7moqgsuLXPVYRhi5v309bSVUTaYxYp4XL7O4d8P1t44hVaWaaN8UNqSRO3g2Qso0elSN 8e6P6pYLz5K9bhvf8obvVZd44XS1bxVU69R 6JpN0TmSws47W7kVf94jq7a8WtM01K9fXMY81SZsi6Mm4N2KZ9d1LnNeL5tShiYe6hYRZTzXYn
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 #