wgs
@wgs@lemmy.sdf.org
- Comment on endlessh-go: a Golang SSH tarpit that traps bots/scanners 7 months ago:
endlessh was pretty cool and a more modern version is even better ! I’ll give it a shot !
On a side note, I found a way to trap HTTP connections too while working on my cyb.farm project. The go implementation is ridiculously simple: tarpit.go. It works by providing an endless stream of custom headers to the client, which it is supposed to ingest before getting to the content itself.
- Comment on Setting Up a Secure Tunnel Between Two Machines 9 months ago:
Keeping the source IP intact means you’ll have troubles routing back the traffic through host B.
Basically host A won’t be able to access the internet without going through B, which could not be what you want.
Here’s how it works:
On host A:
- add a /32 route to host B public IP through your local ISP gateway (eg. 192.168.1.1)
- setup a wireguard tunnel between A and B
- host A: 172.17.0.1/30
- host B: 172.17.0.2/30
- add a default route to host B wireguard IP
On host B:
- setup wireguard (same config)
- add PAT rules to the firewall so to DNAT incoming requests on the ports you need to 172.17.0.1
- add an SNAT masquerade rule so all outbound request from 172.17.0.1 are NATed with host B public address.
This should do what you need. However, if I may comment it out, I’d say you should give up on carrying the source IP address down to host A. This setup I described is clunky and can fail in many ways. Also I can see no benefits of doing that besides having “pretty logs” on host A. If you really need good logs, I’d suggest setting up a good reverse proxy on host B and forwarding it’s logs to a collector on host A.
- Comment on Which OS do you use for your homeserver? 9 months ago:
OpenBSD is the most pleasing expérience I’ve had with an OS. It’s fully contained and has all the tools you need without needing to install anything (eg a DNS, HTTP, SMTP servers, a proxy, a good firewall). All config files look alike and use the same keywords for the same things, making it straightforward to configure everything.
And regarding RAID 1, I’ve never done it myself, but it totally works out of the box (as well as full disk encryption).
- Comment on Which OS do you use for your homeserver? 9 months ago:
OpenBSD for all of them.
- Submitted 1 year ago to programming@programming.dev | 0 comments
- Comment on [WireGuard] Do I have to use my own DNS on a VPS in order to avoid DNS-leaks? 1 year ago:
Looks like you shouldn’t ask for anything at all, given that you cannot take a single answer without being a condescending jerk. I’m not affiliated to cyberia.is in any mean by the way just proposing a service that you could use to solve your problem if you were not too busy being a douchebag.
- Comment on [WireGuard] Do I have to use my own DNS on a VPS in order to avoid DNS-leaks? 1 year ago:
Keep in mind that using your own VPS as a VPN doesn’t bring anonymity. You’re simply replacing one IP tied to your name (your ISP) with another one (your VPS).
You hide your traffic from your ISP, and delegate it to your VPS provider.
This will be the same for your DNS. If you want true anonymity regarding DNS, you should use someone else’s service, preferably over encrypted channels, eg. cyberia.is DoT.
I personally use it as a forwarder from a box inside my home (along with others), and use this box as the local DNS when I’m home. This way I know that all DNS traffic is encrypted, and doesn’t leak anything to my ISP or VPS or whatever.
- Submitted 1 year ago to technology@lemmy.world | 1 comment
- Comment on i wanna have fun programming again 1 year ago:
I’ve made something that’s both fun and challenging: cyb.farm
It’s a tech adventure featuring many challenges about computer science stuff (crypto, stegano, protocols, development, …). It starts on the 31^st^ of October, and will probably can keep you busy for a few weeks ^^
- Submitted 1 year ago to technology@lemmy.world | 0 comments
- Comment on What is your favorite programming language? 1 year ago:
C, definitely.
As a hobbyist programmer, I can write code just the way I want, in my own style and without any legacy code. In that context I find writing C relaxing, as I like to understand how things work internally and avoid abstractions levels as much as I can. ASM requires too much discipline though 😅
- Comment on An Excruciatingly Detailed Guide To SSH 1 year ago:
SOCKS is just a generic proxy protocol. It lets you tunnel TCP traffic between two hosts transparently. SSH can be use to setup this kind of tunnel using
-D
. - Comment on What would it take for you to move away from Github? 1 year ago:
My account has not seen a single commit in years now, and yet I can let it go… I still “need” it for support on an old project of mine that I share with other people, and to submit changes for projects I care about which are only on GitHub.
I also keep my account for name squatting purposes, and so people can find the link to my actual repo.
I don’t think I’ll go all the way to delete my account, but my projects are definitely not reliant on it anymore.
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
I personally favor code readability over patch readability. But I reckon this is a matter of preference so I can understand how you might not like that.
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
Straight on point!
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
What’s your point ? You can use vim on termux and set the tabsize to whatever you want for example.
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
I agree that it’s hard, but not impossible. This usually boils down to how Nazi people are when merging code. In a corporate environment, nobody gives a damn so yeah you gotta use whatever you want because there are already different indentation systems within the same file anyway :)
But hey, you gotta live by the changes you want to see happen, so I personally put a lot of effort in formatting my code regardless.
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
I understand your point of view. Personally I either copy the previous line and replace the arguments there, or insert X number of space using the repetition feature of my editor. It also has a feature that will align multiple cursors together with the “farthest” one using space, which is a killer feature for me! (See this presentation video @1:40).
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
You might not understand how to do it properly so here’s the idea:
Tabs will let you reach the indentation level of the current block, then from here, you’ll use spaces to align stuff property. Here’s an example, where
>•••
are tabs (I’m exaggerating alignment for the sake of the example) :>•••if (condition1 == true >••• || condition2 != false) >•••{ >•••>•••struct ident people[] = [ >•••>•••>•••{ >•••>•••>•••>•••.name = "bob", >•••>•••>•••>•••.pubkey = "value1", >•••>•••>•••}, >•••>•••>•••{ >•••>•••>•••>•••.name = "alice", >•••>•••>•••>•••.pubkey = "value2", >•••>•••>•••} >•••>•••]; >•••>•••secureConnection(people[0].name, people[0].pubkey, >•••>••• people[1].name, people[1].pubkey, >•••>••• CRYPTO_ALGO_DEFAULT); >•••}
As you can see, everything will stay correctly aligned as long as it’s within the same block.
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
Try it and you’ll see
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
To each their own indeed. But my rule of thumb is: only use tabs when there’s no other character before it (aka, start of line).
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
When I talk about alignment it’s not about function arguments, but values, “=” signs and such. You simply cannot use tabs for that because alignment must be fixed and indentation independent:
CreateOrderRequest( user, productDetails. => order.detail, pricingCalculator. => DEFAULT_CALCULATOR, order => order.internalNumber)
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
Like that ?
struct Ident arr = [ { .id = 0, .name = "Bob", .pubkey = "", .privkey = "" }, { .id = 1, name = "Alice", .pubkey = "", .privkey = "" } ]
Man you’re a genius ;)
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
Or just set tabsize to 9, that’s the point :)
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
Tabs for indent, spaces for alignment. This is the way, I can’t believe people are still fighting that ?
- Comment on Tabs are objectively better than spaces - gomakethings.com 1 year ago:
Because other people might have restricted environment which might not suit their preference is not a good reason to level it down IMO.
Also, I think 9 is the best size for indent (matter of preference), do you think I should switch to space so everyone can enjoy this wonderful view I have ?
- Comment on Remote storage solution ? 1 year ago:
That’s cheap indeed. Is it possible to install a different OS than those listed on their website ?
- Comment on Remote storage solution ? 1 year ago:
I’ll look more into FUSE based remote storage more generally because it seems to be my only option besides NFS. I’ve heard great feedback from SSHFS so I’ll bench it eventually and see how it goes.
- Comment on Remote storage solution ? 1 year ago:
My main issue with NFS is that it’s been unreliable in my case (multiple servers connected over wireguard, over internet). Which cause locks and latency for the applications that read/write to it (Matrix server, distributed repository, …).
Of course if you can afford connecting the NFS server directly to the servers, that’s perfect but I’m more on the worst case scenario ^^
- Comment on Remote storage solution ? 1 year ago:
Ok thanks, so it’s similar to
rclone mount
, just with another tool.