• 0 Posts
  • 21 Comments
Joined 2 years ago
cake
Cake day: June 30th, 2023

help-circle
  • So, I don’t use OpenWRT (for main router), but generally in each vlan you will need:

    • The WG interface in that vlan so all hosts can send their traffic to it.
    • DHCP server that sends the WG (local side IP) as the default route. Can also set statically on all devices. When a device on that vlan wants to send a packet to the internet it will do an ARP request for the local vlan IP then forward the IP packet to the router.
    • You will need to do some NAT as you have many private IPs for your devices in the vlan mapped to one IP given through WG. Packets that hit the WG interface should be forwarded down the tunnel with a translated source address of the local WG IP and whatever ports are in use publicly. Return packets reverse this operation.
    • Repeat for additional vlans.


  • If you’re doing a recomposition (burn fat and build muscle) then yeah, you are losing fat but gaining muscle so the scale can be misleading. Body fat % or pant size become better indicators. You may see what is referred to as a “whoosh” where every few weeks you seem to drop a few Kg over night (water weight).

    When I am doing a recomp I tend to do weigh-ins every 2-4 weeks. When cutting I’ll do it weekly.

    I’m sure that I’m in a caloric deficit. Eating more raw fruits and fibrous food like beans, more fish and less meat and fats.

    Have you done any tracking? It is a pain to do all the time but worth maybe doing it for a week just to be sure. I struggle with knowing when I am full and can easily put myself over on something high calorie like nuts.

    If no progress for a few months, lab testing may be worth it. Thyroid issues can impact weight gain and loss.

    Finally there are medications like GLP-1 (expensive in some areas) that mess with insulin production and the hunger signals in your brain that have been known to be effective.


  • BSP Tree (with custom nodes).

    With a vanilla BSP-tree you can accomplish your diagram. Simply reordering your splits can do it by making the footer and main content areas first. Better approach is to support splits on non-leaf nodes. In the example below just split the root where all its children go to the new top node and a new bottom bar leaf node is created.

    Root (split: vertical, ratio: 0.6)
    ├── Left child (Window A)
    └── Right child (split: horizontal, ratio: 0.5)
        ├── Top child (Window B)
        └── Bottom child (Window C)
    

    To access neighbors you’ll need your nodes to track their parents (double linked). Then you can traverse until all edges are found. Worst case its O(height+num neighbors that exist) if I am remembering.

    Depending on how efficient you want it to be, there are speed ups. It has been awhile, but I do remember keeping the tree as balanced as possible makes the search around log(n). Each split node keeping an index of all children in its sub-tree also reduces how much traversing is needed when you need all children after a split.

    Can get a little complicated but it is doable. That said, how many splits will a TUI have? This may be preemptive to do.

    Custom nodes is where you support some patterns that could use further optimizations. Tables that will always be a grid. Tab bars that are a 1xn grid could be a further specialized node.

    This is all about layout. Fixed/Dynamic width/height windows, padding and margins, borders, are all render processing and don’t effect the layout (unless you want reactivity). By that I mean you have windows that will split differently when the viewport is portrait or landscape and it dynamically adjusts to the window size. Sometimes with different “steps” like a square viewport may be different from both portrait or landscape or 4:3 could be treated different from 16:9.

    TUIs are not my day job but I’ve made a few in my day. Above are just my opinions from experiences. There is no “right” answer but hopefully some of this helps your journey.


    TypeScript is my day job and using a custom JSX Factory makes it pretty easy to define HTML-like interfaces for devs that can support mixing layout, render attributes, content, and app logic.

    Explicit BSP splits:

    <Split type="vertical" ratio={0.6}>
      <WidgetA />
      <Split type="horizontal" ratio={0.5}>
        <WidgetB />
        <WidgetC />
      </Split>
    </Split>
    

    Custom nodes:

    <Container>
      <TabBar>
        <Tab>Tab 1</Tab>
        <Tab>Tab 2</Tab>
      </TabBar>
      <StatusBar />
    </Container>
    

    Not sure your stack but throwing it out there as something I’ve used successfully.









  • If you knew how to start, you wouldn’t be learning anything. So, you are learning. What do you want to learn about as you learn how to architect and develop some software? Web, databases, 3d rendering, gaming, etc.

    Chances are you are going to need a framework, library, or many of both. You’ll be learning those too.

    Back to architecture. Once you have an idea of what you want to build, we want to get something running fast. Because whats going to happen is you are going to make bad decisions. Lot’s of them and that’s good! You want to fail so many times you learn what not to do, how to debug to keep things moving forward, etc.

    So start with a hello world. Serve a webpage. Connect to a database. Draw a square. Then add another and another.

    There is some quote out there that the difference between a beginner and master is the master spent X,000 hours failing. At the end of the day its just time spent learning.

    You may start over. You may switch tech stacks. You maybe give up when something more interesting comes along.

    90% of my personal projects never get completed. I’m usually learning a tool. If I’m reasonably able to use a new tool I’ve learned something. Become really good at learning. Learn to read code. Learn to read type signatures. Learn how the tools you learn work. Learn how to make them do things they were not meant to do. Learn your build system. Learn to setup linting, document your project, setup CI/CD, and so on.

    For reference I’m in my 40s. Started coding at 13. Work R&D and greenfield projects for the same fortune 100 for almost 2 decades. Done everything from web, data pipelines, network code, integrated firmware, etc. As you skill up it gets easier. My team usually picks up a new stack every project as I level them up just to expose them to different things.



  • Been forever since I used Haskell, and not used Idris (hi from scaled).

    Currently actively developing in TypeScript with the fp library Effect.

    It essentially has a tryCatch function to lift exceptions into an Effect (like an Either type). Since TypeScript doesn’t expose exceptions in the type system, its the only way to get errors from other libraries into the type system. They come in without types so we wrap them in our own errors types.



  • sloppy_diffuser@sh.itjust.workstoPrivacy@lemmy.mlGrapheneOS
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 year ago
    1. Not sure on this one.

    2. The auditor is to make sure you are installing an authentic version of graphene. That it is not a modified version that has been tampered with (e.g., backdoors).

    3. Automatically enables MAC randomization. This can help with being tracked on public networks. Fingerprinting techniques have gotten better though with deep packet inspection and even measuring radio characteristics. I’ve seen demos of two brand new and identical models of iPhones being distinctly picked out due to variances in the radios during manufacturing.

    Doesn’t help with advertisers tracking behavior based on IP. VPNs help with “blending-in” by putting multiple users behind the same IP. Provider matters here. Needs to be a VPN provider that won’t just sell your data or cave to law enforcement. Mullvad is my preference. Paid with crypto. RAM only logs. That said, use Tor or I2P for anything you don’t want subpoenaed.

    For additional tips:

    • Can’t remember if its on by default, but auto-reboot to put data at rest (encrypted and not in RAM). This is for a state-actor threat level, and less about advertisers.
    • I prefer pin codes to unlock my device and don’t use biometrics. Graphene has a feature to randomize the pin pad every time to protect against a recording of the pin be entered. Specifically where the numbers aren’t picked up on the video but the pattern your hand makes can be seen. Again, more of a state-actor threat level.



  • but I am using it not in the way it’s intended

    This is absolutely intended. Nix is a programming language, package manager, and operating system.

    Nix the package manager is intended to be used on nixos and non-nixos operating systems. It has first party support for Darwin (macOS).

    My nixos build is not daily driver ready, so I’m still on Ubuntu for my productivity systems. The majority of the Ubuntu apps I use are managed via nix using home manager at this point. These share the same configurations with my nixos systems.

    It is relatively low risk* since nix installs everything in /nix/store and sets up some env vars and user systemd services with symlinks to map to there. If I install Firefox with nix, the Ubuntu version is still there untouched. My PATH just hits nix first before the system. You have to change like one file if I’m remembering correctly after uninstalling if you want to back out which is the trigger for a nix package to come before a native package.

    • If you dip into declarative app configs (zsh, fish, nvim, etc.) you can absolutely lose the original. I tracked all that in a dotfiles repo before nix personally. Just have backups and start small.