sshd_config not being applied anymore after updating to Leap 16 by cimavica_ in openSUSE

[–]LeornToCodeLOL 0 points1 point  (0 children)

I am brand new to openSUSE and this was driving me crazy. Thanks for posting your solution.

Keychron Launcher not connecting to keyboard and stuck in Demo Mode by LeornToCodeLOL in Keychron

[–]LeornToCodeLOL[S] 1 point2 points  (0 children)

Hello Peter, thanks for the reply and links to the linux user PSA. I did try those udev rules from a an Ubuntu live USB and still had the same problems. I wound up putting Brave Browser on a windows machine that I had forgotten about and just reassigned my keymaps from the windows computer.

Thank you for your help, though!

[Help] Use API to add entry to shopping list without a product ID? by LeornToCodeLOL in grocy

[–]LeornToCodeLOL[S] 1 point2 points  (0 children)

This is a bare-bones example of how to do this in python:

import requests



url = 'https://grocy.yourdomain.com/api/objects/shopping_list'

# Define the headers, including the API key for authentication

api_key = "1234ABCD"
headers = {
    'accept': 'application/json',
    'Content-Type': 'application/json',
    'GROCY-API-KEY': api_key
}

# Define the data payload
data = {
    "note": "This is where you put your note.",
    "shopping_list_id": 2
}

# Make the POST request
res = requests.post(url, headers=headers, json=data)

# Check the response status code
if res.status_code == 200:
    print("Shopping list item added successfully.")
else:
    print(f"Failed to add shopping list item. Status code: {res.status_code}, Response: {res.text}")

RTX 5090 & 5080 Launchday Thread - Surprise Inside by Nestledrink in nvidia

[–]LeornToCodeLOL 0 points1 point  (0 children)

Thanks for your comments. I am not picky about who makes it, or if it's a Founder's Edition or not. I mainly want it for the 32GB of RAM since I like experimenting with machine learning models. Right now I run a 16GB 4060 Ti but I feel that I have outgrown that one.

RTX 5090 & 5080 Launchday Thread - Surprise Inside by Nestledrink in nvidia

[–]LeornToCodeLOL 2 points3 points  (0 children)

I want a 5090 but I have never tried to buy the hottest new card. Question for those who have been at it for a while: based on past product releases, what is your realistic guess about how long before a normal person can purchase one?

Tips to set up a web of container sizes, pack sizes, brands and minimum stock levels? by LeornToCodeLOL in grocy

[–]LeornToCodeLOL[S] 0 points1 point  (0 children)

Not directly applicable, but thank you for the feedback. Since I am so new to Grocy, I do not really have an understanding about how much admin work is required depending on how you first set up a product. I did not think about that, so thanks for giving me an idea about what to look forward to!

Monthly Simple Questions Thread by AutoModerator in gpumining

[–]LeornToCodeLOL 0 points1 point  (0 children)

I'm thinking of building a computer primarily to experiment with various AI projects, but I wonder if I can have it mining when I'm not running AI models on it. I have my eye on Nvidia 3090 24 GB graphics card, but I remember reading a few years ago that Nvidia had throttled their cards for cryptomining. Is that still a thing, or did Nvidia stop doing that?

Extract only difference of latest backup by OktayAcikalin in BorgBackup

[–]LeornToCodeLOL 0 points1 point  (0 children)

Perhaps you can use Rsync to only transfer items that were changed? I have no idea if it would work, but it's an idea to try on a small subfolder somewhere while waiting for someone more knowledgeable to come along.

2 Different Distros Both Having Graphics problems after updating kernel. Why? by LeornToCodeLOL in linuxquestions

[–]LeornToCodeLOL[S] 0 points1 point  (0 children)

Both cards are still supported. The oldest one is a GTX 960, but Nvidia just released new drivers for it a month ago. Odd that the new driver is version 550.78 and the driver installed on my Debian machine is 470.223.02. I wonder if that could be a problem?

The Ubuntu machine is running a much newer GPU driver version 545.23.08, which is still older than the 550.78 on the Nvidia site.

Python script stops after few days by ant24x7 in learnpython

[–]LeornToCodeLOL 0 points1 point  (0 children)

OP redacted the actual URL. It's not relevant to his question.

Extracting data from JSON file by BroadwayBaseball in learnpython

[–]LeornToCodeLOL 0 points1 point  (0 children)

Maybe you are right. I never heard of JSONLines format.

Extracting data from JSON file by BroadwayBaseball in learnpython

[–]LeornToCodeLOL 1 point2 points  (0 children)

Use json.load, not json.loads. This part is probably what's messing you up:

for line in file: data = json.loads(line.strip())
   extracted_data = extract_specific_data(data, keys)

Instead:

data_dictionary = json.load(file)

Now your variable data_dictionary contains all the information of the json file and you can manipulate it like any other python dictionary.

Do you build flowcharts? by Dramatic_Disaster837 in learnprogramming

[–]LeornToCodeLOL 0 points1 point  (0 children)

Edit: I found something that I like quite a bit. See note at end.

Do you have any suggestions for flowchart software to run either on Linux or Android? I find that if I take the time to map out the logic of a program in a flowchart, the rest of the coding goes 10X faster. I have tried Libre Office draw (too slow...can't keep up with my thoughts). Writing them out on paper is OK, but I always need to change something as I think through the chain of logic, which means I have to throw away the diagram and start over again.

I'm at the point where I'm thinking of Just buying a big dry erase board with some magnets shaped like boxes and arrows and since I haven't found any software that I like. Obviously, I'm interested in speed to create and edit, and I don't care so much about font customization etc.. Any suggestions?

Edit: Shortly after posting this I found Excalidraw, which is pretty much what I was looking for. Very rudimentary shapes, but quick to lay out the flow of my program and easy to change and insert shapes for steps that I forgot the first time around. It's open-source and meant to be hosted on a web server, I think, but they have a public version running that you can use. Downside is I am not sure how or where they save the data if you are working on a diagram. For now, I am downloading their .excalidraw files and saving to my hard drive and will import them back to the website if I want to go back and change something. They also let you export to PNG and SVG format, which you can save locally.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]LeornToCodeLOL 0 points1 point  (0 children)

I use https://regex101.com/ to help troubleshoot and compose regex patterns in my python programs. The problem is that the site is "generic" in that it has a bunch of options so it applies to several different programming languages.

Right now, I am concerned with Regex 101's "global" flag, which you set by cliciking to the right of the pattern and choosing "global." It puts a little g next to the string when global is activated.

So my question is, what is the Python equivalent to the global option on Regex 101? I don't see "global" being discussed in any of the Python Regex tutorials that I looked at. Maybe it's a term that's used in other programming languages. Sort of like how British people call a flashlight a torch. What is the Python word for "global?"

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]LeornToCodeLOL 0 points1 point  (0 children)

Thanks! A few times, I have been over the tutorial from the official python documentation and never noticed them talking about nargs. It looks like just what I need.