Categories
Mastering Development System & Network

Openstack: Are components related to a keystone::project auto garbage-collected upon project deletion?

Hello dear community, in the research of how to properly delete projects and their resources via the OpenStack API I was only able to find a hint in the official python sdk, the project_purge.py (docs). Here deletion is handled for "servers, images, volumes, snapshots, backups", but not for networks, subnetworks, floating_ip, ports, which are linked […]

Categories
Mastering Development

useHistory hook inside useEffect hook create infinite loop in jest tests

I’m very annoyed since the morning cause I can’t test my custom hooks without this infinite loop… My custom hook look like : useGetObj1.tsx export function useGetObj1(): [ { obj1: IObj1 | null; obj2: IObj2 | null } | null, Function ] { const User = useSelector((state: IStoreState) => state.User); const history: History = useHistory(); […]

Categories
Mastering Development System & Network

Setting up a Django + Postgres + PgBouncer through Docker

I have an existing Django app where Django runs in a Docker container (served through uvicorn), and Postgres runs in another Docker container. In my settings.py I have DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql", "NAME": <name>, "USER": <user>, "PASSWORD": <pw>, "HOST": "db", "PORT": "5432", } } For postgres I just have FROM postgres:12.4-alpine in […]

Categories
Mastering Development

Connection test and loop in case of lost connection to prevent end of script

I have this script that runs continuously on a raspbery Zero to capture the temperatures and send them to grafana the problem is that when the grafana server is stopped for backup or something, the script falls in error and does not automatically resume so I’m looking for a way to create a connection test […]

Categories
Database Development

MySQL Transform multiple rows into a single row in same table (reduce by merge group by)

Hy, i want reduce my table and updating himself (group and sum some columns, and delete rows) Source table "table_test" : +—-+—–+——-+—————-+ | id | qty | user | isNeedGrouping | +—-+—–+——-+—————-+ | 1 | 2 | userA | 1 | <- row to group + user A | 2 | 3 | userB | […]

Categories
Mastering Development System & Network

ldapwhoami works but pam_authenticate fails with the same credentials

I’m testing the pam_ldap implementation with a C++ application. I configured ldap and pam_ldap to authenticate against a OpenLDAP server running in the same host. Created a user for testing, ldapwhoami works: ldapwhoami -vvv -D cn=carlosp,cn=users-group,ou=users,dc=example,dc=org -x -w xxxx returns ldap_initialize( <DEFAULT> ) dn:cn=carlosp,cn=users-group,ou=users,dc=example,dc=org Result: Success (0) But my application fails to authenticate the same […]

Categories
Mastering Development

PyQt5 – Can’t change proxy more than once after QWebEngineView initialized

I followed this solution and worked fine at the beginning. Connect QWebEngine to proxy But i cant change proxy again after i change it once or QWebEngineView doesnt cares it. The original code contains more than that, so i purified it to a working example to demonstrate my problem Assume our ip is "x.x.x.x", proxy1‘s […]

Categories
Mastering Development

Deinitialization order is different when creating array differently

TL;DR: Why, when the array is created together with initial values, the values are de-initialized right away, but filling the array values after the array is created produces different behavior? I’m learning Swift after JavaScript, which has GC, so the concepts of ARC and de-initialization are somewhat novice for me. To understand it deeper, I’ve […]

Categories
Mastering Development

Specific Object Save in Reducer in React Redux

I’m trying to save the reducer auth when i login. My problem is not all values in auth i want to save when i login, i only want to save infos and token. Pls check my code below authReducer const authReducer = (state = initialState, action) => { switch (action.type) { case authConstants.LOGIN_REQUEST: return { […]

Categories
Database Development

Unable to create Functions/Store Procedure Azure mySQL

I have just set up a mysql database with Azure and I am using Navicat to connect to it and everything is working fine. I am now trying to create some Funtions and Store Procs but I am getting a Super User Error: You do not have the SUPER privilege and binary logging is enabled […]