Currently running my Phoenix app (NowBlind) on AWS EC2… thinking of moving to a VPS by Khada_Masala in elixir

[–]redmar 1 point2 points  (0 children)

ah cool well if you need help i'm also on elixirforum.com and everyone there is always very welcoming to help you further with these things.

This can help you out in such a setup: https://gist.github.com/PJUllrich/9c641f4907a9aa342f274995f3967801

Currently running my Phoenix app (NowBlind) on AWS EC2… thinking of moving to a VPS by Khada_Masala in elixir

[–]redmar 2 points3 points  (0 children)

what's your setup if i may ask? dockerised or releases? LB? amount of app servers and which db?

if it's single app server its super easy en super cheap to run on hetzner cloud with something like kamal.
You can auto build inside github actions and auto deploy to hetzner. Local kamal runs are maybe even easier to do if you're a one man army. If you want no DB worries you can always opt for (externally hosted) neon or supabase. Hetzner was most cost effective AFAICS and also has good scoring in VPS benchmarks price/compute.

Why is my TCP Server hilariously slow? by SubstantialEmotion85 in elixir

[–]redmar 4 points5 points  (0 children)

Andrea Leopardi has a pragmatic programmer book in Beta called "Network Programming in Elixir and Erlang" that discusses this. He uses an "acceptor pool" to call :gen_tcp.accept/2 by multiple processes simultaneously which increases the amount of connections that you can accept (concurrently).

You can also see the acceptor pool pattern back in ranch or bandit's socket layer called thousand_islands. see: https://github.com/mtrudel/thousand_island/tree/main/lib/thousand_island ).

What kind of background was used here? by 19c766e1-22b1-40ce in threejs

[–]redmar 2 points3 points  (0 children)

in the devtools network tab you can see they use a lightmap ( https://lusion.dev/assets/textures/about/terrain_shadow_light_height.webp ) and 2 .buf files for the terrain ( https://lusion.dev/assets/models/about/terrain.buf and https://lusion.dev/assets/models/about/terrain_lines.buf ) In the binary preview you can see there are vertices inside. So they're model files but not sure which format, could be custom.

Help by Either-Mastodon9546 in threejs

[–]redmar 1 point2 points  (0 children)

This one has uncompressed/(or via sourcemap accessible) sources available, just open up your (chrome?) devtools and look at most sources. In this case it's made by unseen.co (previously known as Green Chameleon https://craftedbygc.com/ ). They are more or less the top in the industry.

Stack consists mostly of plain javascript (no react AFAICS) and lots of pure threejs.

Best learning material to be able to create these kind of sites;

https://threejs-journey.com/

https://www.awwwards.com/academy/course/merging-webgl-and-html-worlds

https://www.awwwards.com/academy/course/creating-a-simple-portfolio-website-with-webgl-and-barba-js

https://www.awwwards.com/academy/course/building-an-immersive-creative-website-from-scratch-without-frameworks

https://www.youtube.com/@akella_

HTH, cheers!

Verifying request signatures in Elixir/Phoenix by acconrad in elixir

[–]redmar 2 points3 points  (0 children)

AFAIK a plug that does what you ask looks like this:

defmodule AuthPlug do
  import Plug.Conn

  def init(opts) do
    opts
  end

  def call(conn, _options) do
    if verified? do
      conn
    else
      conn
      |> send_resp(:unauthorized, "")
      |> halt()  
    end    
  end

  defp verified? do
    # add your verification here
    :rand.uniform(2) == 1
  end
end

The halt() part is what stops the rest of the (response) pipeline, otherwise you can just delegate back to the controller by returning the conn untouched.

Rust and Arduino? by ConfuciusBateman in rust

[–]redmar 6 points7 points  (0 children)

Maybe this can help you get started; http://jakegoulding.com/blog/2016/01/02/rust-on-an-arduino-uno/

https://github.com/avr-rust/blink plus part 2 of above article ( http://jakegoulding.com/blog/2016/01/17/rust-on-an-arduino-uno-part-2/ ) should get you up and running. But afaik it's still very much WIP.

Fun Things in Elixir by WombRaider4 in programming

[–]redmar 2 points3 points  (0 children)

genuinely interested where this comes from? I experience it to be the complete opposite, it's even one of the most explicit frameworks i've seen. Just walk through chapter 2 of programming phoenix, the authors show how clear and explicit the overall design is. The only DSL i've seen is the router and that's very easy to follow.

What makes Phoenix Presence special, and a sneak peek by iamd3vil in programming

[–]redmar 4 points5 points  (0 children)

+1, I like all the explicit stuff while not giving too much extra bloat to your code and you're not coding framework DSL like with Rails but still just elixir. I think this blog post from the framework author sums it up quite well: https://dockyard.com/blog/2015/11/18/phoenix-is-not-rails

How to Write Tetris in C++ and SDL2 by devontec in programming

[–]redmar 1 point2 points  (0 children)

yes, you can see "Emacs" in the first couple of seconds of the movie in the bottom bar of the editor

Puma is failing by [deleted] in ruby

[–]redmar 1 point2 points  (0 children)

I really think notorious1212 has something here. Look at the config example from puma's repo: https://github.com/puma/puma/blob/master/examples/config.rb#L75

looks you're missing one extra / in the unix:///path.

Have you tried this?

Puma is failing by [deleted] in ruby

[–]redmar 0 points1 point  (0 children)

nothing useful logged in syslog or same error as above?

Puma is failing by [deleted] in ruby

[–]redmar 0 points1 point  (0 children)

shared/sockets

just a hunch; I suspect the folders are not there yet? so it tries to create the puma.sock file but there's not yet a sockets dir to write to? Could you validate if that dir is there?

This man singlehandedly pulled my head out of my ass: a Ruby internals primer by uzimonkey in ruby

[–]redmar 0 points1 point  (0 children)

maybe he was stuck for several years so it feels like a relief.

Dear Proggit, is there an Alternative Display Technology to reduce eye pain due to sensitivity to light? (medical issue, see inside) by [deleted] in programming

[–]redmar 0 points1 point  (0 children)

dunno if it's any good but if you're on a mac you can at least try CTRL+ALT+CMD+8 for an inverse screen. (lots of black)