orsetto

joined 2 years ago
[โ€“] orsetto@lemmy.dbzer0.com 11 points 3 months ago

This came straight out of classic who

[โ€“] orsetto@lemmy.dbzer0.com 2 points 3 months ago

Oracle (yes, the evil company) gives you one VPS for free

I hate that it's oracle...

[โ€“] orsetto@lemmy.dbzer0.com 2 points 3 months ago

3.60 โ‚ฌ/month is not bad. however i'd look for something even cheaper, given that the lowest plan gives 4 cores and 8gb of RAM, which I probably won't need

[โ€“] orsetto@lemmy.dbzer0.com 1 points 3 months ago (1 children)

You're the only one giving me a positive answer!

I do not mind RAID, so i won't lose data when a drive fails (the most valuable thing will be backups, which i mean, are backups, so not that critical if i can make a new one, but even losing other data would be a bit boring). I think I'd do software RAID tho, so if the controller breaks i wouldn't have to find the same model, which could be hard for old hardware i guess.

the other comments scared me about power consumption, so i'll have to investigate more of it.

[โ€“] orsetto@lemmy.dbzer0.com 2 points 3 months ago (1 children)

Old desktop pc would be ideal, for exactly the problems you pointed out. The only thing that is making me consider this is the already included drives, which is where i'd end up spending most of my money (especially now, thanks ai)

I mean, the same capacity would cost WAY too much more. For a similar capacity + the system i'd have to spend at least double :(

[โ€“] orsetto@lemmy.dbzer0.com 2 points 3 months ago (1 children)

yup, desktop components are what i was originally looking for, but this is 200 euros for a lot of storage, which would be way more expensive if i were to buy it separately

[โ€“] orsetto@lemmy.dbzer0.com 1 points 3 months ago (5 children)

Do you have an estimate on the energy consumption?

 

Hi! I've never had a server, except for a raspberry that I use as a DNS (pi-hole), but I've been wanting it for a long time. The other day I found something that is kinda old, but very cheap, and I've been thinking about buying it since then.

It's an IBM System x3500 M4. It has an E5-2620, 32 GB of DDR3, and 7 wonderful 900 GB SAS hard drives (don't know if actual hard disk or solid state), which would fulfill all of my linux ISOs needs for at least the next year (probably a bit more), and a RAID controller ServeRAID M5110. All for 210 euros, which I think is very cheap.

From what I know, the E5 is power hungry for modern standards, and the SAS drives are not exactly friendly for replacement parts. How much would that (mostly the SAS part) be a problem?

Also, what can I expect concerning RAID? That is definitely the most concerning thing for me, as I've never worked with it.

Another huge part is, I do not care about accessing it from the outside, but I'd be sharing this system with my brother, in another city, so we would have to figure out a way of doing it. Normally I'd use port forwarding, but we're both behind CG-NAT. Is there any way of not using a third party server as a proxy/VPN/whatever? If not, what service would you recommend for this purpose?

Another thing, my brother just happens to have a probably working, 16 GB ECC DDR3 stick laying around, except that it's 1600MHz, and the CPU only supports up to 1333MHz. I'm pretty sure that if I'd put two sticks with different frequencies, the CPU would use the lower one, but is that the case even if the CPU does not support the frequency of one of the stick? (in short, would putting the other stick work?)

If you have any other pointers or anything, let me know. Thank you :)

[โ€“] orsetto@lemmy.dbzer0.com 2 points 4 months ago (1 children)

Wait, i skimmed the website, it looks like a dream. What do you think of it/how long have you had it?

I'll (relatively) soon have to replace my current phone and i'm looking for a valid alternative.

It doesn't seem to be supported by lineageos tho, which is something I'd like (even if i never used it lol)

[โ€“] orsetto@lemmy.dbzer0.com 23 points 5 months ago

In this economy?

[โ€“] orsetto@lemmy.dbzer0.com 1 points 9 months ago

I mean for now it's not being requested to add other languages beside italian and english, and i'm pretty sure my employer will never care about languages he doesn't speak, so chances of languages that require some work other than translations are basically null.

[โ€“] orsetto@lemmy.dbzer0.com 6 points 9 months ago (2 children)

Sorry, I didn't think to add in the post that the translations are in fact of user generated content, and are themselves provided by users.

Project Fluent is still a good resource tho, thank you.

And also yeah, I'll use a better schema for language tags, that's a clear fault

Using an ID instead of the text content itself as part of the PK should be a no-brainer. Languages evolve over time, and translations change. PKs should not.

~~I still don't get why having a separate table for languages is useful. I mean, even if the translation changes, the language itself will remain the same, right?~~

Oh, right. Taking into account language variants makes VERY obvious why I'd want to use a table to store them.

people tend to believe that translating is enough to localize. It is not.

Onestly, I just hope that won't be something i should have to worry about. The rest of the codebase is as shitty as it gets, and I don't want to be the one to refactor it for proper localization. I'm implementing a new feature that allows me some degree of movement to think about a good design for that, and new, features, but this is as far as I'll go (Yes I know I probably sound like an ass but it really is that bad)

40
submitted 9 months ago* (last edited 9 months ago) by orsetto@lemmy.dbzer0.com to c/programming@programming.dev
 

Soo I'm working on a database that needs to support multiple languages (two for now, but who knows). I stumbled across this blog post that explains how to develop what it calls a "translation subschema" (haven't seen it called like this anywhere else so I don't know if it's actually how you'd call it), which seems like a very nice way of dealing with things.

I'm not very experienced with DB stuff, so it took me a while to fully understand what it was doing, but now that (I think) I do, I'm wondering if I could just ignore the Languages table, and just use a language field in the tables TextContent and Translations, without loosing any functionality. (except of course having a table listing the available languages, which is not however something I'm interested in)

In my head everything would still work, I'd insert stuff with

INSERT INTO TextContent (OriginalText, OriginalLanguage)
VALUES ("Ciao", "it");

DECLARE TextContentId INT = SCOPE_IDENTITY();

INSERT INTO Translations (TextContentId, Language, Translation)
VALUES (@TextContentId, "it", "Ciao");
INSERT INTO Translations (TextContentId, Language, Translation)
VALUES (@TextContentId, "en", "Hello");

and given a TextContentId, i'd retrieve the correct translation with

SELECT Translation FROM Translations WHERE TextContentId = TCId AND Language = "en"

At this point, I'm thinking I could drop TextContent too, and just have a Translations table with TextContentId, Language, and Translation, with (TextContentId, Language) as primary key.

Am I missing something? I'm trying to simplify this solution but I don't want to risk making random errors.

Edit: translations on the DB are for user inserted text, which will also provide translations. The client then will only receive text it the correct language.

 

The following is something I wrote earlier. I don't know the validity of it, and I'm not sure I correctly expressed the concepts of "power" and "rights" after translating them from italian.

--

Lately I had in mind the concept of right. Specifically, the idea Stirner had about it.

When I read The Ego and It's Own, that passage stuck with me.

[omitted unrelated stuff, because I started thinking about other things before writing what follows]

I'm thinking how the whole action of Giorgio Rosa [1] was anarchist in it's essence. He created that island just because he could do it: he had the power to do it.

I'm thinking about how many times I did something just because I could, and because I felt like it. I'm sure that more than once me and that-one-friend answered the question "why?" with "because we can". And I'm thinking how "because I can" is one of the fundamental hackers' "ideology" - mostly.

I'm thinking about how "because I can" is one of the most genuine motive that people have to justify their actions.

And, in fact, what I'm saying is somewhat tied to the concept of right. Right now, the first to decide if I have the power to do something is exactly my right to do it. And my rights, at the same time, are decided by people who have power over me! And so I say that the concept of "right" has no meaning, because I won't allow those people to hold power over me.

[1] (but not in its execution) https://en.wikipedia.org/wiki/Republic_of_Rose_Island

22
Help with sed commands (lemmy.dbzer0.com)
submitted 1 year ago* (last edited 1 year ago) by orsetto@lemmy.dbzer0.com to c/linux@lemmy.ml
 

Hi all! I have always only used sed with s///, becouse I've never been able to figure out how to properly make use of its full capabilities. Right now, I'm trying to filter the output of df -h --output=avail,source to only get the available space from /dev/dm-2 (let's ignore that I just realized df accepts a device as parameter, which clearly solves my problem).

This is the command I'm using, which works:

df -h --output=avail,source \
    | grep /dev/dm-2 \
    | sed -E 's/^[[:blank:]]*([0-9]+(G|M|K)).*$/\1/

However, it makes use of grep, and I'd like to get rid of it. So I've tried with a combiantion of t, T, //d and some other stuff, but onestly the output I get makes no sense to me, and I can't figure out what I should do instead.

In short, my question is: given the following output

$ df -h --output=avail,source 
Avail Filesystem
  87G /dev/dm-2
 1.6G tmpfs
  61K efivarfs
  10M dev
...

How do I only get 87G using only sed as a filter?

EDIT:

Nevermind, I've figured it out...

$ df -h --output=avail,source \
    | sed -E 's/^[[:blank:]]*([0-9]+(G|M|K))[[:blank:]]+(\/dev\/dm-2).*$/\1/; t; /.*/d'
85G
 

If you have typed an <ESC> by mistake, you can get rid of it with a C-g.

quoting the emacs tutorial. made me giggle

view more: next โ€บ