This file contains hidden or 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 CRC(ByVal bData() As Byte, ByVal iLength As Integer, ByVal iPolynome As Integer, ByVal iCRC As Integer) | |
Dim flag As Boolean | |
For i As Integer = 0 To iLength - 1 | |
iCRC = iCRC Xor bData(i) | |
For j = 0 To 7 | |
If (iCRC And &H1) = 1 Then flag = True Else flag = False | |
iCRC = iCRC \ 2 | |
If flag Then iCRC = iCRC Xor iPolynome | |
Next | |
Next |
This file contains hidden or 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
CREATE TABLE IF NOT EXISTS `users` ( | |
`uname` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '', | |
`upwd` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '', | |
`quota` int(10) NOT NULL DEFAULT '0' | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; | |
ALTER TABLE `users` | |
ADD PRIMARY KEY (`uname`); |
This file contains hidden or 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
# installation base de données | |
sudo apt-get install postgresql | |
# création user base de données | |
sudo su - postgres | |
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo | |
exit | |
# ajout dépot nightly odoo et installation odoo | |
wget -O - https://nightly.odoo.com/odoo.key | sudo apt-key add - |
This file contains hidden or 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
from Crypto.PublicKey import RSA | |
from Crypto.Cipher import PKCS1_OAEP | |
from requests import get | |
from base64 import b64encode | |
def encode(publickey, content): | |
rsakey = RSA.importKey(publickey) | |
rsakey = PKCS1_OAEP.new(rsakey) | |
return b64encode(rsakey.encrypt(content)) |
This file contains hidden or 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 | |
$private = file_get_contents("private.pem"); | |
$data = base64_decode("base64-crypted-string"); | |
openssl_private_decrypt($data, $content, $private, OPENSSL_PKCS1_OAEP_PADDING); | |
echo $content; |
This file contains hidden or 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 | |
$content = "secret"; | |
$public = file_get_contents("public.pem"); | |
openssl_public_encrypt($content, $crypted, $public, OPENSSL_PKCS1_OAEP_PADDING); | |
echo base64_encode($crypted); |
This file contains hidden or 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
from Crypto.PublicKey import RSA | |
from Crypto.Cipher import PKCS1_OAEP | |
from requests import get | |
from base64 import b64decode | |
def decode(privatekey, content): | |
rsakey = RSA.importKey(privatekey) | |
rsakey = PKCS1_OAEP.new(rsakey) | |
return rsakey.decrypt(b64decode(content)) |
This file contains hidden or 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
https://www.devco.net/archives/2006/02/13/public_-_private_key_encryption_using_openssl.php |
This file contains hidden or 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 subprocess | |
import smtplib | |
pipe = subprocess.Popen('ip route list',shell=True,stdout=subprocess.PIPE) | |
data = pipe.communicate() | |
data = data[0].split() | |
ipaddr = data[data.index('src')+1] | |
my_ip = 'RaspberryPi ip is %s' % ipaddr | |
fromaddr = 'from@domain' |
This file contains hidden or 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 | |
sed -i 's/memory_limit = .*$/memory_limit = 256M/g' /etc/php5/apache2/php.ini | |
sed -i 's/post_max_size = .*$/post_max_size = 128M/g' /etc/php5/apache2/php.ini | |
sed -i 's/upload_max_filesize = .*$/upload_max_filesize = 128M/g' /etc/php5/apache2/php.ini | |
service apache2 restart |