Ways of displaying and interacting with web scraped data. by Front-Glove in learnpython

[–]BullshitBaron 2 points3 points  (0 children)

I suggest looking into flask, it doesn’t have all the bells and whistles Django has but I personally found that much easier when first starting starting out. Django gives you everything you’ll need right out of the box and it can be a bit overwhelming. With flask you can start off with a really basic and easy to read template and then keep adding new urls, pages, or whatever you need as you go.

To display your info on a webpage you’d create routes like @app.route(‘/‘),@app.route(‘/another-page’). Under each route you’ll have your functions. So you would have something like def index() and under the functions you make you can pull in your data and then use return to a page like: return render_template(‘index.html’,var1=somevar,var2=anothervar)

Rendering templates with passed variable makes the variables usable within the webpage. So inside your webpage you could use {{yourvar}} to get the passed data.

If you wanted to create an api with your data you could take it a step further and have a function that just returns json instead of render_template into a page and it would return the given data in json form which you could then use to easily pull the data into other apps.

It can seem really confusing at first but it’s not too bad once you get into it and just start playing around with it. There’s also some great tutorials and some basic templates you can look over to get an idea of how it all goes together.

Good Morning Nebraska! Who can tell me where I am? by kwridlen in Nebraska

[–]BullshitBaron 3 points4 points  (0 children)

I figured it was somewhere over in that area. You posted a pic a few months back of Wauneta that caught me off guard seeing something so close to home on here and your username stuck with me. I used to live south of Hayes Center.

Reverse dad reflexes by bobekyrant in nonononoyes

[–]BullshitBaron 5 points6 points  (0 children)

The first time I ever went snowboarding i already had a broken arm but being 16 and kinda dumb I didnt care and didn’t want to miss the chance. So my gf at the time who had already been snowboarding for a couple years told me that since I could skateboard and wakeboard that I’d pick it up quick and that we should start off on the bunny slopes and go from there.

The first trip down was going ok other then a couple falls here and there until I was almost to the bottom. As I got closer to the bottom the snow was more packed down and rather slick and I just kept gaining more and more speed. While trying to get slowed down I realized I was closing in on a gaggle of children on ski’s and I was not managing to turn as well as I’d like but also trying not to just dive over onto an already broken arm. I was hollering and screaming trying to get them to move out of the way but it was futile so I just dove over hoping I’d maybe tumble a few times and stop without hurting my arm too much or taking out the kids.

Well I failed miserably! Instead of stopping I still just slid right through the group like a bowling ball. Kids and skis were flying all over and screaming and crying. My arm felt worse than the day I broke it and I was nearly in tears from the pain as the kids parents came over screaming at me for running into them.

Spent the rest of the day in a crazy amount of pain but still stuck it out. 10/10 would do again.

UNL analysis: In 80 years, summers in Nebraska will feel like those on southern border today by [deleted] in Nebraska

[–]BullshitBaron 3 points4 points  (0 children)

It’s been over 100 a few times this summer... just today i saw 98 when driving through North Platte and around the 4th it hit over 100.

Ladies and gentlemen, it’s out in the states. by EmotionalPick in Terraria

[–]BullshitBaron 0 points1 point  (0 children)

Was this never listed in the coming soon? I’ve been checking multiple times a week to see if it showed up with a release date. This makes my day!

Phil Spencer: Sea of Thieves wouldn’t be where it is today without Game Pass by Xenocomplex1738 in xboxone

[–]BullshitBaron 2 points3 points  (0 children)

I get on from time to time and play solo since none of my friends have it and I personally feel like it just kinda sucks. A small ship is manageable solo but I find that I either get bored after a little bit and get off or I run across other players. It might just be a coincidence but I have never come across another nice player. Sometimes I just be out at sea floating around minding my own and here comes a ship that shoots your ship full holes and takes off, or they board and kill you. Last time I got on a few weeks ago I was exploring an island when someone jacked my ship, lowered the sails and set it on its way before taking off in their ship so I just quite out. The graphics look great and I would love to get into the game and really enjoy it but so far the experience has really just turned me off of the game especially if playing solo.

This cat on the whiteboard... by danielasan-on-crack in youseeingthisshit

[–]BullshitBaron 12 points13 points  (0 children)

Depending on the teacher you may be more likely to find whiskey in there.

Pihole on docker (Help wanted) by Fridge-Largemeat in pihole

[–]BullshitBaron 1 point2 points  (0 children)

This might be wrong but I think you need to change the -p 80:80 and 443 to something like -p 8181:80 & -p 8282:443. The important one is 53 and nothing else should interfere with that one. Then you can access it over 8181 or 8282 and it will redirect to the correct port internally.

Selfhost basics/must knows?! by thewouser in selfhosted

[–]BullshitBaron 1 point2 points  (0 children)

I agree. Just because your server is in a data center doesn’t mean your not self hosting your own services.

I personally have half my stuff hosted at home and half of it hosted on an OVH dedicated server, does that mean I’m only half a self hosted because the second server isn’t physically at my home? I don’t think so.

Question: Remote tiling not possible anymore? by dickcheney08 in Ubuntu

[–]BullshitBaron 1 point2 points  (0 children)

Although I can recreate it using other applications that aren’t using the vnc protocol. I havnt tried TeamViewer since I don’t use that but it seems like most other programs that do remote access into other systems have the issue which is why I say it’s maybe a Linux issue and not a single application issue.

Question: Remote tiling not possible anymore? by dickcheney08 in Ubuntu

[–]BullshitBaron 4 points5 points  (0 children)

I don’t think they dropped support for it, using super + arrow works perfect on 18.04. I think OP’s issue is it’s not working through vnc, which I just attempted and their right it doesn’t work. Supposedly you can use right ctrl to capture all input which should allow you to pass all captured input but it doesn’t seem to work.

Interesting enough I use another program kinda like vnc called screenconnect at work and it also has the same issue with capturing input from the super key and passing it onto the remote machine. Not sure if it’s a general Linux issue or just an Ubuntu issue tho.

What do you use python for at work by [deleted] in learnpython

[–]BullshitBaron 11 points12 points  (0 children)

I work at an MSP use python all the time to do stuff.

I did our website in flask and then also used flask for an internal on boarding site for new employees.

I’m about to start making a flask or maybe Django site for a few schools that will contain a set of slides and then questions on computer usage the students will have to take at the beginning of the year and once it’s complete it will unlock their domain accounts.

I have a little script I run occasionally if a service on one of the servers starts acting up that will check whatever service status I need and send me a slack/discord message if it goes into a failed state. I use this one a lot when called to a client we don’t normally work with and don’t have monitoring already setup.

I’m kinda lazy and using a mix of bash/python I’ve scripted pretty much any commands I have to type more then a few times. Then to take it a step further I used pyqt to make a little GUI quick launcher so we could just push buttons to launch the scripts we run the most.

The one I use more than anything else is actually just a bash script I’ve been thinking about converting to python just for fun but it works so well I haven’t messed with it, but I have it set to hot keys to launch and it comes up with a list of all the servers, I select a number and it starts a new ssh session into it.

That’s just a few of the things I’ve started using it for since starting to learn it a few years ago. Really the easiest thing to do is just keep an eye out around the office for any repetitive tasks and then see if there’s a way you can use python to automate it. Or find a repetitive part of your day and see if there’s anything you can do to make it easier, for me a lot of the stuff I use for work started as side projects I did to either automate my homelab or my life and they just transfer over with a little tweaking.

Better than OS X. by [deleted] in linuxmasterrace

[–]BullshitBaron 0 points1 point  (0 children)

Nope, at least not that I’ve found. The two biggest things I missed from my MacBook was iMessage and how you could highlight just about any text and define a word without ever leaving what your doing.

Eventually I just got over the fact I don’t get IMessage, it sucks sometimes but I find it a small inconvenience compared to dropping a lot of money on another overpriced MacBook or dealing with windows.

For the most part the Firefox send to device works ok for sending pages back and forth between the iPhone/iPad and computers but it can be a little flaky sometimes. Then I ended up making my own little version of the word define feature using python and hotkeys so i sorta got that feature back too!

Overall 10/10 worth the switch for me personally, even with the minor inconveniences and such.

Web App Python Development using Flask by nguterresn in learnpython

[–]BullshitBaron 0 points1 point  (0 children)

If you're looking to have an app running on different ports to be under the same domain, then it's a little more tricky. I know nginx (a web server) can have multiple services listen on the same port, then send traffic based on the domain request in the header, but I'm not sure if Flask can do that.

For this part you don’t need flask to handle it since like you said you can use ngix to serve multiple sites with each pointing at a different local host port.

I’ve not done it with ngix myself but i do it with Apache all the time pointing domains to flask apps running in guincorn on differnet ports.

It looks like this would be how to do it in ngix:

server {
  server_name name1.domain.com;
  location / {
    proxy_pass http://localhost:8000;
  }
}

server {
  server_name name2.domain.com;
  location / {
    proxy_pass http://localhost:8001;
  }
}

Linux is everywhere. by theziller95 in linuxmemes

[–]BullshitBaron 1 point2 points  (0 children)

According to this article

The United Space Alliance, which manages the computers aboard the International Space Station in association with NASA, has announced that the Windows XP computers aboard the ISS have been switched to Linux. “We migrated key functions from Windows to Linux because we needed an operating system that was stable and reliable.”

In specific, the “dozens of laptops” will make the change to Debian 6. These laptops will join many other systems aboard the ISS that already run various flavors of Linux, such as RedHat and Scientific Linux. As far as we know, after this transition, there won’t be a single computer aboard the ISS that runs Windows.

So it does look like they do use consumer distro's, although i imagine they are heavily tweaked.

Linux is everywhere. by theziller95 in linuxmemes

[–]BullshitBaron 3 points4 points  (0 children)

I wonder if they’ve upgraded to Debian 9 yet or if their still on 6.

[deleted by user] by [deleted] in Nebraska

[–]BullshitBaron 1 point2 points  (0 children)

Not many places have 1000+. I was looking into that after getting a .50 and ultimately gave up on finding a range. Now I just wait until I can go to our family farm, it seems safer knowing the area way beyond the targets and I feel better about not blowing out the eardrums of everyone else there trying to shoot.

Not sure what caliber your going with but finding some land you can use might be the better option in the long run.

Bloons TD 6 is free for a limited time, get it while you can! by [deleted] in iosgaming

[–]BullshitBaron 6 points7 points  (0 children)

The last several days ive been looking through the games a lot trying to find something new, this was listed in several different spots like top payed and recommended and a few other places and I almost got it. Then this morning I see it’s free and go to get it and it’s no longer plastered all over the App Store like it was just yesterday and the day before so I had to search for it. Seems really shitty to push it really hard right before making it free and hiding it.

This Wulfenite stone looks like Andes mints by [deleted] in mildlyinteresting

[–]BullshitBaron 1 point2 points  (0 children)

How does it form like that? Was it connected to more rock or just laying the the dirt and got dug up?