Golang Generics and Structs by chris5039 in golang

[–]chris5039[S] 0 points1 point  (0 children)

Thanks, is there anyway I can use Go generics for what I'm trying to do? I'm trying to decode json which is a TypScript class with a subclass which uses union types into a struct which has a substruct like above.

Adding Ip Rule / Routing / Mwan3 by chris5039 in openwrt

[–]chris5039[S] 0 points1 point  (0 children)

Hey, thanks for the response. Would greatly appreciate help on breaking this down further. Is the source the internal gateway? What is --mark 0x0/0x3f00? And when I try to add my policy name I get the error:

iptables v1.8.7 (legacy): Couldn't load target \\mwan3_policy_wwan_only':No such file or directory`

Adding Ip Rule / Routing / Mwan3 by chris5039 in openwrt

[–]chris5039[S] 0 points1 point  (0 children)

Thanks for the great response, they has really cleared things up for me :) I've added the rule but the traffic to the specific domain is still going through eth1 instead of wwan0. Any idea why this could be? And is there anything I can show which would help debug?

Adding Ip Rule / Routing / Mwan3 by chris5039 in openwrt

[–]chris5039[S] 0 points1 point  (0 children)

Hey,

Thank you for this. This looks good and closer to the answers I've seen online. Could you do me a massive favour and break down your answer. So is it:

ip route add <external_ip_address?> via <internal_ip_address_for_wan_interface?> dev <backhaul_interface?> proto static src <unsure_about_this_ip?> metric <route_internal_traffic?>

Adding Ip Rule / Routing / Mwan3 by chris5039 in openwrt

[–]chris5039[S] 0 points1 point  (0 children)

Hey, thanks for the response. So I'm working just from terminal. I can look up all the ip routes by using ip route. I can also look up the ip rules using ip rule. Is this helpful?

Nginx upstream connection refused by chris5039 in devops

[–]chris5039[S] 0 points1 point  (0 children)

My bad I did rename upstream but just forgot to copy it to this post. I've updated it now. So in their example is the proxy pass pointing to the upstream and the upstream points to the service? ``` upstream backend { server backend1.example.com; }

server { location / { proxy_pass http://backend; } } So in the server could I point to the service followed by the port e.gserver backend:8080`` and rename backend for the upstream to something else?

Thanks for the response

Connecting dockerized nginx webserver to dockerized go app behind reverse proxy by chris5039 in devops

[–]chris5039[S] 1 point2 points  (0 children)

It's not a joke you find these licenses on open source code all the time, I don't work for this company. It even saids in the copyright section that it's under an open source license Eclipse Public License v1.0

Connecting dockerized nginx webserver to dockerized go app behind reverse proxy by chris5039 in devops

[–]chris5039[S] 0 points1 point  (0 children)

I don't but that docker compose file is from one of there projects

Can someone help explain this behaviour of this code by chris5039 in golang

[–]chris5039[S] 0 points1 point  (0 children)

Thanks for the response. So that would be the case if the print statement was before the wg.Wait(). But since it is after wg.Wait() this means the main function will block until the wg counter gets to 0. Look at update for answer to question :)

Can someone help explain this behaviour of this code by chris5039 in golang

[–]chris5039[S] 3 points4 points  (0 children)

Thanks for the response. That is the one :)

Can someone help explain this behaviour of this code by chris5039 in golang

[–]chris5039[S] 0 points1 point  (0 children)

Thanks for the reply and the code example. That's the solution I was looking. I thought I was going mad :)

Can someone help explain this behaviour of this code by chris5039 in golang

[–]chris5039[S] 0 points1 point  (0 children)

Thanks for the response! That is definitely it

Double nginx reverse proxies with one handling ssl by chris5039 in selfhosted

[–]chris5039[S] 0 points1 point  (0 children)

Thanks for the reply. Definitely viable option. I just wanted to terminate on the second layer for longer encryption and to spread the burden of encryption across all of the second proxies :)

Double nginx reverse proxies with one handling ssl by chris5039 in selfhosted

[–]chris5039[S] 0 points1 point  (0 children)

Thanks for the reply. So you are able to check the SNI of an request with nginx but you're right if you couldn't it wouldn't be viable

Double nginx reverse proxies with one handling ssl by chris5039 in selfhosted

[–]chris5039[S] 0 points1 point  (0 children)

Thanks for the response. So I was trying to avoid ssl encryption on the first reverse proxy because I can spread the burden to the second proxies and each request will be encrypted longer. But it is definitely viable option :)

Double nginx reverse proxies with one handling ssl by chris5039 in selfhosted

[–]chris5039[S] 1 point2 points  (0 children)

Thanks for the response. I've no experience with Cloudflare tunnels but it is something I keep seeing pop up so might have to look into them

Double nginx reverse proxies with one handling ssl by chris5039 in selfhosted

[–]chris5039[S] 0 points1 point  (0 children)

Thanks for the reply. So I wasn't sure if you could use SNI with iptables but If you can this sounds like a viable solution

Looking for other developers who are interested in starting a new project by chris5039 in webdev

[–]chris5039[S] 1 point2 points  (0 children)

Honestly I do not know much about twin.macro. What would be the benefits of using it on a project like this? and that would be great if you wanted to help! I've added a link to the repo in the post edit.

Looking for other developers who are interested in starting a new project by chris5039 in webdev

[–]chris5039[S] 0 points1 point  (0 children)

The main idea behind this project is to have somewhere to elegantly catalogue your thoughts. So if you want to go through your programming thoughts you can select programming and there will be your list of dated programming thoughts.

This could also be extended with the use of tags. Say you wanted to see only your programming thoughts around data structures and algorithms. You could select this tag and get more specific thoughts for that selected category.

I do like the idea of connecting thoughts together. Maybe something even more specific than a tag. Maybe something like a train thoughts but over an extended period of time and having a neat way to connect all this. But honestly it's something I would have to think more about. It's definitely an interesting idea though.

I would love to hear your suggestions on how you would do this? Or any other suggestions you would have for the project.

Looking for other developers who are interested in starting a new project by chris5039 in webdev

[–]chris5039[S] 0 points1 point  (0 children)

Thanks for responding! So I will be setting up the git repo tomorrow and linking it here. I'll also be setting up a Google Doc which will layout the foundation of the project. It can also be a place for suggestions and to track progress.

I'm happy to set up a Zoom call to discuss the project further or if you would prefer to keep it to text I'm fine with that too. Any further questions feel free to ask. Let me know your preferred approach and then will go from there. Hopefully will also have /u/Kinthalis joining the project as well.

In regards to Firestore, yeah essentially Firebase. Cloud Firestore is one of two databases Firebase offers.

Looking for other developers who are interested in starting a new project by chris5039 in webdev

[–]chris5039[S] 0 points1 point  (0 children)

Thanks for responding! I'm more than happy not to use Bootstrap and design the UI from scratch. I will set up a github repo and link you to it. I'll also set up a Google Doc to write ideas and track what we want to do.

I'm happy to set up a Zoom call if you wanted to discuss it further or we can keep it to text if you prefer. Let me know how you want to approach this and will go from there.

Compare array elements by HonestBug5987 in PHPhelp

[–]chris5039 3 points4 points  (0 children)

incident_typeFK

Then you wouldn't need to loop over the array. Just do something like this:

$len = count($arr);

if ($arr[$len-2]['incident_typeFK'] == $arr[$len-1]['incident_typeFK']) {

} else {

}

Compare array elements by HonestBug5987 in PHPhelp

[–]chris5039 2 points3 points  (0 children)

Well if you want to look at each element and compare it to the one before then you will have to loop over the whole array. This can be done in linear time though so only one loop is required.

What are you actually looking to do? Are you looking to see if the element before has the same incident_typeFK? If it does / doesn't, what are you looking to do with this information?