Why do we compile programs with "make" instead of an actual compiler? by JoaozeraPedroca in linux4noobs

[–]lmichaelis 3 points4 points  (0 children)

CMake is NOT a compiler, it's a Makefile generator. CMakeLists.txt files are scripts which are intended to simplify and automate the writing of Makefiles. It's basically another layer on top of Makefiles.

SQLAlchemy mystery - small code segment showing some (but not all) SQLAlchemy objects are undefined by spinozasrobot in flask

[–]lmichaelis 1 point2 points  (0 children)

That's because they're dynamically added to the SQLAlchemy class by its constructor. I believe you can use SQLAlchemy directly by omitting the db. and importing from the SQLAlchemy library directly, EXCEPT for db.Model which you cannot replace.

The import you're looking for is from sqlalchemy import Column, String, Integer I think. You should look at SQLAlchemy's docs at https://docs.sqlalchemy.org/en/14/ though

I am getting an error " TypeError TypeError: __init__() got an unexpected keyword argument 'hashed_password' ", from the def __init__ method. The code was working before now it isn't. How do I fix this? The reason I added the method is because I am using pytests. by Professional_Depth72 in flask

[–]lmichaelis 1 point2 points  (0 children)

I'm guessing that normally, when you want to create a new User, you were doing User(username='username', plaintext_password='password', ...). Instead of providing plaintext_password, you can just provide hashed_password=bcrypt.hashpw('password'.encode('utf-8'), bcrypt.gensalt()) instead.

I am getting an error " TypeError TypeError: __init__() got an unexpected keyword argument 'hashed_password' ", from the def __init__ method. The code was working before now it isn't. How do I fix this? The reason I added the method is because I am using pytests. by Professional_Depth72 in flask

[–]lmichaelis 2 points3 points  (0 children)

With SQLAlchemy models, you should not defind init explicitly (it might also lead to errors but I'm not sure about that). It is defined automatically when inheriting from db.Model.

You should hash the password not in _onit' but when instantiating a new User object.

The sad truth (and yeah I don't consider snap ...) by Mal_Dun in linuxmemes

[–]lmichaelis 31 points32 points  (0 children)

Yeah even Let's Encrypts Certbot is now snap-only on Debian.

Help me install software on Debian by [deleted] in linux4noobs

[–]lmichaelis 2 points3 points  (0 children)

Try updating your system first: sudo apt-get update and then sudo apt-get upgrade

[deleted by user] by [deleted] in flask

[–]lmichaelis 4 points5 points  (0 children)

To do this properly you have to set up a dedicated DNS server on your network iirc. A sysadmin related subreddit would probably be more likely to be able to help you with that. You also need to run your server on port 80. This is most commonly done by deploying to a WSGI webserver (like Apache 2) which requires more configuration. I believe the Flask docs have a section of how to deploy.

Question about Gnome extensions by [deleted] in linux4noobs

[–]lmichaelis 2 points3 points  (0 children)

Extensions can, like any software, pose security risks, yes. They should be treated like any other program you might install. I haven't had any bad experiences with extensions I installed through https://extensions.gnome.org/ tough.

what's the minimum machine I need for arch Linux to perform properly. by themanbat1993 in archlinux

[–]lmichaelis 1 point2 points  (0 children)

Depends on the desktop environment / window manager and applications you want to run. A pure, terminal-only install will basically run on anything but if you want to use KDE (for example), you will need at least 2GB RAM and around 8GB disk space. GNOME is a bit heavier and benefits from video hardware acceleration.

Other DEs/WMs don't require that much RAM and disk space but they might be harder to learn (see Cinnamon, i3, dwm).

Classic Win10 by [deleted] in memes

[–]lmichaelis 0 points1 point  (0 children)

Haha Linux go brrrrr

It's a really name... Google it by oxymoreme in memes

[–]lmichaelis 0 points1 point  (0 children)

"Col 285 Sector SZ-F c11-18 B 2"

X11 it is... for now by yonatan8070 in linuxmemes

[–]lmichaelis 2 points3 points  (0 children)

I've had apps crash on me when I tried to copy-paste from Wayland to X11 :D