|
Regex question: I have the following bit of code that returns some json. I want to change the output to be <whatever>.sub.example.com. Normally I would be able to do this in awk, but in this particular case it needs to be handled in python and I'm not as good at python as I thought. How could I replace example.com with sub.example.com for all the dictionary entries? The filterIP bit works so I was trying to do that again, but I'm having a hard time with it. code:
|
# ¿ Apr 14, 2017 22:04 |
|
|
# ¿ May 3, 2024 14:35 |
|
I'm not actually working with strings. It's a list.code:
Methanar fucked around with this message at 23:48 on Apr 14, 2017 |
# ¿ Apr 14, 2017 23:45 |
|
The data is actually more structured like this. I gave the replace snippet a shot, but it didn't do anything.code:
code:
|
# ¿ Apr 15, 2017 00:59 |
|
Got it working as it's supposed to. I was being dumb. This is exactly what I was looking for. Thanks a lot. I learned a few things today. code:
|
# ¿ Apr 15, 2017 01:25 |
|
funny Star Wars parody posted:Yeah probably, but that would be significantly more work than my pay grade (free) haha Actually this bit would be super easy to do. apt-get install haproxy then drop in something like this code:
|
# ¿ May 23, 2017 04:00 |
|
Just use bash for windows, why worry at all about powershell?
|
# ¿ Jun 4, 2017 21:41 |
|
Is there any easy way to change some simple json to ini format? I can't find anything, but I'd like to avoid having to try and figure out how to roll my own converter if necessary.code:
code:
|
# ¿ Jul 6, 2017 21:10 |
|
Got it working, thanks for the suggestion. The important bit code:
|
# ¿ Jul 6, 2017 22:59 |
|
Loezi posted:In other words, this needs to work for non-technical users, so a workflow of "start server, go to localhost:8080, quit server when done" is too complicated. And due to <reasons> (mainly: this things does long and heavy computations) dedicated hosting is not an option. Can't you just roll these into a bash/powershell file to make it single click? Or this https://docs.python.org/3/library/webbrowser.html
|
# ¿ Jul 31, 2017 21:22 |
|
Maybe assign each person an array of weights where the index of each element relates to one of the jobs and the value of the weight relates to a preference for the job. Then run your favorite sorting algorithm to arrange everyone such that, overall, the greatest ratio of weight-preference being met is achieved. Then post sorting, do a few overrides to make sure the pairing constraint is met.
|
# ¿ Jun 2, 2018 03:24 |
|
Look into smokeping, or sensu or any other monitoring system. This isn't a wheel that needs to be reinvented. You get a lot of free stuff like integration to pagerduty, or nice clicky UIs by using an existing project that does exactly what you're trying.
|
# ¿ Nov 3, 2018 00:11 |
|
I convert yaml to json so I can actually read it
|
# ¿ Nov 22, 2018 22:45 |
|
Mongo and javascript are really cool. We have some data in a collection that is both a string and object, depending on which platform the user was on when the data was created because mongoDB lets you Move Fast and gently caress Up Your Data and the nodejs mongo driver lets it work by accident anyway. By the way go gently caress yourself if anything else needs to ever access the data
|
# ¿ Nov 23, 2018 15:45 |
|
A database whose entire appeal that lets you Move Fast and Break Things and Accelerate Developer Velocity and be Agile by letting you get away in the early days with having zero schema, plan, or interdeveloper communication about what the gently caress you're even doing is really cool and good
|
# ¿ Nov 23, 2018 15:47 |
|
if I can't grep it. Its garbage
|
# ¿ May 3, 2019 04:46 |
|
|
# ¿ May 3, 2024 14:35 |
|
Empress Brosephine posted:So I finished Python Crash Course and loved it; what should I read next to improve my skills? Get a job using it.
|
# ¿ Jun 4, 2019 01:50 |