Joshua
Server Up
so i guess i made website... really simple rails application. User account, tasks, skills and posts. The backend was relatively straight forward, i mean beyond active storage there is nothing particularly special. Active storage, in rails framework is library for managing resources like pictures, videos, etc... Well, i dont like it. It is rubbish. Any memory management is nonexistent, there are ton of tables that i dont even know what... Like really, how hard is it to delete file from disk when no element of website owns it?.. the shrinking so everything doesnt load on full resolution... With bandwith and cpu being limited... it is really not good idea to stream Fellowship of Ring in 4 in two visible elements at same time. anyway... what i do...when file is uploaded, i check bytes, instead of trusting extension... like normal personal would. Then I check if there is not file of same, same byte signature and same size... if yes, then i increment "owner count", not saving file again on disk... again, like sensible person... If the file has same name, but differs to existing file of same name and type... it simply gets new name like "dragon.png" will be "dragon_1.png" on disk. Then when element that owned a file is deleted, it will decrement and check owner count. obviously, if owner count > 0 the file stays on disk... if, However, owner count <= 0 then it deletes the file. For performance, each file saved to disk creates thumbnail about 255x188 for performance, no tables, nothing... thumbnail is linked to file saved.... Next server... Im using raspberry pie 5.. i happened to have it stuffed in my mattress. So finally it has usage... Having domain is very nice, since you dont need to type IP address all the type, fight a router to connect. Plus it offers benefit like https, dns tunneling. The whole raspberry needed to be reflashed couple times, i botched wifi configuration, broke the case and i think i short-circuited the display. I have also added usb and scripted backup periodically to usb, since microSD, where the whole thing is, is as stable as me. Since the case is broken i needed to patch it together.. So now whole server is patched with ducktape from sides with usb sticking out like some ghetto device. But it works and I own my data
comments