Skip to content

Instantly share code, notes, and snippets.

View JorgeFrancoIbanez's full-sized avatar

Jorge Franco Ibañez JorgeFrancoIbanez

  • Ubisoft
  • Montreal
View GitHub Profile
@JorgeFrancoIbanez
JorgeFrancoIbanez / Python-connections
Last active June 13, 2019 14:55
Python connections to databases
Python connections to databases
@JorgeFrancoIbanez
JorgeFrancoIbanez / openstack_CLI_token_auth_Linux.rc
Created June 12, 2019 20:47
Openstack CLI token auth method template for keytone version 3 in OS based in Linux
export OS_USERNAME= <User email>
export OS_TOKEN= <Openstack auth TOKEN>
export OS_TENANT_ID= <Project-ID>
export OS_AUTH_URL=https://api-endpoint:5000/v3
export OS_AUTH_TYPE=token
export OS_IDENTITY_API_VERSION=3
export OS_INTERFACE=public
#!bin/python
import bcrypt
hash = b"Thistextwillbehashed"
hashed = bcrypt.hashpw(hash, bcrypt.gensalt())
print(hashed)
import argparse
import requests #needs to be installed
import json
parser = argparse.ArgumentParser(description='Get data of your project from your object storage service.')
parser.add_argument('--user', type=str, required=True, help='Portal customer account')
parser.add_argument('--password', type=str, required=True, help='Portal customer password')
parser.add_argument('--project', type=str, required=True, help='User project ID. \n')
parser.add_argument('--endpoint', type=str, required=True, help='Endpoint where the request are going to be done.\n'
'Requires protocol and port. \n'
@JorgeFrancoIbanez
JorgeFrancoIbanez / Openstack-Keyston-Auth-by-Token.py
Created June 12, 2019 20:17
Auth by token to keystone openstackRequire requests
import requests
import json
auth_payload = {
"auth": {
"identity": {
"methods": [
"token"
],
@JorgeFrancoIbanez
JorgeFrancoIbanez / Random_values
Created June 12, 2019 20:06
Create folder with X quantity of files with specific size for testing purposes
#!/bin/bash
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
echo "Usage: $0 <dir_path> <number_of_files> <block_size>"
echo "parameters"
echo " - dir_path Directory path where the tests files will be created."
echo " - number_of_files The max number of files to be created at dir_path location."
echo " - block_size The Size of each test file in Kilobyte[K], Megabyte[M], Gigabyte[G]."
else
path=$1
limit=$2