This file contains 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
<?php | |
// RC4 encryption function | |
function ARC4($data, $key) { | |
$s = array(); | |
$keyLength = strlen($key); | |
if ($keyLength == 0) { | |
return ""; | |
} |
This file contains 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
def converte_hex_para_hsl(hexstring : str): | |
import colorsys | |
# especificacao do formato retirada de | |
# https://en.wikipedia.org/wiki/Web_colors | |
# tamanho da string | |
CONST_FULLSIZE = 7 | |
CONST_MINSIZE = 4 |
This file contains 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
# Simple No-ip.com Dynamic DNS Updater | |
# | |
# By Nathan Giesbrecht (http://nathangiesbrecht.com) | |
# | |
# 1) Install binary as described in no-ip.com's source file (assuming results in /usr/local/bin) | |
# 2) Run sudo /usr/local/bin/noip2 -C to generate configuration file | |
# 3) Copy this file noip2.service to /etc/systemd/system/ | |
# 4) Execute `sudo systemctl enable noip2` | |
# 5) Execute `sudo systemctl start noip2` | |
# |
This file contains 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 | |
yum install -y plymouth-theme-* | |
plymouth-set-default-theme solar | |
dracut --force | |
echo "The following are possible:" |
This file contains 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
# -*- coding: utf-8 -*- | |
from django.forms import fields, util, Form | |
class EstadoField(fields.CharField): | |
default_error_messages = { | |
'invalid' : u'Este campo não é um Estado da União Federal.', | |
'required' : u'Este campo é obrigatório.', | |
'out_of_range': u'Este campo deve ser igual a 2 letras.', | |
} |
This file contains 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
estados = [ "AC","AL","AM","AP","BA", | |
"CE","DF","ES","GO","MA", | |
"MT","MS","MG","PA","PB", | |
"PR","PE","PI","RJ","RN", | |
"RO","RS","RR","SC","SE", | |
"SP","TO"] |
This file contains 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 | |
# You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
# any TTF you have) | |
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
from image_utils import ImageText |
This file contains 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
import urllib | |
from django.utils.html import conditional_escape | |
from django.utils.safestring import mark_safe | |
def qrcode(value, alt=None, size = 250): | |
""" | |
Generate QR Code image from a string with the Google charts API | |
http://code.google.com/intl/fr-FR/apis/chart/types.html#qrcodes | |
This file contains 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 ldap_auth($uname,$ldappass,$server_config){ | |
// takes three parameters: array of config | |
// add id address, dist_name is distinguished name, | |
// user and password | |
// returns 1 if user and pass are correct | |
// | |
$basedn = $server_config['dist_name']; | |
$server = $server_config['add']; | |
$port = $server_config['port']; |