13 votes

What programming/technical projects have you been working on?

This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?

30 comments

  1. [3]
    apatheticattitude
    Link
    I have been working on setting up a PXE server alongside a customised Linux image to boot into over the network. It's been a fun learning experience involving delving into all sorts of different...

    I have been working on setting up a PXE server alongside a customised Linux image to boot into over the network.

    It's been a fun learning experience involving delving into all sorts of different areas. The PXE server uses a wonderful rube goldberg machine of DHCP, TFTP and HTTP to eventually get to where it need to be. The most complex part for me was figuring out how to supply the Linux kernel and small filesystem to load over the network.

    It's all working wonderfully as of the start of this week and I've been going over my notes to make sure I know how I would replicate/redo the task but much more efficiently if needed.

    8 votes
    1. [2]
      vczf
      Link Parent
      PXE is one of those things I know exists, but seems like arcane black magic. (I've never had a good reason to try to understand it and set it up.) If you're compiling notes on your process, I'd...

      PXE is one of those things I know exists, but seems like arcane black magic. (I've never had a good reason to try to understand it and set it up.)

      If you're compiling notes on your process, I'd love to read about how you did it. Not to replicate, but just out of casual interest.

      3 votes
      1. apatheticattitude
        Link Parent
        I probably should write something up for public consumption. It would be a good exercise if nothing else. I did piggy back off of netboot.xyz who provide the initial boot environment and do most...

        I probably should write something up for public consumption. It would be a good exercise if nothing else.

        I did piggy back off of netboot.xyz who provide the initial boot environment and do most of the actual arcane magic. They have good support for customisation and self-hosting which was important to me.

        3 votes
  2. [3]
    chundissimo
    Link
    I’m trying my hand at game development in Godot. I’ve given various frameworks a go in the past but I’ve always hit some sort of wall. Love2D was very easy to hit the ground running with, but Lua...

    I’m trying my hand at game development in Godot. I’ve given various frameworks a go in the past but I’ve always hit some sort of wall. Love2D was very easy to hit the ground running with, but Lua just doesn’t seem meant for building a game engine beyond very simple purposes.

    I don’t necessarily love GDscript but as a Python developer it feels fairly intuitive and it’s miles better than Lua. I didn’t want to try C# because despite knowing some I wanted to avoid learning two things at once.

    I tried Unity before and felt that a graphical IDE for game development just wasn’t how my brain worked. But I understood the massive upsides to that approach, so I made a conscious effort to understand Godot. It’s been a struggle, but I finally feel like I’m starting to slightly understand how it works and my development speed is increasing.

    8 votes
    1. [2]
      Cyber
      Link Parent
      I'd really like to get into Godot. I'm working on a game for the jam hosted by Pirate Software at the moment and I'm using LibGDX since I have a lot of experience with Java. Coming from that type...

      I'd really like to get into Godot.
      I'm working on a game for the jam hosted by Pirate Software at the moment and I'm using LibGDX since I have a lot of experience with Java. Coming from that type of workflow where you have to mostly build everything yourself, I've found using Godot to be... strange. I feel like it will probably just take some time to adjust to how things are different, but after seeing some of the things Godot is capable of, I think it's going to be worth the effort.

      1 vote
      1. chundissimo
        Link Parent
        Yeah I totally agree with your sentiment. I think it’s true for a lot of people like myself who have programming experience but not much game development experience. I just forced myself to stop...

        Yeah I totally agree with your sentiment. I think it’s true for a lot of people like myself who have programming experience but not much game development experience. I just forced myself to stop being stubborn after experiencing the many downsides of building everything myself.

        But, the build it all yourself approach works for some people. Stardew Valley’s creator, ConcernedApe, went that route but he also said he regretted it due to the amount of time it took and wished he had used a game engine (although I don’t know if meant something like Unity/Godot).

        The thing that helped me with Godot’s weirdness was trying to build a tiny thing that wasn’t just a tutorial, and watching videos of developers. There’s a lot of things experienced Godot developers understand that I feel the docs don’t fully explain. For example, when to use certain nodes and how to structure scenes.

        3 votes
  3. [5]
    supported
    Link
    As a parent of two kids I really want to whitelist the internet for my kids. I'm been trying to build an easy to maintain proxy that I can filter their internet through. I always want this...

    As a parent of two kids I really want to whitelist the internet for my kids.

    I'm been trying to build an easy to maintain proxy that I can filter their internet through. I always want this whitelist to have a custom home page that lists all the pages they can access. So far not much success in getting it running.

    7 votes
    1. vczf
      Link Parent
      If you want to cultivate a hacker mindset in your kids, it might be fun and educational to set up progressively more difficult barriers. (Depending on age, of course. Probably not appropriate...

      If you want to cultivate a hacker mindset in your kids, it might be fun and educational to set up progressively more difficult barriers. (Depending on age, of course. Probably not appropriate until middle school and higher.)

      5 votes
    2. brogeroni
      Link Parent
      Hmm, what about as a chrome extension? What are your thoughts?

      Hmm, what about as a chrome extension? What are your thoughts?

      2 votes
    3. [2]
      Father_Redbeard
      Link Parent
      I haven't approached it the way you're talking about, but have you looked into AdGuardHome? I run two instances, one on a Pi as primary DNS for the house and another on my main server as backup....

      I haven't approached it the way you're talking about, but have you looked into AdGuardHome? I run two instances, one on a Pi as primary DNS for the house and another on my main server as backup. The primary use case for AGH is ad-blocking for the entire network. But it has quite a few controls regarding blocking specific services, blacklisting, and whitelisting based off device/IP (I think you'll have to use it as DHCP to do per IP function though. Without it all traffic looks like it's coming from your gateway IP regardless of who or what device. It has some services you can block outright instead of trying to catch and blacklist all the various domains a service might use. Like my spouse asked that I block TikTok to help with her addiction that she sometime falls into with it. And that's worked pretty well. Might not be exactly what you're looking for though.

      1 vote
      1. supported
        Link Parent
        I had reviewed several of these pre-made products and none matched exactly what I wanted, but I will take a closer look. After tinkering with my own for a while .. it would indeed save me some...

        I had reviewed several of these pre-made products and none matched exactly what I wanted, but I will take a closer look.

        After tinkering with my own for a while .. it would indeed save me some headache to use an existing solution.

        1 vote
  4. [2]
    Comment deleted by author
    Link
    1. mayonuki
      Link Parent
      I’m going through this at the moment as well. I’m curious what questions you might have about initializers? I’m new to SwiftUI, but I have been working with UIKit since before Swift was around.

      I’m going through this at the moment as well. I’m curious what questions you might have about initializers? I’m new to SwiftUI, but I have been working with UIKit since before Swift was around.

  5. [6]
    UP8
    Link
    I haven’t reported here in at least a month because I’ve been busy with other things and probably spending too much time playing Asgard’s Wrath 2 on my Meta Quest 3. I’m resuming work on my RSS...

    I haven’t reported here in at least a month because I’ve been busy with other things and probably spending too much time playing Asgard’s Wrath 2 on my Meta Quest 3.

    I’m resuming work on my RSS reader YOShInOn. I collect articles in my “favorites” and can then click a button to submit them to Hacker News or Mastodon. Either way I want to collect a bunch of articles when I have time and then post them slowly. I have an “autoposter” for HN which has a nice queue implementation that won’t post anything until my last post clears the “new” page. So far Mastodon posts are made immediately. I believe people would not engage well with my toots if I regularly dropped 5 in a row (some very good posters annoy me by doing this). So right now I’m in the middle of cloning my queue implementation so I can autopost to Mastodon. (I’m still wondering about “What is an optimal posting rate?”). In a perfect world I might refactor the implementation so I could share the code for both queues, but since I don’t want to break a system which is running I think I’m going to clone first and then refactor. Adding a button to share with friends via email is on the agenda too because I definitely find articles I want to share with my son and my wife.

    Other than that I also want to get into WebXR development, I was trying to view some GLTF files of the Mars surface generated from the Pathfinder rover on my MQ3 and was only successful with one (a boulder I’d like to put in a virtual museum.) I think now the other ones might have just been too big for the standalone headset to support so I really gotta plug the link cable into my “gaming” PC (that my son calls an AI PC) to see if I can handle bigger files in PCVR.

    6 votes
    1. [5]
      brogeroni
      Link Parent
      Would you be willing to share your code for the auto poster?

      Would you be willing to share your code for the auto poster?

      1 vote
      1. [4]
        UP8
        Link Parent
        Take a look at this code https://davidbieber.com/snippets/2020-05-02-hackernews-submit/ which was the basis for mine. I've tried to do it with aiohttp but never got it to work so I am stuck using...

        Take a look at this code

        https://davidbieber.com/snippets/2020-05-02-hackernews-submit/

        which was the basis for mine. I've tried to do it with aiohttp but never got it to work so I am stuck using requests.

        2 votes
        1. [2]
          bugsmith
          Link Parent
          Have you tried HTTPX? I much prefer it to aiohttp, and has a much more similar API to requests.

          Have you tried HTTPX? I much prefer it to aiohttp, and has a much more similar API to requests.

          1. UP8
            Link Parent
            I think I might. I’m pretty sure there is something different about headers and maybe HTTPX will ‘just work’. Definitely having both sync and async APIs is a great idea which can be implemented...

            I think I might. I’m pretty sure there is something different about headers and maybe HTTPX will ‘just work’. Definitely having both sync and async APIs is a great idea which can be implemented with metaprogramming easily but unfortunately few people believe it.

  6. arqalite
    (edited )
    Link
    My NexDock arrived (finally), and I'm loving it so far. Online reviews claimed the touchpad was terrible, either they improved it in the meantime, or the reviewers are pretentious - for me it's...

    My NexDock arrived (finally), and I'm loving it so far. Online reviews claimed the touchpad was terrible, either they improved it in the meantime, or the reviewers are pretentious - for me it's definitely not as accurate or as pleasant to use as a high-end laptop touchpad, but it's very usable.

    Besides that, it feels high-quality, looks great and works perfectly. My only complaint is that the battery drains pretty quickly. They claim 7 hours of battery life, but I'm 99% sure that's at minimum brightness, with reverse charging disabled. I've got about 3 hours myself, but they did mention twice that the battery needs 4 full charge-discharge cycles before reaching full performance. This is the first charge, so who knows, but I wouldn't expect it to suddenly reach 7 hours after 4 charges, lmao.

    This all means my Samsung DeX setup is much cleaner and lighter, and portable too. I never tried to lug around a portable monitor and Bluetooth mice and keyboard, so most of my computing was done at home, or via DeX on Windows where applicable.

    The next goal for my setup was gaming. I decided to drop PC gaming except Minecraft, and focus on emulation instead.

    Since we're on an ARMv8 device, Switch emulation fits perfectly, and Pokemon Let's Go Eevee runs smoothly via Yuzu. 4 badges in already, very few issues. Only notable one is infrequent crashing when switching tasks from Yuzu to Chrome or any other app.

    After Pokemon I'm going to finally play Zelda:BotW, I'm excited.

    EDIT: After further testing (and charge-discharge cycles) I can reach 4 hours when connected wirelessly. About 5 when connected wired via USB-C, but drops to 2.5-3 hours when phone charging is enabled. All this at 50% brightness.

    This was also confirmed by NexDock support, that I shouldn't expect more than 3 hours with charging enabled. This IMO should be clearly mentioned on the website, next to their 7 hours claim (which I still can't reach), but whatever. At least my device isn't defective.

    6 votes
  7. [2]
    Power0utage
    Link
    My current side project may be the best example of "when all you have is a hammer..." ever. Since I use PHP/Symfony daily and can develop very quickly with it, and I very much enjoy tinkering with...

    My current side project may be the best example of "when all you have is a hammer..." ever.

    Since I use PHP/Symfony daily and can develop very quickly with it, and I very much enjoy tinkering with MUDs (they happen to be the source of my childhood promotion from Qbasic to C...), I've been working on a Symfony-based MUD server.

    It's crazy and illogical, I know.

    But the further I go down this road, the more interesting and cool benefits I find. For example,

    • Symfony is meant to be a webserver first and foremost, so the MUD server also comes with a complete web frontend, using Symfony authentication, EasyAdmin for backend management, Symfony config, and even using Twig templates to render in-game things like score, help, etc. The MUD Server itself can be hosted via telnet or websockets. With the latter, the webserver provides a "terminal" to play the game directly in the browser.
    • Symfony also has a great console component with awesome logging, so all of the CLI stuff has been a breeze.
    • Symfony makes building components/plugins very easy and configurable, so you could download the base MUD and then attach a bunch of third-party packages for things like weather, combat, Discord, etc.

    I've tried to adhere to Symfony's design philosophy as much as possible, and I've tried to stick to using a Symfony component if one exists.

    As far as progress goes, I've got a pretty great working version right now (you can build a world, fight mobs, level up, equip gear, cast spells) and I'm working on some niceties like adherence to various MUD protocols, building tools to import areas from other types of MUDs, etc.

    What's my end game? I have no clue. I think it's fun to build MUDs with Symfony, and maybe there are one or two others in the world that agree... or maybe not.

    4 votes
    1. HelpfulOption
      Link Parent
      This sounds like a really neat project! There's still an active niche of MUD players and developers, and in my experience especially so in the Blind and Visually Impaired community. If your web...

      This sounds like a really neat project!

      There's still an active niche of MUD players and developers, and in my experience especially so in the Blind and Visually Impaired community. If your web components implement aria tags, or if someone can build a game entirely with CLI, you might find an audience with some passionate, game-starved devs and players.

      2 votes
  8. Toric
    Link
    Have partly assembled my ferris sweep keyboard. The mcu and pcb, and misc parts have arrived and been soldered, now im just waiting on the keyswitches to arrive sometime later this month.

    Have partly assembled my ferris sweep keyboard. The mcu and pcb, and misc parts have arrived and been soldered, now im just waiting on the keyswitches to arrive sometime later this month.

    3 votes
  9. [3]
    Weldawadyathink
    (edited )
    Link
    I spent the last month or so rewriting my website AudiobookCovers.com from scratch. It’s not entirely new code, but I started from zero and only reused code as a starting point for the new...

    I spent the last month or so rewriting my website AudiobookCovers.com from scratch. It’s not entirely new code, but I started from zero and only reused code as a starting point for the new version. It has been a fantastic learning opportunity for cloud and serverless infrastructure.

    It now uses actual aws s3 for storage and processing. I went with s3 for this because of the tight integration with aws lambda, and how easy it is to write and modify lambda code. I have a lambda function that ingests images from one bucket, renders a number of sizes and formats, and saves them to another bucket. For the actual hosting and distribution, I use cloudflare R2 with the new Sippy feature. This way I pay only for storage in s3, and r2 acts as an indefinite caching server for s3.

    I use algolia as my search (and general purpose) database. Each image is run through google cloud vision api, and the ocr text is saved to algolia. The OCR is okay enough to provide somewhat good search. My previous iteration used mysql fulltext search, and algolia is giving way better search capabilities than mysql did.

    The feature that I am most proud of is something I only thought of/learned about last Friday: OpenAI CLIP. This is an ai model that provides a 512 dimension vector from image and text queries, with a shared vector space. I was inspired by the rclip project which provides really good search capabilities using CLIP for local image files. I build something similar for my website. I decided to use pineconeDB for my vector database. Since the free tier pinecone is hosted in GCP us-central1, I decided to use google cloud run for this part of my api. I host a private api using cloud run that takes a text query and returns the unedited pineconeDB response.

    I host my API in cloudflare workers. I've been using CF workers for a while now, and I really like how well they work for lightweight APIs. My api, depending on the endpoint, will query algolia search or my cloud run api, then format and return the response. The rest of the project is just a simple static website hosted in cloudflare.

    I am really impressed with how flexible and powerful the clip and vector based search is. It actually works for images without text. In fact, I found out that my dataset had images without text from this search.

    There are still a bunch of improvements I want to make, but I am really proud of this project so far. This iteration is much better and more powerful than my original public release last May. Also it seems like it is going to be cheaper to run. Source code available here

    3 votes
    1. [2]
      danke
      Link Parent
      You need to include the https:// scheme in hyperlinks or they're interpreted as relative paths.

      [AudiobookCovers.com](audiobookcovers.com)

      You need to include the https:// scheme in hyperlinks or they're interpreted as relative paths.

  10. ogre
    Link
    I spent the last couple of months working on a website to process and analyze data from Smite’s public api. Their api request form asks for a link to your site so I got to work on an mvp. I built...

    I spent the last couple of months working on a website to process and analyze data from Smite’s public api. Their api request form asks for a link to your site so I got to work on an mvp. I built it using Django rest framework, postgresql, and a Vue SPA for the front end. These are all things I had never used before because I like learning new things.

    However, by the time I got to a place where I felt comfortable with the basic design and behavior they had closed their api request form until further notice. Then the next day they announced Smite 2, a complete overhaul to most of the systems I was going to analyze. It’s a bit of a bummer to hang in limbo now but at least I learned a lot. There’s some kinks in the site I was looking forward to ironing out but I can’t find the motivation when api access is up in the air.

    1 vote
  11. [3]
    xk3
    Link
    I made two things over the past few days: linksdb: This one combines a few different tools that I made before so this only took a couple hours once all the pieces were in place. This tool helps...

    I made two things over the past few days:

    linksdb: This one combines a few different tools that I made before so this only took a couple hours once all the pieces were in place. This tool helps save new links from generic paged websites and stops pagination after 10 pages of no new links. All the magic numbers that it uses are configurable via CLI flags.

    extract-text: This one is pretty simple. Just remove non-text stuff from HTML. At first it was a bit tricky because I wanted to iterate over HTML in a flat way but that is not really possible... However, after some exploration I was able to get beautifulsoup to do roughly what I wanted:

        for descendant in item.descendants:
            if isinstance(descendant, NavigableString):
                parent = descendant.find_parent()
                parent_name = parent.name if parent else None
    
                if parent_name == "a":
                    if not args.skip_links:
                        yield un_paragraph(descendant)
                else:
                    yield un_paragraph(descendant)
    

    This allowed me to select and copy a bunch of reddit threads and then cluster similar movie suggestions together:

    lb extract-text --skip-links --local-file (cb -t text/html | psub) \
       | lb cs --groups | jq -r '.[] | .grouped_paths | "\n" + join("\n")'
    
    1 vote
    1. [2]
      bugsmith
      Link Parent
      Unsolicited code review :D if parent_name == "a": if not args.skip_links: yield un_paragraph(descendant) Could be simplified to: if parent_name != "a" or not args.skip_links: yield...

      Unsolicited code review :D

      if parent_name == "a":
          if not args.skip_links:
              yield un_paragraph(descendant)
      

      Could be simplified to:

      if parent_name != "a" or not args.skip_links:
          yield un_paragraph(descendant)
      

      (Although there's really nothing wrong with the way you've done it.)

      1 vote
      1. xk3
        Link Parent
        yeah I prefer to keep it as-is because I might add some more conditionals there in the future elif etc but thanks for taking a look! always nice to have another pair of eyes

        yeah I prefer to keep it as-is because I might add some more conditionals there in the future elif etc

        but thanks for taking a look! always nice to have another pair of eyes

        1 vote
  12. Pavouk106
    Link
    I posted a comment a week ago about making ~150Wh battery from old li-ion batteries of somekind of GPS or other. The battery would be used as an energy pool of solar charger of all family smart...

    I posted a comment a week ago about making ~150Wh battery from old li-ion batteries of somekind of GPS or other. The battery would be used as an energy pool of solar charger of all family smart crap (phones, watches, tablets, headphones...).

    Through the week I did the charger part of the project which involved 3 DC/DC converters and 3 dual USB-A ports in a box. I added LED for each USB port as I have a fuse for each one and I want to see if theport has voltage or not. As an input I opted for barrel jack connector and later realized this box can be perfectly standalone and added 20V USB-C trigger board as second input. If I take USB-C charger (ie. from ky Stea Deck or laptop's one) and this charger box, I have 6 ports to use anywhere.

    I amost fnished the battery box too. I have added inout and output jacks and DC/DC converter which goes between battery and solar and keeps the voltage on solar in effective region while also stepping it up to battery's voltage. I will add MOSFET switching on the output as the converters in charger box idle at 25-30mA each (not dependent on voltage actually) which means around 2W at battery's voltage which is not insignificant amount.

    This is how it went so far