Categories
Mastering Development

how to copy an image correctly from a Raspberry Pi to a remote machine using sftp

I’m using paramiko to establish a connection, and run an existing script called grabber.py on a Raspberry pi module to capture the images continuously. Now my problem is that: sometimes the getImage function tries to read the image, while the grabber.py script is writing the image to raspberry pi module at the same time. How […]

Categories
Mastering Development

Cannot read property ‘token’ of undefined reactjs Jwt Auth

Cannot read property ‘token’ of undefined Screenshot Attached // Auth Service.js const login = (username, password) => { return axios .post(API_URL + "signin", { username, password, }) .then((response) => { if (response.data && response.data.data && response.data.data.token) { localStorage.setItem("user", JSON.stringify(response.data)); } return response.data; }) .catch((err) => { console.log("An error occured: ", err); }); }; im getting […]

Categories
Mastering Development

Can I build a serializer that validates username and email existence on is_valid call?

guys! I have this serializer class for the user model class UserSerializer(serializers.ModelSerializer): username = serializers.RegexField("^(?=.{6,20}$)(?![_.])(?!.*[_.]{2})[a-zA-Z0-9._]+(?<![_.])$") full_name = serializers.RegexField("^([a-zA-Z]{2,}\s[a-zA-Z]{1,}’?-?[a-zA-Z]{2,}\s?([a-zA-Z]{1,})?)") email = serializers.EmailField() phone = serializers.RegexField("^(\+\d{1,2}\s?)?1?\-?\.?\s?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$") class Meta: model = User fields = [‘username’, ‘full_name’, ’email’, ‘password’, ‘phone’] This is my serializer class for the moment. I want to validate that the username and email does not […]

Categories
Mastering Development

Null Pointer Exception on Accessing CrudRepository Methods

I am facing Null Pointer Exception when accessing CrudRepository method inside a class. MessageReceiverListenerImpl. I am not really able to figure out what the issue is.. Since the MessageReceiverListenerImpl instantiated inside ServiceImplI have passed SMSRepo as a parameter instead of Autowiring SMSRepo inside MessageReceiverListenerImpl. I also tried autowiring SMSRepo in MessageReceiverListenerImpl as well. Still I […]

Categories
Mastering Development

Error: Unknown authentication strategy “local” while trying to signin

I have been building this project from a tutorial. The signup functionality works fine but the login feature doesn’t work. Whenever I try logging in a registered user using postman the error I get is Error: Unknown authentication strategy "local" In the other posts on stack overflow, I didn’t find a solution to this error. […]

Categories
Mastering Development

Unable to login with MD5 encypted password in core php

I want to login with saved credentials in user table using core php, my password is saved in encrypted form in MD5 in database user table, i want to login with email and password, but when i encrypted my password while login password do not match with database table password, please help me, how can […]

Categories
Mastering Development

user_session is not working (Codeigniter, Ajax)

newbie here. I have an ajax login function. The login has no problem but the session there is. The problem I’m encountering is whenever I’m calling the session, it is not working. I used print_r($this->session->all_userdata()); to see the user_session data but I’m not getting anything with it. Is there anything I missed? Any help will […]

Categories
Mastering Development

How do I safe a asset image in a string variable?

My database have a property that I named url . And in that I wanna safe a Picture that user can upload but here’s my problem . On Register when I safe the user data including the url .I don’t let user to upload a picture . That process can be done inside the app. […]

Categories
Mastering Development

Hashicorp Packer creating windows 2019 template in Vsphpere-iso

I am in the process of creating a Packer file to create a Windows 2019 standard edition server template. The initial step works without any obvious errors and creates a template. However. when creating a new server from the template. I get the following behaviour. Open up a web console and the ctrl-alt-insert keys do […]

Categories
Mastering Development

Can’t proper read SQL table in python

I’m connecting to a Oracle database using the following code: jar = ojdbc8.jar path jvm_path = jvm.dll path args = ‘-Djava.class.path=%s’ % jar jpype.startJVM(jvm_path, args) con = jaydebeapi.connect("oracle.jdbc.driver.OracleDriver", url,[user, password], jar) The connection works fine, however the data is returned in this odd format: preview of the result The number and dates are imported correct, […]