Monday, September 10, 2018

AES encryption

I cannot run queries using encryption from MySQL workbench. I need to run them from the mysql console.

SELECT id,AES_DECRYPT(firstname,UNHEX(SHA2('key',512))),AES_DECRYPT(lastname,UNHEX(SHA2('key',512))),AES_DECRYPT(email,UNHEX(SHA2('key',512))),AES_DECRYPT(password,UNHEX(SHA2('key',512))) FROM user WHERE     AES_DECRYPT(lastname,UNHEX(SHA2('key',512))) LIKE '%lee%';

mysql -h 127.0.0.1 -u root -pXXXX -e "SET block_encryption_mode = 'aes-128-cbc';SET @enc_key='mywhateverkey';SET @bytes='0000000000000000';SELECT g.id,g.flag,AES_DECRYPT(FROM_BASE64(gc.firstname), @ENC_KEY, @BYTES) FROM guest AS g, guest_capa AS gc;" app_v2_e > i9011.db

Friday, July 20, 2018

pytest


pytest tests/test_api_extract.py::TestApi::test_db_source

.

Wednesday, November 15, 2017

spyder python editor

spyder installed through anaconda

autocompletion  works in the spyder console ( )
but doesn't work totally in the editor part  ( )

https://stackoverflow.com/questions/42777430/why-autocompletion-options-in-spyder-3-1-are-not-fully-working-in-the-editor/42789884#42789884

https://pythonhosted.org/spyder/overview.html

--------- to have autocompletion work with Python3 on Mac (anaconda install)
pip install rope_py3k
.

Saturday, July 1, 2017

jackson


JSON parser

codehaus   Jackson 1
fasterxml  Jackson 2


Friday, June 30, 2017

Solr 6 and above



  • if you want to use a static schema.xml, add this in your solrconfig

< schemaFactory class="ClassicIndexSchemaFactory"/ >



Thursday, June 22, 2017

alpine in a docker container

Take the case where you loaded a docker image from somebody else or from a repository and a user was specified in the dockerfile during the docker image creation. Now, you want to install something in this alpine container and need root privilege to do this.

you can check the user field in the image dockerfile by doing
docker inspect  solr:6.6.0-alpine 
If the value of the field "user" is something else than empty or root, you won't have root access to the container to install things. Either you can execute something in the existing container as "root" user:
docker exec --user root -it 008d1946ddf8 bash
Or you can generate a new container from the docker image with the root user .
docker run -it --user root solr:6.6.0-alpine
If you commit this new container, the newly generated image will have the "root" user in its dockerfile.

bash-4.3#   apk update
bash-4.3#   apk add curl