This commit is contained in:
2024-08-27 14:09:25 +02:00
parent 4c234af391
commit 2289895601
42 changed files with 473 additions and 232 deletions

View File

@@ -1,22 +1,26 @@
// % Categories: Notes
// % CreatedOn: 2022-08-05
// % Index: None
+++
Title = "Avoid accidentally calling commands in the terminal"
Dates = 2022-08-05
Draft = true
+++
{{< noticeAutomaticTranslation it >}}
# Avoid accidentally calling commands in the terminal
While working in the terminal, perhaps developing programs, I often accidentally invoke a command that I shouldn't.
This happens to me because I work like this: I edit something in my favorite text editor window, then go to the terminal window, and press `[Up Arrow]` (which recalls the last command executed) and `[Enter] ` to run it.
This happens to me because I work like this: I edit something in the window of my favorite text editor, then I go to the terminal window, and I press `[Up Arrow]` (which recalls the last command executed) and `[Enter] ` to run it.
What I've noticed is that sometimes, in my haste, I happen to press `[Up Arrow]` one too many times, which recalls the penultimate command executed, or the one even before it.
Since I practically do these sequences of actions almost automatically, without reading to make sure that the selected command is actually what I want before pressing `[Enter]` (because that's all I expect), it happens several times that I execute a command which I shouldn't: often, it's the command to make a commit [Git](https://en.wikipedia.org/wiki/Git){[:MdTgtBlank:]} of my changes to the workbook, and immediately load them in the cloud.
Since I practically do these sequences of actions almost automatically, without reading to make sure that the selected command is actually what I want before pressing `[Enter]` (because that's all I expect), it happens several times that I execute a command which I shouldn't: often, it's the command to make a commit [Git](https://en.wikipedia.org/wiki/Git){[:MdTgtBlank:]} of my changes to the workbook, and immediately upload them in the cloud.
Now, this is not good, because it means that in the Git history I will have certain "wrong" places: with descriptions with duplicate text, and the code in an unsuitable, non-working state, because I was in the middle of testing some changes.
Having such a messy Git history definitely affects its quality, because it's more difficult to find a specific past point in the code in the future, which nullifies one of the useful features of Git - and in general it's something I don't like, it annoys me , see dirty history.
Having such a messy Git history definitely affects its quality, because it's more difficult to find a specific past point in the code in the future, which nullifies one of Git's useful features - and in general it's something I don't like, it annoys me , see dirty history.
## The script
To solve the problem, I invented this little script (tested with _sh_ and _bash_), the idea is to launch the "dangerous" commands through it in situations in which I have to make those moves with the terminal (but, if desired, I it can be set as an alias to implicitly always call it for a given command).
To solve the problem, I invented this little script (tested with _sh_ and _bash_), the idea is to start the "dangerous" commands through it in situations in which I have to make those moves with the terminal (but, if desired, I it can be set as an alias to implicitly always call it for a given command).
<pre class="CodeScroll"><code>
Profile="~/.bashrc"

View File

@@ -1,7 +1,14 @@
// % Categories: Notes
// % CreatedOn: 2022-08-09
+++
Title = "Check interesting statistics and health of partitions on Linux"
Dates = 2022-08-09
Aliases = [
"/Posts/Notes/Linux/2022-08-09-Check-Interesting-Statistics-Partitions-Linux.html",
]
+++
{{< noticeAutomaticTranslation it >}}
# Check interesting statistics and health of partitions on Linux
Storage memories, whatever their category, degrade with wear.
Nothing can be done to avoid having to change them, sooner or later, after so many years. However, it is possible to keep an eye on their health status, in order to identify any problems.
@@ -14,7 +21,7 @@ Something quite secret, which not many people know (so it seemed to me, at least
This, obviously, regardless of whether you are using a pen drive, an SD card, a hard disk, a floppy disk, or even an even less usual memory.
[Ext4](https://en.m.wikipedia.org/wiki/Ext4){[:MdTgtBlank:]} provides several curious data - and its previous versions, Ext3 and Ext2, should do the same, but I haven't checked.
[F2FS](https://en.m.wikipedia.org/wiki/F2FS){[:MdTgtBlank:]} I also saw, directly from my Android smartphone, exposes some interesting information... which I won't address in detail, because they are all very dark and I don't know what they mean; and if I don't know what they mean, I'm not curious about them. It happens.
[F2FS](https://en.m.wikipedia.org/wiki/F2FS){[:MdTgtBlank:]} I also saw, directly from my Android smartphone, exposes some interesting information.. which I won't address in detail, because they are all very dark and I don't know what they mean; and if I don't know what they mean, I'm not curious about them. It happens.
As for other file systems, I haven't seen them at all. As homework, therefore, I give you to see if stuff like FAT32, exFAT, NTFS, or why not, BTRFS, exposes nice information, on Linux. And how?
## Get the data
@@ -81,7 +88,7 @@ In any case, just to be careful, it would be a good idea to always carry out rou
Speaking of microSD cards: they are almost disposable, they have an extremely limited life, given that their memory chips are the waste from the manufacturing of other, higher-end memories, such as SSDs.
What is known about their actual durability, at least of those that came out well from the factory and not of sub-brands?
You read all sorts of things online: there are those who say that every single memory cell can withstand 10,000 rewrites, and those who say that you can at most write 1,000 times the capacity of the memory before it completely fails (going into read-only mode)... no conclusion is reached.
You read all sorts of things online: there are those who say that every single memory cell can withstand 10,000 rewrites, those who say that you can at most write 1,000 times the capacity of the memory before it completely fails (going into read-only mode)... no conclusion is reached.
I have had cards like the one examined today, with a capacity of 32 GB, which, apart from the almost 2 TB written since the last formatting, in my opinion has seen at least 3 TB in total in its entire life, and yet it still seems fine; and then, I've had cards that started giving problems for much less. Maybe it's because I used the latter with crappy file systems, like FAT32 or exFAT, and for this reason they were constantly corrupting.

View File

@@ -1,18 +1,22 @@
// % Categories = Notes
// % CreatedOn = 2022-09-18
// % EditedOn = 2022-09-19
// % Index: None
+++
Title = "Bypass DRM in school books"
Subtitle = "(in a way that probably makes the operation possible even for non-scholastic texts.)"
Dates = 2022-09-18
Lastmod = 2022-09-19
Draft = true
+++
{{< noticeAutomaticTranslation it >}}
<!-- I should finish writing this... --->
# Bypass DRM of school books
**(in a way that probably makes the operation possible even for non-scholastic texts.)**
Here I am on my umpteenth little adventure.
This time I'm dealing with some stupid DRM, which I could, like many people, try to circumvent in a super-studied and perfect way... but, even in this case, the simplest solutions are the best.
My solution, however ugly and inelegant, is universal.
I didn't set out to write scraping programs to perhaps download books from sites, or to convert the strange formats of offline readers into more common formats. Who wants to start repaying everything you need, and 4 times, once for a different digital book supplier?
I didn't set out to write scraping programs to maybe download books from sites, or to convert the strange formats of offline readers into more common formats. Who wants to start repaying everything you need, and 4 times, once for a different digital book supplier?
I decided to use screen capture. Not handmade, clearly.
In any case, it is precisely from here that a path is born, aimed at solving small problems that suddenly arise, and at increasing efficiency under various factors.
@@ -20,20 +24,20 @@ In any case, it is precisely from here that a path is born, aimed at solving sma
## Why all this?
The reasons that push me to get into this mess are multiple.
Of course, it's because I need digital books, considering how convenient they are. Since I started high school I have only brought my lagging tablet, no paper brick books (except for a few bad apples, like the physics and Italian literature books, which are not provided digitally...). If I didn't do this, my backpack would explode and my thin loli back would shatter.
Of course, it's because I need digital books, considering how convenient they are. Since I started high school I only carry my lagging tablet, no paper brick books (except for a few bad apples, like the physics and Italian literature books, which are not provided digitally...). If I didn't do this, my backpack would explode and my thin loli back would shatter.
But why do I have to extract the books, and not use the publishers' applications?
**Apps don't work**
: The first reason is simply this. Some apps simply work badly, being slow to load the menu, a book, or even a page... when with a PDF or even images seen in the gallery I wouldn't have the slightest problem. Others don't work at all! They lose their session all the time, or even they are completely broken and think I'm offline, and I can't access my books.
: The first reason is simply this. Some apps simply work badly, being slow to load the menu, a book, or even a page... when with a PDF or even images seen in the gallery I wouldn't have the slightest problem. Others don't work at all! They lose their session all the time, or even are completely broken and think I'm offline, and I can't access my books.
<meta>
**I don't like proprietary software and DRM**
: In general, whenever possible I always try to do without proprietary software, preferring free tools to do the things I need to do. Proprietary software itself, however, is not necessarily always 100% bad, because sometimes it still gives you freedom 0<sup>[[↗️](https://it.m.wikipedia.org/wiki/Software_libero# Le_%C2%ABquattro_libert%C3%A0%C2%BB){[:MdTgtBlank:]}]</sup>, i.e. the possibility of always using the software for any purpose. Well, DRMs take away this too, they are the absolute inexcusable evil and, if already everything that I use for my purposes does not have DRMs (because it has never had them, or because they have been removed, by me or other people), it would be It's nice to resolve this issue also for school books, which I only use because the curriculum requires it.
: In general, whenever possible I always try to do without proprietary software, preferring free tools to do the things I need to do. Proprietary software itself, however, is not necessarily always 100% bad, because sometimes it still gives you freedom 0<sup>[[↗️](https://it.m.wikipedia.org/wiki/Software_libero# Le_%C2%ABquattro_libert%C3%A0%C2%BB){[:MdTgtBlank:]}]</sup>, i.e. the possibility of always using the software for any purpose. Well, DRMs take away this too, they are the absolute inexcusable evil and, if already everything that I use for my purposes does not have DRMs (because it has never had them, or because they have been removed, by me or other people), it would be It's nice to resolve this issue also for school books, which I use only because the curriculum requires it.
<meta>
**Being able to preserve and share books**
: Paper books, once you buy them, you own them. You can do whatever the hell you want with them, and they don't disappear overnight because some burnt nut head decided the license is expired. Why shouldn't it be like this for digital ones? I'm not into it, so I want to preserve them - as a matter of principle, not because I think I'll reopen them again after school... personally I prefer to search the web for anything I find I want or need to know. As a bonus, I will also upload them online, so that anyone who wants to download them can do so (if they want it for personal study and not for school use, since these publishers reprint the books every year and schools always fall for their scam).
: Paper books, once you buy them, you own them. You can do whatever the hell you want with them, and they don't disappear overnight because some burnt nut head decided the license is expired. Why shouldn't it be like this for digital ones? I'm not into it, so I want to preserve them - as a matter of principle, not because I think I'll reopen them after school... personally I prefer to search the web for anything I find I want or need to know. As a bonus, I will also upload them online, so that anyone who wants to download them can do so (if they want it for personal study and not for school use, since these publishers reprint the books every year and schools always fall for their scam).
_...Still writing... These notes will be updated from time to time._

View File

@@ -1,11 +1,20 @@
// % Title = 2⃣ Synchronized gaming between PlayStation 2 and smartphone
// % CreatedOn = 2023-10-17
// % Downsync = /Posts/Notes/Gaming-Sincronizzato-PS2-Smartphone.html
// % HTMLTitle = <span class="twa twa-2⃣"><span>2</span></span> Synchronized gaming between PlayStation 2 and smartphone
// % Description = In detail, how I designed a system to always have games and saves synchronized between the emulator and the real PS2 console, shared here.
// % Categories = Gaming Notes
// % EditedOn = 2023-10-18
+++
Title = "2⃣ Gaming synchronized between PlayStation 2 and smartphone"
Dates = 2023-10-17
Lastmod = 2023-10-18
Downsync = "/it/posts/Notes/Gaming-Sincronizzato-PS2-Smartphone.html"
Aliases = [
"/Posts/Notes/2023-10-17-Gaming-Sincronizzato-PS2-Smartphone.html",
]
Description = "In detail, how I designed a system to have games and saves always synchronized between the emulator and the real PS2 console, shared here."
Categories = [ "Gaming" ]
+++
{{< noticeAutomaticTranslation it >}}
<!-- Autogenerated by ListedDownsync.js. Do not edit (unless also set "% Downsync = False") - it would be overwritten. -->
<h1><span class="twa twa-2⃣"><span>2</span></span> Synchronized gaming between PlayStation 2 and smartphone</h1>
<p>Those who have been following my adventures for long enough and with due attention perhaps know this, but the biggest problem in computer science is: how to properly reconcile the discrepancies that are created when we face the problem of playing video games both at home than in portability? Between games that in one case are comfortable to play and in another perhaps don't even run, and the saves that are spread across countless different devices, solving this problem completely will never be possible...<br>
@@ -19,7 +28,7 @@ And then, just the other day, staring at the console (I'm not sure why), I thoug
<p>At the time, the simplest idea I thought of was: they exist <a href="https://www.amazon.it/Adattatore-Memoria-Lettore-Sostitutivo-trasparente/dp/B0C8TTQFJY" rel= "noopener nofollow" target="_blank">adapters</a> to use a microSD card as a PlayStation memory card (which use a non-standard interface instead)... it might be worth buying one of those, so I keep them all there the saves, and if desired I can also access them from other devices by moving the card around.<sup id="fnref1"><a class="footnote-ref" href="#fn1">1</a></sup> <br>
With a card of several GB (there aren't any small ones around anymore anyway), furthermore, I could even do without the USB stick and keep all the games only on the memory card!</p>
<p>Fortunately, this is not the only way, at least for certain games: <a href="https://github.com/ps2homebrew/Open-PS2-Loader" rel="noopener nofollow" target="_blank ">Open PS2 Loader</a>, the homebrew that runs commercial games from backup storage (such as USB sticks), supports the use of virtual memory cards (VMCs) that are saved as files on the USB drive. Games are quite slow to save on it (the PS2 only supports USB 1.1, plus there's some strange overhead), but it's an apparently workable solution.</p>
<p>Fortunately, this is not the only way, at least for certain games: <a href="https://github.com/ps2homebrew/Open-PS2-Loader" rel="noopener nofollow" target="_blank ">Open PS2 Loader</a>, the homebrew that runs commercial games from backup storage (such as USB sticks), supports the use of virtual memory cards (VMCs) that are saved as files on the USB drive. Games are quite slow to save on that (the PS2 only supports USB 1.1, plus there's some strange overhead), but it's an apparently workable solution.</p>
<h2>Hitch 2: Save conversion</h2>

9
en/note/_index.md Normal file
View File

@@ -0,0 +1,9 @@
+++
Title = "Notes"
Aliases = [
"/Categories/Note.html",
]
+++
{{< noticeAutomaticTranslation it >}}