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 / 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
@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"
],
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'
#!bin/python
import bcrypt
hash = b"Thistextwillbehashed"
hashed = bcrypt.hashpw(hash, bcrypt.gensalt())
print(hashed)
@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
@JorgeFrancoIbanez
JorgeFrancoIbanez / Python-connections
Last active June 13, 2019 14:55
Python connections to databases
Python connections to databases
@JorgeFrancoIbanez
JorgeFrancoIbanez / print-trove-datastore-version-flavors.py
Created June 13, 2019 18:51
Openstack retrieve datastore version of a single datastore and print it
from keystoneauth1.identity import v3
from keystoneauth1 import session
from troveclient.v1 import client as Trove
resources = {}
class Auth:
def __init__(self):
username = "username"
password = "password"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDatabase\pci#ven_1af4&dev_1001&subsys_00000000]
"Service"="viostor"
"ClassGUID"="{4D36E97B-E325-11CE-BFC1-08002BE10318}"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDatabase\pci#ven_1af4&dev_1001&subsys_00020000]
"Service"="viostor"
"ClassGUID"="{4D36E97B-E325-11CE-BFC1-08002BE10318}"
@JorgeFrancoIbanez
JorgeFrancoIbanez / ubuntu14.04
Last active August 6, 2019 16:34
SSH KEY cOnfuiguration for only ssh access
#!/bin/bash
for i in $(grep "^[^#;]" /etc/ssh/sshd_config); do
echo $i
for s in ChallengeResponseAuthentication PasswordAuthentication PermitRootLogin X11Forwarding;do
echo $s
if [[ $i == "$s"* ]]; then
echo $i;
echo $s;
sed -i "s/$s .*/$s no/g" /etc/ssh/sshd_config;
fi;
#!/bin/bash
for i in $(grep "^[^#;]" /etc/ssh/sshd_config); do
echo $i
for s in ChallengeResponseAuthentication PasswordAuthentication PermitRootLogin X11Forwarding GSSAPIAuthentication;do
echo $s
if [[ $i == "$s"* ]]; then
echo $i;
echo $s;
sed -i "s/$s .*/$s no/g" /etc/ssh/sshd_config;
fi;