#development

1 messages · Page 212 of 1

green kestrel
#

not keen on intellij style sql editors... making these entries via phpmyadmin isnt a long term thing

#

i plan to make an editor section in my admin backend for these that uses proper syntax highlighting

radiant kraken
#

it's a tribute to me

radiant kraken
radiant kraken
#

❤️

frosty gale
#

phpmyadmin detected

green kestrel
surreal sage
#
if (
    true
)
{
    console.log
    (
    "hi"
    )
}
neon leaf
#

c++ approves this

sharp geyser
#

C# approves this

#

idk if its just me, but my C++ formatter never did that

radiant kraken
neon leaf
#

has anyone ever use cloudflare d1 (or any cloud sqlite db for that matter) here? is the performance good when migrating from 2gb+ postgres databases

sharp geyser
#

me personally i'd stick with postgres

neon leaf
#

well

#

Id like to, however my api is being used a ton

#

and in a ton of locations

#

it would be a lot cheaper if it was in workers with sqlite

quartz kindle
#

try it

#

as long as you're under the free tier limit, it should be fine

sharp geyser
#

they benchmarked D1 against other dbs

#

here's a blog post about it

neon leaf
#

hmmm

sharp geyser
#

I'd consider using d1 if I wasn't so reliant on postgres

neon leaf
#

I guess ill try using d1 with part of my postgres db and see how it turns out

#

but it seems good so far

sharp geyser
#

idek how to use D1 myself

#

nor do I know how to use workers

quartz kindle
#

i was gonna build something on D1, but the write limit is 500k per day

green kestrel
#

this is how it looks now 🙂

quartz kindle
#

i'd need to write ~650k rows initially

#

too lazy to split it into two days

#

lmao

frosty gale
#

postgres users try to use another database technology challenge (impossible)

neon leaf
quartz kindle
#

no ty :^)

neon leaf
#

smh

#

oh well

#

I will need to pay anyway

#

db is too big

#

for free tier

quartz kindle
#

rip

neon leaf
#

(not like I already pay like 8$ for r2)

frosty gale
#

is it so you can quickly buff/adjust the effects or strengths?

#

or add something

lyric mountain
#

basically for games where u have item/passive/effect/whatever system, it's better if u keep that in the db

#

so you dont need to restart the whole bot to include new content

neon leaf
#

wait

#

there isnt enums in sqlite??

sharp geyser
#

no?

neon leaf
#

dam

sharp geyser
#

you can use CHECK

surreal sage
#

nextjs bruh

sharp geyser
#

L

surreal sage
#

it keeps happening

#

there are no errors at all

sharp geyser
#

obviously there is

surreal sage
#

literally no

#

i edit my code

#

it processes

#

i didnt finish editing*

#

i get error

#

i finish editing

sharp geyser
#

obviously there is an error

surreal sage
#

doesnt reprocess

#

there is no error.

neon leaf
#

ok fuck the edge

#

I am just gonna host 3 monoliths

quartz kindle
#

welcome to the club

sharp geyser
#

lol

#

D1 looks cool

#

but 500k writes a day

#

no ty

neon leaf
#

I mean yeah for some things it may be amazing

#

but not for what i have

sharp geyser
#

It'd be rather useless for me as well

quartz kindle
#

honestly in my experience a monolithic design is the good old tried and true design, it works, its fast and robust

#

stuff like edge and microservice are just buzzwords, but in practice they often fail hard at achieving results

sharp geyser
#

no idea what that means

#

but yea

#

I agree

neon leaf
#

i like edge for static websites though

#

no real downside

quartz kindle
#

ye

neon leaf
#

(websites without api)

quartz kindle
#

but for anything else, more often than not, a distributed, edge/microservice/cloud infrastructure makes things slower and introduces more points of failure

neon leaf
#

well only thing im gonna have to figure out is how to sync 3 postgres dbs

quartz kindle
#

i mean

#

if you need to sync 3 dbs, then its not monolithic xd

neon leaf
#

well

#

3 monoliths for different locations

#

yknow

quartz kindle
#

do you actually need that tho?

neon leaf
#

atleast in usa and europe yes

quartz kindle
#

is it a game server that needs low ping?

neon leaf
#

its a minecraft server api, being used by 3 hosts already

quartz kindle
#

is the data not cacheable?

neon leaf
#

not really

#

it constantly changes

quartz kindle
#

if you really need such a design, then your only option would pretty much be some sort of messaging queue feeding the dbs

neon leaf
#

yeah

#

I think pg has some built in wal things

#

because updates can be slow

#

10min is fine

quartz kindle
neon leaf
#

interesting

#

good thing is only one of the deployments would need to ever write data

sharp geyser
#

This is all too big brain fot me

quartz kindle
#

sql + edge

#

:^)

sharp geyser
#

oh notbthat

#

I understand that

#

just that entire talk

#

was out of my league

quartz kindle
#

the whole thing is pretty simple to understand

#

monolithic = everything in one vps
distributed / microservice = split program into independent parts, optionally in different vps's
edge = stuff copied to multiple vps's accross the world to get stuff close to the user

frosty gale
surreal sage
neon leaf
#

code is optional

quartz kindle
#

optional is optional

surreal sage
#

tim is optional

neon leaf
#

everything is optional

lament rock
#

Partial<Optional>

frosty gale
neon hound
#

node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (/home/container/node_modules/undici/lib/core/connect.js:190:24)
at /home/container/node_modules/undici/lib/core/connect.js:133:46
at Immediate._onImmediate (/home/container/node_modules/undici/lib/core/connect.js:174:9)
at process.processImmediate (node:internal/timers:476:21) {
code: 'UND_ERR_CONNECT_TIMEOUT'
}
Node.js v18.20.2

quartz kindle
#

Partial<Optional?>?

quartz kindle
#

something took too long to respond

neon hound
#

or nah

quartz kindle
#

you can try increasing the timeout

sharp geyser
#

or use webp

#

yourself

surreal sage
#

autism

#

yes

sharp geyser
#

:)

surreal sage
#

yes

#

i made a script that converts the images to webp on build/dev

#

thinking that quality={100} does that alr

#

actually no, it does not

lavish drift
#

im moving from one server host to another. Is there a way to download a copy of my current server and upload it to my next server?

#

i assume there is. So i guess my question is will it work?

sharp geyser
#

Erm, not really unless the server host allows you to download all the files at once

#

your best bet is to use a ftp client

lavish drift
#

i use file zilla

#

just preparing the switch

neon leaf
#

mmmmm yes
root@HDE-02:/srv/containers/rjns-mcvapi# du -sh cache/
208M cache/
root@HDE-02:/srv/containers/rjns-mcvapi#

#

i love it when my redis cache is 200mb bigger than 1 day ago

sharp geyser
#

aren't a lot of people boycotting redis now

neon leaf
#

well

#

its not redis

#

its keydb

#

redis but multithreaded

sharp geyser
#

yuh

#

just wasn't sure if that was still a thing

#

brain posted a github issue about them changing their licenses and then people started boycotting it

#

then I saw a video about it

frosty gale
#

the creator of redis had it coming

#

he willingly gave up the trademark rights for it to the company then when he stepped down they changed the license

#

companies will be companies

#

no integrity

sharp geyser
#

I loved reading through the comments

#

A lot of people were like "I do not give consent for the use of my code since its no longer open source"

eternal osprey
#

hey guys i am still lost asf

#

like, does anyone have a good proxy site

quartz kindle
eternal osprey
#

preferably a proxy api that just dynamically assings me a new proxy each request call i make

#

and else, suppose i were to buy 20 proxies, will they eventually die? Or do they remain alive?

neon leaf
#

with a knife you can make them die

#

you also need to feed them so they dont die

eternal osprey
#

guys i swear i ain't in the mood for this shit

quartz kindle
#

i never used any proxy service

#

did you try one of those rotating proxy services out there?

eternal osprey
#

i don't know which one to use

sharp geyser
#

hes setting up a p2p thing

#

and doesnt want to expose the ips to each other

eternal osprey
#

and most of them i want to use are hella fucking expensive

#

240 a month like suck my dick

quartz kindle
eternal osprey
#

therefore i have like 2 questions:

  1. Does anyone have a good rotating proxy site?
  2. Suppose i were to just buy a bunch of static proxies. How does the lifespan work? Do they eventually die? Or do they just work for, well lifetime.
quartz kindle
#

you dont buy a proxy, you buy a proxy service

#

the service has the responsibility of giving you working proxies

eternal osprey
#

i refer to buying a list of static proxies

quartz kindle
#

and who owns those proxies?

neon leaf
#

@quartz kindle do you know any cheap vps hosts in usa / canada

sharp geyser
#

I mean

quartz kindle
#

contabo/hetzner

sharp geyser
#

usa and cheap don't mix

neon leaf
sharp geyser
#

you can buy us servers from other places

#

like contabo

#

they are a german company but offer amazing prices in us servers

neon leaf
#

yeah contabo seems a reasonable deal

sharp geyser
#

Any us based vps host

#

is going to be expensive asf

neon leaf
#

does contabo like not tell me what cpu i get

sharp geyser
#

its going to be an AMD Epyc

neon leaf
#

ah ok good

sharp geyser
#

At least that's what it has been for me for the past 5 servers

frosty gale
#

although cpu name doesnt matter much since they likely throttle it anyways for your vps

neon leaf
#

did jesus make the contabo panel

#

or someone from ancient egypt

sharp geyser
#

oh yea

quartz kindle
#

no, it was mohammed

sharp geyser
#

its old

#

but works!

#

they have plans for a new one

#

its just slow at being released

neon leaf
#

i love how im still hosting all my docker images at home with a 40mbit uplink

quartz kindle
#

i still dont use docker at all

#

:^)

neon leaf
frosty gale
#

i dont really see much use for docker

#

maybe im not the right client for it

#

i thought it was like a super light virtual machine but its not really

#

the os on a container can only be the host os, shouldn't be relied for security or isolation, etc

#

only thing i see thats close to being isolated is the filesystem

neon leaf
#

well its so you can bundle all your external dependencies

#

and services

sharp geyser
#

and run it anywhere

neon leaf
#

and etc

lavish drift
#

is Ubuntu good to get on my VPS server? I plan to host a discord bot (of course), database, and a webAPI

frosty gale
#

its probably one of the easiest also

lavish drift
#

here goes nothin then

#

actually petrified to begin this rabbithole

frosty gale
#

although im not a fan of canonical for spamming my work email trying to offer their ubuntu services

surreal sage
#

daily reminder to eat at least one small rock

harsh nova
#

just whatever you do, NEVER run rm -rf /* or anything that looks like it without giving it a lot of thought

sharp geyser
#

ahem

#

forgor --no-preserve-root

lyric mountain
#

also never EVER run chmod 777 /*

#

it wont warn u

#

but this will brick the entire system

harsh nova
#

dont you need to use the -R flag for chmod?

lyric mountain
#

ah yes

harsh nova
#

for it to be recursive

lyric mountain
#

this is potentially worse than rm, as it's not fixable in any way but full reinstall

#

it'll fuck up everything

harsh nova
#

what perm is 777? guessing it denies rwx

lyric mountain
#

it'll all perms

#

rwxrwxrwx

harsh nova
#

why would that be inherently unrecoverable?

lyric mountain
#

cuz u cant restore to original perms

#

not unless u go file by file running chmod again

sharp geyser
#

because each folder and file has its own perms depending on who created it

lyric mountain
#

certain linux things refuse to work unless it has a very specific perm

harsh nova
#

ah

sharp geyser
#

also that to

lavish drift
#

ohhh snap my Contabo server got set up

#

time to suffer

harsh nova
lavish drift
#

i dont even know how to connect to it

#

the digital ocean one had a console thing i just clicked on LOL

pearl gulch
#

Is there a tutorial for making a command that requires vote top.gg first?

sharp geyser
#

no

pearl gulch
harsh nova
sharp geyser
#

Did you make that

harsh nova
sharp geyser
#

wait

#

why is the auto poster separate from the sdk

#

that seems like such a waste

harsh nova
#

autoposted uses the sdk

#

you can see it as an addon

sharp geyser
#

💀

#

why not combine it

#

its js

harsh nova
#

not everyone needs the autoposter

sharp geyser
#

the node_modules will be bloated anyways

#

this aint rust bruv

harsh nova
#

this was made wayyy before my time i cant answer for it ong

sharp geyser
#

💀

#

those tokens are longer than my last relationship

harsh nova
#

same

sharp geyser
#

jh

#

you are cursed

#

no way you used require in a ts file

harsh nova
sharp geyser
#

typo

#

fix your code buddy

harsh nova
#

never

sharp geyser
#

@harsh nova

#

I have a question

#

I followed the video, but my vote rewards no work

harsh nova
#

go ahead

#

I will decapitate you

#

try me

sharp geyser
#

:(

#

false advertisement

#

you said I could ping you and ask for help

#

guess not

#

😔

fickle flare
sharp geyser
#

@harsh nova

harsh nova
#

-b 1029148061945045026 homophobia

gilded plankBOT
#

upvote ps_xx.#0 was successfully banned.

sharp geyser
#

Numero 1

harsh nova
#

And with that I declare pride 2024 commenced

sharp geyser
#

Bot Devs get their btos removed when they get banned right?

harsh nova
#

Yes

sharp geyser
#

Oh fun

harsh nova
#

Dude had none tho

sharp geyser
#

time to see how many bot devs get banned

harsh nova
#

White name behaviour

oak cliff
#

Why am I a bitch what

#

Why me

sharp geyser
#

your bio

#

you are at the top

harsh nova
#

And highest in the list

oak cliff
#

Oh true

#

I forgot I changed my status

#

Lmao

sharp geyser
#

just hide yourself like veld

#

ezpz

oak cliff
#

Nah

#

Now that I know why I'm cool with it

sharp geyser
#

lmao

#

man secret: we always gay with the homies ||read this and ur gay too||

harsh nova
#

Don't leak our secrets

sharp geyser
#

O shit

#

my bad

#

it slipped out

harsh nova
#

The fellowship of men must not leak details like that to non members

sharp geyser
#

Hopefully what I put in the spoiler isnt innappropriate

harsh nova
#

Nah ur good

spark flint
#

lol

north turtle
#

Just I'm wondering why Im storing user data through mysql
methods for data storing are too much but idk what to select
(json, mysql, mssql, postgresql, ...etc)
I thk security and performance (speed etc) is best priority to select method.
so what should i select the method for store such as user data

lavish drift
#

anyone here use postgres?

solemn latch
#

I think most people here use postgres

lavish drift
#

so i just did sudo apt install postgresql and sudo -u postgres psql template1, then ALTER USER postgres with encrypted password 'your_password';, but i cant log in as postgres. Am i missing something simple?

solemn latch
solemn latch
lavish drift
#

my discord bot and soon-to-be database are all on 1 server

#

im just SSHing into it

#

root works, which is how i ran those commands

#

but this new postgres user does not work. Those are the only 3 commands i ran

solemn latch
#

What command are you running to login to postgres?
psql -d mydatabase -U myuser
?

lavish drift
#

i thought it was a new user, like root is

solemn latch
#

ah, I dont think postgres users can be sshed into can they?

Ie they're not real users

#

Unless you actually make the user

lavish drift
#

gotcha

#

so just log in as my normal user and then connect to them

solemn latch
#

Thats what i do yeah

lavish drift
#

then is my database set up i guess?

#

i need to watch a video on how to set up the format of the database

solemn latch
#

I like to visualize my schema by drawing it out before doing anything in the database

#

I'm not sure how complicated your data is, so that might not be needed

lavish drift
#

maybe 4

pine nova
#

anyone uses resend's api for mails and stuff? how much time does it take to verify a goddamn domain 😭

eternal osprey
#

Does anyone know what a proxy server is? Like does it distribute a new proxy each time I make a call?

#

Man fuck these proxy shits

#

Ill create a managed peer to peer connection where all connections go through a main server, this main server sends it to the other side

#

Will add latency but yeah fuck it

sharp geyser
frosty gale
#

i dont see why youd need proxies in the first place

eternal osprey
#

Wym of course I need proxies

#

I don’t want people to expose each other’s ip addresses

#

They will ddos the shit out of each other

#

I am not using proxies anymore though, I am just using a man in the middle type of connection

#

Where the server distributes the packets instead of end to end

frosty gale
#

if you have packets going through the server youve already proxied the connections

#

you cant do it peer to peer without exposing another users IP

#

proxies will probably end up costing more performance than just using a single central server like you said

frosty gale
quartz kindle
#

not to mention expensive, unreliable and potentially insecure

#

you're exposing the user's ip addresses to proxies you dont own

frosty gale
pine nova
#

damn really gotta study about networking cuz i dont understand shit about this

frosty gale
#

just recently learned about tcp hole punching

pine nova
#

tf is that

pine nova
#

any free courses or websites yk something or some yt videos

frosty gale
# pine nova tf is that

a lot of routers block inbound connections which would make peer to peer connections impossible, so if both sides try to connect to each other at the same time, its treated as an outbound connection which is allowed and so the connection can establish

eternal osprey
frosty gale
eternal osprey
#

That shit is sick too

pine nova
frosty gale
#

boring

#

although school managed to make networks the most boring subject to exist when they're very interesting

#

it doesn't go too deep into them, you only really learn different topologies, tcp vs udp, dns resolution and that's it

#

protocols as well

#

seems like the syllabus was designed more for future aspiring software engineers rather than computer scientists

past field
#

this is the lobby, 2 minute warning and announcement of game starting

#

then that’s the button for people to type in their confessions and i have the messages saved in an array

#

this button and the collector ends after 2 minutes

#

then i get an error when trying to get the bot to post the messages in an embed without the author information

deft wolf
#

I'm not entirely sure if you can use <Client>.on() inside a command like this. I've never tried anything like this, but I doubt it would make sense or work. Personally, I would probably try to get the response from the modal using <Interaction>.awaitModalSubmit(), although I'm not very familiar with modals either Noooo

https://discordjs.guide/popular-topics/collectors.html#await-modal-submit

eternal osprey
#

it goes hella deep

#

one part of the course was about how the internet works, indeed the protocols etc.
however other part was about security issues and how to exploit these issues to gain network access, etc.

#

2nd part was lit can't lie

#

i can call myself a master penetrator now

surreal sage
#

why has my inspect element been crashing so much recently 😭

sharp geyser
#

Some pages dont allow inspect element

sharp geyser
#

It spawns a listener, but it doesn't despawn it

#

So its still there

lavish drift
# sharp geyser dont forget to install postgresql-contrib

What does that do? Also. Update on the project since I bugged you about questions for so long lol. I got the database working. If I don’t manually add your server key the commands dont work. If I do, they do work. It also updates the list of premium IDs after every command

pine nova
lavish drift
#

Also got a very basic website set up. I think all I need now is a webAPI

sharp geyser
#

how do you think discord prevented it in their desktop app

pine nova
sharp geyser
#

cause all the desktop app is just a web page

pine nova
sharp geyser
#

so?

#

All an electron app is just a web browser

sharp geyser
#

or outright making it useless

#

some sites redirect you to the home page where there is no content to be inspected

pine nova
sharp geyser
#

Uh...

pine nova
#

how does that works?

sharp geyser
#

Electron is literally a chromium app

pine nova
#

yea

sharp geyser
#

Its essentially a chrome browser

pine nova
#

hmm

#

i see

sharp geyser
#

I dont know myself because quite honestly I dont care to block people from using it

pine nova
#

i google it but got an answer of no you can't lmfao

#

on stack overflow

#

they just added some event listeners of keys to prevent it

sharp geyser
#

just listen to the contextmenu event and call preventDefault()

pine nova
#

yea also saw that one

sharp geyser
#

the contextmenu is inspect element

#

so if they try and open it any possible way it wont let em

pine nova
#

context menu is right click bruh zoomeyes

#

wtf

sharp geyser
#

Oh wait right

#

💀

pine nova
#

💀

pine willow
sharp geyser
#

I haven't done web dev stuff in like years

#

so

eternal osprey
#

no way

pine nova
#

imagine if context menu was inspect element

pine nova
sharp geyser
#

Either way, yes its possible to prevent it

pearl trail
sharp geyser
#

should you? no

pine nova
eternal osprey
#

damn i didn't know!

sharp geyser
eternal osprey
#

It's pretty well optimized for electron

sharp geyser
#

Why do you think it uses 500mb +

eternal osprey
#

or, electron got better over the years because i could remember it was shit when i was using it for some webapps.

sharp geyser
#

Electron is inherently bad for performance, but its so well developed that there is no counterpart

eternal osprey
#

i see

pine nova
#

hmm there are other frameworks but i think electron got the most functionality stuff

#

ig

sharp geyser
#

electron has been out for ages

#

It will take a while for someone to come up with something better.

#

I mean there is tauri

pine nova
#

ig steam is also built on electron

sharp geyser
#

but tauri relies on the native web view

#

which can break your apps

pine nova
#

hmm

#

just use c++/java/rust at this point to develop apps they choosin the easy way fr

sharp geyser
#

OS updates to a version where the webview is borked?

#

Say goodbye to your tauri app until they fix it

#

tauri is nice in concept and quite frankly it's rare for the webview to even break from what i've seen

#

but since it relies on something out of their control then it can be a little wonky

pearl trail
#

womp

pine nova
frosty gale
#

there are more efficient versions of electron but a lot of production apps dont tend to use them

#

vscode is better with their electron variant but it still tends to use a lot of ram

#

performance wise its pretty good though

#

ive used vscode on low end computers and it always runs well

sharp geyser
#

ha....

#

well

#

my 2015 macbook pro begs to differ

frosty gale
#

ive used vscode on a 2015 macbook air like a month ago and it ran fine

#

that was with the latest os it could update to which was

frosty gale
#

monterey

eternal osprey
#

why do networks still tend to use subnet masks if cidr notation is way faster?

#

In terms of checking whether a host is in the same subnet or not

#

Cuz subnets masks seem superficial as we need to do bitwise and operators on two different ip bitstreams, while in cidr you can just directly check the x amount of bits to see if they correspond to each other.

surreal sage
#

electron no more

#

electron poopoo 💔

lament rock
#

The problem is a cross platform and simple "native" app solution. The Arc browser is trying to fix this by bringing Swift to Windows, but they still use WinUI. Iirc, they're working on porting over SwiftUI. For Arc, they're still using WinUI under the hood.

This is great for Windows, but still presents a problem for Linux

sharp geyser
eternal osprey
#

wait hollp i am rewatching my network and security lecture

#

apparently you can share your own private ip address without getting fucked by ddossers?

#

Cuz it cannot be reached anyway outside of your own subnet/

#

damn i love nat

lament rock
#

WAN vs LAN

#

Why it does this is because IPV4 is running out

eternal osprey
#

yeah exacrly

#

all destinations/sources of packets are being translated using the router translation table

lament rock
eternal osprey
#

i mean what's your private ip

#

lemme holla at you real quick

sharp geyser
#

💀

frosty gale
#

yeah its all mapped otherwise every device connected to a router would need their own custom IP

#

not practical

#

maybe with ipv6

eternal osprey
#

yeah

sharp geyser
#

they should just make new ipv4 addresses

lament rock
#

Every value is already allocated

eternal osprey
sharp geyser
#

expand it

eternal osprey
#

only thing they can do is extend the binary sequence of it, which is ipv6

lament rock
#

ipv6 was made for this exact reason!

sharp geyser
#

add a fiew extra numbers

frosty gale
#

though ipv6 is rarely used nowadays

#

isp's prefer to stick to ipv4 its easier

sharp geyser
#

ipv6 addresses look so wonky

#

imagine having to type that out for a mc server

#

💀

eternal osprey
#

It's pretty cool to see that whole networks is subdivided in hierarchy.
Basically, IANA divides it into regions.
The region internet registries divide their blocks into isp blocks.
The isp's then divide it to your bitch ass routers at home

eternal osprey
frosty gale
#

by converting the IP into readable phrases

#

but its still not ideal

sharp geyser
#

ipv6 is the ugly cousin

eternal osprey
#

like RLE, but different

#

priavte ip addresses can be shared across multiple networks right? What is y'alls private ip?

#

Genuinely curious if some of us have the same

frosty gale
#

but yeah i think one of the primary issues with ipv6 is theyre too long, they become impractical to be used by anything other than DNS or computers

lyric mountain
#

127.0.0.1

eternal osprey
#

maan get that loopback interface out of here

frosty gale
#

they usually start with the same sequence per private network which tells the router the ip is part of the private network

eternal osprey
eternal osprey
frosty gale
#

192.168 definitely

deft wolf
#

Automod moment Noooo

frosty gale
#

i think the 166 is also a prefix of some kind too

eternal osprey
#

though chloe, maybe you know this:
but why are we still using subnet masks instead of just cidr notation?

pine willow
#

I mean i could leak my vpn ip here

frosty gale
#

i barely know anything about networks ive only just recently started learning them for my job

eternal osprey
pine willow
#

💯

frosty gale
#

i can talk a lot about tcp/udp and stuff on that level but network architecture in itself i dont know much

eternal osprey
#

Damn then i got another question for you

#

i learned about protocols like go back n, selective repeat etc

#

and what i really couldn't wrap my head around was the 4-way close in tcp

#

so the tcp client sends the fin flag to the tcp communication socket, which forwards it to the actual tcp server listener.
The server listener then sends through the communication socket a ack flag, then a fin flag? In 2 fucking seperate segments?

#

Why

#

i mean 1 packet extra isn't much but if like 200 ppl are connecting to the same listener it becomes a lot of wasted bandwidth allocation

lyric mountain
#

If you think of it as wasted, then you shouldn't use tcp for what ur doing

eternal osprey
lyric mountain
#

Tcp when u need integrity, udp when u need low latency

eternal osprey
#

why not combining the flags into 1 seperate segment. It's a close, so udp wouldn't matter in this scenario i am describing.

sharp geyser
#

tcp: Erm, what the fuck did you send me
udp: alright you're good corrupt packet

lyric mountain
eternal osprey
#

hence i don't know why they are sending 2 seperate flags. How i see it, the more flags we send in seperate segments, the more chance of losing packets and therefore having to retransmit.

#

mannn chloe always leaving when i am in shambles

lyric mountain
#

It really tries to be damn sure it was received, and to tell the sender that it was

eternal osprey
#

yeah i know

#

but if you look closely, the ack segment is not triggering any response.

lyric mountain
#

It is telling the sender it was acknowledged

eternal osprey
#

Yeah but why can't it be within one segment

sharp geyser
#

guys I have a serious question

eternal osprey
#

why is it sending 2 seperate segments.
It would be more efficient if it were to be 1.

sharp geyser
#

Will my macbook get heavier if I download more files?

lyric mountain
#

It can't be 1 cuz they're different flags

eternal osprey
#

The flags are just bits in the header

#

1 = active, 0 = non active

lyric mountain
#

Because consistency, you can't risk sending the wrong flag if anything happens

frosty gale
#

ah i think i see

lyric mountain
#

And 1:1 is much safer than doing 2 ops

frosty gale
#

are you confused about these 2 being sent as separate packets/flags?

#

or something else

lyric mountain
#

Yes he's talking abt those

eternal osprey
#

yeah why are they not set in the same segment

#

i know that some tcp variants already tend to do that

frosty gale
#

its because after the first ack gets sent back, that means the server has informed the program or resource that has the connection open to close the connection or do some additional processing

frosty gale
#

after that processing is done the ACK is sent by the server to notify the server is done and the connection is released

eternal osprey
#

so it basically gives the client time to 'clean' basically

frosty gale
#

its kind of like a js socket.on("close")

#

although its up to the operating system whether they want to immediately send the FIN and not wait on the program because it doesnt really matter

sharp geyser
#

I guess my question wasn't serious enough 😔

eternal osprey
#

I see!
So basically:

the client sends a fin,
server receives it, sends ack and then a fin flag, after which it closes its communication socket,
the client then waits when receiveig the ack and cleans,
then once it received the fin it shall be closed hence it sends an ack back.

#

then a timeout happens right, after which the client closes the socket?

lyric mountain
#

If it was on a seriousness meter, the meter would IndexOutOfBoundsException

eternal osprey
#

much love to both of you, finally understand

frosty gale
lyric mountain
#

Shoot twice to make sure

frosty gale
#

although its still sort of subject to the two generals problem

#

but at that point it doesnt really matter

#

both parties have negotiated a connection close

eternal osprey
#

ah i see, it's pretty interesting to know

frosty gale
#

although i wouldnt be surprised if the TCP spec allowed for a packet having both the FIN and ACK flag in that double response

#

since its not strictly necessary for the connection to wait on the server to close

eternal osprey
#

it does accept it

#

that's why i was confused

#

It accepted both approaches

frosty gale
#

ah, so the spec probably allows for both variations of it

#

just in case the server wants to be more clear to the client over its status

#

but the operating system can spare that extra packet if its pointless

eternal osprey
#

i see, but i think it also just depends on the protocol version the server is running i think

#

older varitations might want the clear distinction between the ack and fin while newer ones are like fuck it

#

because the routers are not necessarily required to throw errors right, and they might just have some issues doing so hence the traceroute does not know the host

sharp geyser
#

Idk you tell me

#

ngl, all this network talk flies over my head

eternal osprey
#

srry

sharp geyser
#

No need to apologize

eternal osprey
#

ion know it seems like it

eternal osprey
#

very simple

sharp geyser
#

I know you aren't the one saying this

#

I may not understand it

#

but you've done your research and still dont

#

😏

eternal osprey
lavish drift
#

anyone here ever build a webAPI with stripe?

eternal osprey
eternal osprey
sharp geyser
#

Yea

#

I do it a lot

#

I work with stripe in depth

lavish drift
#

im currently fighting to install the CLI but it think its working

sharp geyser
#

well if it thinks its working

#

what is the problem

eternal osprey
lavish drift
#

im wondering if i can just use this templete

sharp geyser
#

No way...

#

I installed it in like 2m

lavish drift
#
# app.py
#
# Use this sample code to handle webhook events in your integration.
#
# 1) Paste this code into a new file (app.py)
#
# 2) Install dependencies
#   pip3 install flask
#   pip3 install stripe
#
# 3) Run the server on http://localhost:4242
#   python3 -m flask run --port=4242

import json
import os
import stripe

from flask import Flask, jsonify, request

# The library needs to be configured with your account's secret key.
# Ensure the key is kept out of any version control system you might be using.
stripe.api_key = "sk_test_..."

# This is your Stripe CLI webhook secret for testing your endpoint locally.
endpoint_secret = '****'

app = Flask(__name__)

@app.route('/webhook', methods=['POST'])
def webhook():
    event = None
    payload = request.data
    sig_header = request.headers['STRIPE_SIGNATURE']

    try:
        event = stripe.Webhook.construct_event(
            payload, sig_header, endpoint_secret
        )
    except ValueError as e:
        # Invalid payload
        raise e
    except stripe.error.SignatureVerificationError as e:
        # Invalid signature
        raise e

    # Handle the event
    if event['type'] == 'checkout.session.completed':
      session = event['data']['object']
    # ... handle other event types
    else:
      print('Unhandled event type {}'.format(event['type']))

    return jsonify(success=True)```
sharp geyser
#

homebrew my beloved

lavish drift
#

like this is what i need to host, right?

#

thatll handle the web hooks?

sharp geyser
#

I mean...yea

lavish drift
#

is that not how youre suppose to do it?

sharp geyser
#

I mean it is, and it will work

#

you will have to modify it to work for what you need by listening to the events that you want

#

that's about it

lavish drift
#

right

#

im just totally in over my head. i have no idea what i need to get what i want to happen

#

so im just asking questions until i understand

sharp geyser
#

Like I said, its better to focus on your current bot and growing it.

#

While its okay to plan ahead, doing so too far is not worth it

lavish drift
#

so manual input into the db does work

sharp geyser
#

Nice

lavish drift
#

i just wanted to take a stab at this webAPI thing to see if i could get it. if not yeah ill wait

#

im having fun trying

#
mainuser@vmi1912125:~$ stripe version
stripe version 1.19.5
```i got stripe installed
#

like i said, i just want to touble check that if i leave this new app.py running like i do my discord bot, thatll serve as my webAPI

sharp geyser
#

that's just the cli tool btw

lavish drift
sharp geyser
#

you still need the respective stripe library for the language you are using

lavish drift
#

after which should be pretty simple. depending on which event is triggered, manipulate the db accordingly

frosty gale
# eternal osprey

i know the 3 stars mean the source didnt respond because it either blocks the traceroute probes or didnt respond for whatever reason

lavish drift
#

so this means maybe my port isnt open?

#

is advertising allowed?

sharp geyser
#

@harsh nova

harsh nova
#

No

eternal osprey
lavish drift
lavish drift
#

nvm i think i got it workin

sharp geyser
#

neat

#

you are using test stuff right

lavish drift
#

i think i got it set up and would love to try it on the stripe website but it appears i need SSL

#

that may be where my journey ends LOL

#

although they say thats needed for a website, which im not running. I just want to recieve the webhook things from Stripe

#

i guess im just not sure how to keep this secure

sharp geyser
#

you will still need an ssl cert

#

even if there is no frontend for it

lavish drift
#

my server host wants $90 for it

sharp geyser
#

💀

#

yea no

#

don't pay for something like that

lavish drift
sharp geyser
#

I use cloudflare

#

you will be needing to learn a lot to get this to work btw

lavish drift
#

i feel like im so close

sharp geyser
#

well, you will need to learn nginx

#

and how to use cloudflare origin ca certs

lavish drift
#

if the server webhooks are triggering properly over localhost, all i need to do it open it up to Stripe and swap the keys around

sharp geyser
#

stripe wont post to an unsecure endpoint e.g http

#

it has to be https

lavish drift
#

so thats why i need the SSL

sharp geyser
#

the stripe cli is just a way to locally test things

sharp geyser
#

It's what I use in production

lavish drift
sharp geyser
#

I mean using nginx is one way to expose it to the internet and reverse proxying it allowing you to if you want host multiple apis on the same server with different ips/domain names

lavish drift
#

this doesnt sound too bad

#

i think the hardest part would be setting up the Nginx server. It took me like 2 hours to finally figure out the Django server

#

but the cloudflare parts just sounds like its a bunch of keys

#

i may skip the Nginx part for now

#

actually im not sure i can. I think i have to use something like Nginx

eternal osprey
lavish drift
#

i now have a domain

#

as cloudflare requires one

eternal osprey
#

The record should link your site to the domain of cloudflare. That’s what I had done in the past. That way your dns resolver will resolve the name servers of cloudflare instead of putting the stress directly onto your mainframe.

#

You must first host it

#

And preferably a place where you have access to domain tables

#

Dns*

lavish drift
#

i have my discord bot, SQL database, and now my local Django server hosted there now

#

so now ill need to host another server? the Nginx?

sharp geyser
#

nginx is a reverse proxy

#

it allows you to have multiple things on the same server pointing to different domains/ips

lavish drift
#

for simplicities sake, id say no. But when googling around it said i had to use one to get Stripe to work

sharp geyser
#

its the only way i know to use ssl certs

frosty gale
lavish drift
#

so will the Nginx be another server i need to host? Or is it simply an extention to my Django server

#

is what i cant figure out

frosty gale
sharp geyser
#

It is its own server

#

It basically proxies your webapi through it and points it to a domain

#

while also setting up ssl certs that you specify

frosty gale
#

but it can't be that the router is down or offline because it still managed to be a part of your packet circuit

#

so they show up as stars only because the mapper literally does not know what the router is since it didn't respond to the probe request

#

it just passed your packet onto the next node

lavish drift
sharp geyser
#

aha, the ip address is the one you use to connect to the server

#

That's the beauty of nginx

#

It routes it all on the same ip

#

but points it to different domains

lavish drift
#

but just to be clear that im doing this right. I got a domain on godaddy and i need to do a type A record in the DNS section that routes it to my main servers IP?

sharp geyser
lavish drift
#

that makes sense

sharp geyser
#

It'd be an A record of key @ and value server ip

lavish drift
sharp geyser
#

Yea

#

its just a server ip

lavish drift
sharp geyser
#

You can easily get the ip of whatever server a website is running on

lavish drift
#

then this is what i got

sharp geyser
#

oh yikes

#

are you using cloudflare?

#

if so you can't use godaddy's dns

lavish drift
sharp geyser
#

well

#

then yea

#

thats fine

lavish drift
sharp geyser
#

Indeed

#

you'd have to use cloudflare name servers to make use of cloudflare

lavish drift
#

what would be my options with godaddy?

sharp geyser
#

buying their ssl certs

#

cloudflare is a free option tho

#

their free tier has certs that last 15 years

lavish drift
#

im confused

#

it says i have one

sharp geyser
#

oh

#

maybe godaddy gives you one for free

#

Sounds unlike them

lavish drift
#

lol

sharp geyser
#

usually like to squeeze you for every penny possible

#

unless you paid for one

lavish drift
#

no sir

#

i paid $12

sharp geyser
#

Anyway i'd love to help more, but I can't atm.

#

Its not efficient for me to do so from phone

#

I will leave it off with, check out nginx, route it to the domain you bought

#

proxy pass your webapi to it

#

and ezpz it should work

lavish drift
sharp geyser
#
server {
  listen 80;
  listen [::]:80;

  server_name stockevaluatorbot.com;

  location / {
    proxy_pass http://localhost:portToYourWebApi;
  }
}
#

that should work

lavish drift
#

i dont think it has an SSL

sharp geyser
lyric mountain
#

use cloudflare + origin ssl

lavish drift
lyric mountain
#

cloudflare is a dns

#

I mean, u can buy domains from it too, but that's a detail

#

also, godaddy is a hella expensive no?

sharp geyser
#

you can buy domains from cloudflare?

#

oh it is

#

very expensive

spark flint
#

not really

lyric mountain
spark flint
#

they charge exactly what the registry charges

#

godaddy charges less because it retains you for another year, they take the hit

sharp geyser
#

for a domain I bought cheaper on namecheap

spark flint
#

yes because they charge registry cost

#

namecheap charges less because it retains you

#

most people dont know or want to change registrar after a year so they dont

sharp geyser
#

why should I

lyric mountain
lavish drift
lyric mountain
#

u can use whatever

sharp geyser
#

you can indeed

lyric mountain
#

godaddy only gives u the domain

sharp geyser
#

all it is just changing name servers

#

you dont have to use godaddy's dns

eternal osprey
#

Chloe for president all I am saying

lavish drift
#

this will be good?

sharp geyser
#

I might transfer my domain to cloudflare tbh

#

Rather have my domain and dns all in one place

sharp geyser
#

the free tier is enough for almost everyone

lyric mountain
#

the only reason you'd get anything above is if u need support or enterprise features

#

like custom rules and shit

frosty gale
sharp geyser
#

Im pretty sure some companies still use cloudflare free tier

#

What is cloudflare kv

#

is that like redis in workers

solemn latch
#

Yeah

#

kinda

#

key value, almost mongodb ish

lavish drift
#

I dont see anything DNSSEC in my DNS section

sharp geyser
#

I hardly ever use workers

neon leaf
#

workers are cool for stateless apis

#

like taking screenshots of pages with their puppeteer in cloud shit

solemn latch
#

Workers are really cool yeah

lavish drift
#

so cloudflare wants me to remove all nameservers but i cant remove the bottom one

neon leaf
#

why?

lavish drift
lavish drift
#

where else can i just buy another domain to skip this bs?

sharp geyser
lavish drift
#

i published some random AI website they suggest and it says this

#

so it does in fact have a SSL

neon leaf
#

@quartz kindle I have found the perfect solution for my project, 3 main monoliths that are routed by a cf worked based on geolocation

#

they havent made the ping any worse is the crazy thing

#

and response times

eternal osprey
#

Dnssec

lavish drift
#

so im just gonna try it

#

i think i set up Nginx

#

django appears to be running

neon leaf
#

what are the discord servers closest to? usa central, east or west?

quartz kindle
#

my vps gets around 20ms to discord gateway from ashburn, washington DC

neon leaf
#

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro
  _____
 / ___/___  _  _ _____ _   ___  ___
| |   / _ \| \| |_   _/ \ | _ )/ _ \
| |__| (_) | .` | | |/ _ \| _ \ (_) |
 \____\___/|_|\_| |_/_/ \_|___/\___/

Welcome!

This server is hosted by Contabo. If you have any questions or need help,
please don't hesitate to contact us at support@contabo.com.

root@vmd142079:~#```
#

bro ok im convinced jesus made this panel

#

I have to login after each action

#

and it does not apply

pine nova
sharp geyser
#

huh

pine nova
#

contabo

sharp geyser
#

what are you talking about

sharp geyser
neon leaf
#

I am trying to disable vnc for my vps

sharp geyser
#

why

neon leaf
#

because I dont need it

sharp geyser
#

I mean ok

#

disable it then

neon leaf
#

well

#

I click disable

#

and it redirects to login

#

after I login it just says server error

sharp geyser
#

Works for me

#

weird

sharp geyser
neon leaf
#

this but it seems to have worked now

sharp geyser
#

yea it works for me

lavish drift
#

alright if i go to my IP, it takes me here

sharp geyser
#

yup!

#

Thats the default nginx page

lavish drift
#

i added a

sharp geyser
#

?

civic scroll
#

a , nice

lavish drift
#
        proxy_pass http://localhost:8000/webhook/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_read_timeout 600s;  # Adjust timeout as needed
    }
}```
neon leaf
lavish drift
#

so its gonna shove everything into my localhost django server

neon leaf
#

rm /etc/nginx/sites-enabled/default

sharp geyser
#

have you symlinked it yet

#

and what does the entire server block look like

#

out of curiosity

lavish drift
#

server {
listen 80;
server_name stockevaluatorbot.com;

location / {
    proxy_pass http://localhost:8000/webhook/;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_read_timeout 600s;  # Adjust timeout as needed
}

}

sharp geyser
#

looks good

#

make sure to symlink that with the sites-enabled folder

#

I forgor how to make a symlink with linux ngl

lavish drift
#

but no work

sharp geyser
#

Did you create a symlink

lavish drift
sharp geyser
#

Where did you put this

lavish drift
sharp geyser
#

dont tell me you put it directly into sites-enabled

lavish drift
#

whats wrong with that

sharp geyser
#

you're not really supposed to

#

you are meant to put it in sites-available and then symlink it to sites-enabled

lavish drift
#

its also in sites-available

sharp geyser
#

nano /etc/nginx/sites-available/someconfig

write out your nginx config & save it

sudo ln -s /etc/nginx/sites-available/someconfig /etc/nginx/sites-enabled

sudo nginx -t

sudo systemctl restart nginx

lavish drift
#

i believe thats what i did

#

i did the -t thing

#

and restarted it

sharp geyser
#

then it should be working

lavish drift
#

i just got this

sharp geyser
#

yuh

#

cause its not a get endpoint

#

its a post

#

you post to it

lavish drift
#

so its working

sharp geyser
#

try it and see

lavish drift
#

try it with stripe you mean?

sharp geyser
#

pretty sure you can use the stripe cli tool to test it

#

dont think its limited to just localhost

lavish drift
#

im not sure the command for that let me see

sharp geyser
#

it'd be the same

lavish drift
#

stripe listen then my url maybe?

sharp geyser
lavish drift
#

yeahg

sharp geyser
#

Also

#

I recommend changing your nginx config

#

if you plan on making a website for the bot that is

lavish drift
#

not on my server no

#

im hosting a simple website

sharp geyser
#

same domain name?

lavish drift
#

for like $6 a month maybe if i pay for it

#

no

sharp geyser
#

brother in christ

#

don't pay 6$ a month

#

you have a server

#

use it

lavish drift
#

its gonna get overloaded

sharp geyser
#

no its not

#

💀

lavish drift
#

baby steps

#

im like 2.5 weeks into python

sharp geyser
#

you are paying for the 12.50$ vps right?

lavish drift
#

weeelll

#

its 16 bc i paid 3 for east coast USA

#

but yes

sharp geyser
#

ngl thats a scam

#

should of just picked the cheapest us option

lavish drift