diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/blog/2022-09-10-netbooks/darkstar.jpg | bin | 0 -> 3578876 bytes | |||
| -rw-r--r-- | src/blog/2022-09-10-netbooks/final.jpg | bin | 0 -> 6089913 bytes | |||
| -rw-r--r-- | src/blog/2022-09-10-netbooks/hd.jpg | bin | 0 -> 5031032 bytes | |||
| -rw-r--r-- | src/blog/2022-09-10-netbooks/netbooks.md | 305 | ||||
| -rw-r--r-- | src/blog/2022-09-10-netbooks/scramble.jpg | bin | 0 -> 4134845 bytes | |||
| -rw-r--r-- | src/blog/blog.md | 1 | ||||
| -rw-r--r-- | src/blog/feed.xml | 7 |
7 files changed, 313 insertions, 0 deletions
diff --git a/src/blog/2022-09-10-netbooks/darkstar.jpg b/src/blog/2022-09-10-netbooks/darkstar.jpg new file mode 100644 index 0000000..3d32dd1 --- /dev/null +++ b/src/blog/2022-09-10-netbooks/darkstar.jpg | |||
| Binary files differ | |||
diff --git a/src/blog/2022-09-10-netbooks/final.jpg b/src/blog/2022-09-10-netbooks/final.jpg new file mode 100644 index 0000000..63b33bf --- /dev/null +++ b/src/blog/2022-09-10-netbooks/final.jpg | |||
| Binary files differ | |||
diff --git a/src/blog/2022-09-10-netbooks/hd.jpg b/src/blog/2022-09-10-netbooks/hd.jpg new file mode 100644 index 0000000..525726b --- /dev/null +++ b/src/blog/2022-09-10-netbooks/hd.jpg | |||
| Binary files differ | |||
diff --git a/src/blog/2022-09-10-netbooks/netbooks.md b/src/blog/2022-09-10-netbooks/netbooks.md new file mode 100644 index 0000000..4d84a46 --- /dev/null +++ b/src/blog/2022-09-10-netbooks/netbooks.md | |||
| @@ -0,0 +1,305 @@ | |||
| 1 | # Long live netbooks! | ||
| 2 | |||
| 3 | [*Netbook*](https://en.wikipedia.org/wiki/Netbook) was a term used | ||
| 4 | around 2010 to describe small laptops. They could be anywhere from 8" | ||
| 5 | to 11" in screen size. One of the most popular lines of netbooks were the | ||
| 6 | [Asus eee PCs](https://en.wikipedia.org/wiki/Asus_Eee_PC). | ||
| 7 | |||
| 8 | The appeal was clear: you could bring this tiny computer around and take | ||
| 9 | advantage of any free wifi connection - be it on a train, in a pub or | ||
| 10 | at school - to surf the web. | ||
| 11 | |||
| 12 | Netbooks had an unfortunate destiny for at least two reasons. Firstly, | ||
| 13 | laptop technology was not at a point where you could have a small, | ||
| 14 | relatively powerful and cheap device all in one. Most netbooks were | ||
| 15 | underpowered and struggled to run Windows out of the box. Secondly, | ||
| 16 | smartphones and tablets, that came out very shortly after, quickly | ||
| 17 | overtook the netbooks' market share and sent them to oblivion. | ||
| 18 | |||
| 19 | This post is going to be in two parts: first I want to talk about the | ||
| 20 | netbook I got in 2010 and how it turned out to be useful in 2022. The | ||
| 21 | second part is going to be a list of steps I took to set it up after | ||
| 22 | re-installing OpenBSD on it. | ||
| 23 | |||
| 24 | ## Part 1: My "darkstar" | ||
| 25 | |||
| 26 | ### In the 2010's | ||
| 27 | |||
| 28 | Back in 2010, when I was in high school, I started going on 4-5 days long | ||
| 29 | trips about once every two months or so. I did not have a laptop, only a | ||
| 30 | desktop PC, so my mother thought it was a good idea to get me a netbook. | ||
| 31 | She chose an Asus 1001px, a very standard 10" netbook. It was in many | ||
| 32 | ways un unremarkable machine, with 1Gb of ram a weak dual core CPU. But | ||
| 33 | it got its job done. | ||
| 34 | |||
| 35 |  | ||
| 36 | |||
| 37 | It ran some Windows monstrosity that I did not dare touching (was it | ||
| 38 | Vista or 7?). I immediately installed Linux on it. My favorite distro | ||
| 39 | at the time was [Slackware](http://www.slackware.com/), but I decided | ||
| 40 | to try out Arch on this one. I used the hostname *darkstar*, because | ||
| 41 | it was the default on my favourite distro and it fit nicely with it's | ||
| 42 | black plastic. I have used that name for this laptop on every other OS | ||
| 43 | I installed on it ever since. | ||
| 44 | |||
| 45 | Arch Linux was a bad choice: since I would use this netbook only once | ||
| 46 | every two months, every time I updated it something broke. Or, as an Arch | ||
| 47 | fanboy would say nowadays, "something required manual intervention". At | ||
| 48 | some point I got rid of Arch and installed Slackware. | ||
| 49 | |||
| 50 | I also used it without problems at the beginning of university, in 2013, | ||
| 51 | but after a few months I bought a more powerful 15" regular laptop. | ||
| 52 | All in all I have not used my darkstar much, but it was a useful tool. | ||
| 53 | |||
| 54 | ### Distro hopping in 2020 | ||
| 55 | |||
| 56 | When the first lockdowns came in March 2020 I had decided to use my | ||
| 57 | netbook for some little experiments. Nothing crazy, just trying out some | ||
| 58 | distros and play around with them - had *distro-hopped* since 2011 or so. | ||
| 59 | |||
| 60 | I installed [Alpine](https://www.alpinelinux.org/) first. It was fine, | ||
| 61 | but the lack of man pages by default did not amuse me. Then I tried | ||
| 62 | [Void](https://voidlinux.org/), that I ended up installing on my main | ||
| 63 | laptop later that year and I am still using as my main OS to this day. | ||
| 64 | Finally I decided to try something different and went with OpenBSD. | ||
| 65 | |||
| 66 | ### Backpacking in 2022 | ||
| 67 | |||
| 68 | Earlier this year I traveled around Europe for a couple of weeks, | ||
| 69 | mainly to attend the | ||
| 70 | [Rubik's Cube European Championship](https://www.worldcubeassociation.org/competitions/Euro2022) | ||
| 71 | and other events. I wanted to travel with just a backpack, no suitcase, | ||
| 72 | and my main laptop is quite large and heavy. I did not want to rely on | ||
| 73 | my smartphone alone, so I thought that carrying around my old netbook | ||
| 74 | could be a good compromise. | ||
| 75 | |||
| 76 | I kept OpenBSD, because I figured I would mostly use it in tty only, no X, | ||
| 77 | and the command line utilities seem more polished and cohesive on | ||
| 78 | OpenBSD than on Linux. Using something like Firefox was doable in case | ||
| 79 | of emergency, but definitely not a pleasant experience. Some things | ||
| 80 | like streaming videos from YouTube were completely impossible - | ||
| 81 | but there were workarounds like using | ||
| 82 | [yt-dlp](https://github.com/yt-dlp/yt-dlp). | ||
| 83 | |||
| 84 | I decided to buy a larger battery, that also made it stand a bit taller, | ||
| 85 | kinda like a typewrite, and some extra RAM - I maxed it out at 2Gb, it | ||
| 86 | cannot handle more. Since the hard drive was not easily accessible without | ||
| 87 | taking apart the whole thing, I did not upgrade to an SSD drive at first. | ||
| 88 | I was afraid of not being able to detach and re-attach the keyboard and | ||
| 89 | touchpad connectors without damaging them. | ||
| 90 | |||
| 91 | My little netbook turned out to be more useful than I thought: the | ||
| 92 | organization team at a cube competition I attended during that trip was | ||
| 93 | short on laptops, and mine was perfectly capable of displaying pdf files. | ||
| 94 | The fact that there was no file manager installed made it a bit hard | ||
| 95 | for other people to operate it when I was not around, but in the end we | ||
| 96 | managed to use it. | ||
| 97 | |||
| 98 |  | ||
| 99 | |||
| 100 | After the trip I kept using it occasionally, as a "sofa laptop". I wrote | ||
| 101 | a couple of these blog posts on it. Who needs more than 1Gb of ram to | ||
| 102 | write some Markdown and push it with rsync? | ||
| 103 | |||
| 104 | A few weeks ago I changed my mind about the hard drive and tried | ||
| 105 | disassemblying *darkstar* completely, just to reassemble it and check | ||
| 106 | that all went well. And it did! So I bought a cheap SSD and used it to | ||
| 107 | replace the original hard drive. | ||
| 108 | |||
| 109 |  | ||
| 110 | |||
| 111 | Of course when putting everything back together I somehow improperly | ||
| 112 | attached the keyboard, so that it worked in the BIOS but not after boot, | ||
| 113 | and I also damaged the touchpad connector. Luckily I was able to fix | ||
| 114 | both these issues. | ||
| 115 | |||
| 116 | I was finally ready to install OpenBSD 7.1 on the new SSD. | ||
| 117 | |||
| 118 | ## Part 2: Installing and configuring OpenBSD | ||
| 119 | |||
| 120 | This section is probably more useful for me as a personal note than for | ||
| 121 | anyone else who might be reading it. Nonetheless I figured people might | ||
| 122 | be curious, and it does not hurt to publish it here. If you don't care | ||
| 123 | about it, just skip to the "Conclusion" section at the end. | ||
| 124 | |||
| 125 | The whole install process was super simple and took about 6 minutes. | ||
| 126 | The new SSD drive probably helped a lot here. After the installation of the | ||
| 127 | base system was completed, I made a few tweaks and added some packages. | ||
| 128 | I am not one of those cool people who have a git repository with all their | ||
| 129 | config files and script that put everything into place automatically, I just | ||
| 130 | do everything by hand. Since I don't reinstall my OS every other day it is | ||
| 131 | not a big deal. | ||
| 132 | |||
| 133 | ### Security patches | ||
| 134 | |||
| 135 | First I updated the base system by installing the newest security patches | ||
| 136 | with `syspatch(8)` | ||
| 137 | |||
| 138 | ``` | ||
| 139 | # syspatch | ||
| 140 | Get/Verify syspatch71-001_wifi.tgz 100% |********************| 4423KB 00:003 | ||
| 141 | Installing patch 001_wifi | ||
| 142 | syspatch: updated itself, run it again to install missing patches | ||
| 143 | ``` | ||
| 144 | |||
| 145 | Ok then, one more time | ||
| 146 | |||
| 147 | ``` | ||
| 148 | # syspatch | ||
| 149 | (...) | ||
| 150 | Errata can be reviewed under /var/syspatch | ||
| 151 | ``` | ||
| 152 | |||
| 153 | All good now! | ||
| 154 | |||
| 155 | ### Enabling doas for the regular user | ||
| 156 | |||
| 157 | OpenBSD's `doas` is roughly the equivalent of Linux's `sudo`. Unlike `sudo`, | ||
| 158 | we just need a one-line config file to use it: | ||
| 159 | |||
| 160 | ``` | ||
| 161 | # echo 'permit persist :wheel' > /etc/doas.conf | ||
| 162 | ``` | ||
| 163 | |||
| 164 | ### Swap caps lock and escape | ||
| 165 | |||
| 166 | I like to have the Caps Lock key function as Escape, and vice versa. To have | ||
| 167 | this in X one can use `setxkbmap -option caps:swapescape`, but for the OpenBSD | ||
| 168 | console we need to use `wsconsctl(8)`, or to edit `wsconsctl.conf(5)` if we | ||
| 169 | want to make it permanent: | ||
| 170 | |||
| 171 | ``` | ||
| 172 | # cat > /etc/wsconsctl.conf | ||
| 173 | keyboard.map+="keycode 58 = Escape" | ||
| 174 | keyboard.map+="keycode 1 = Caps_Lock" | ||
| 175 | ^D | ||
| 176 | ``` | ||
| 177 | |||
| 178 | The change won't happen until we reboot or we issue the | ||
| 179 | corresponding `wsconsctl` commands. | ||
| 180 | |||
| 181 | ### Generating ssh keys | ||
| 182 | |||
| 183 | Simply run | ||
| 184 | |||
| 185 | ``` | ||
| 186 | $ ssh_keygen | ||
| 187 | ``` | ||
| 188 | |||
| 189 | to get a new pair for RSA keys. Using another device (with its own ssh key), I then | ||
| 190 | copy the public key to my server's `.ssh/authorized_keys` file. | ||
| 191 | |||
| 192 | ### Installing and configuring syncthing | ||
| 193 | |||
| 194 | I use [syncthing](https://syncthing.net/) to share some files and folders | ||
| 195 | between my devices. It is a nice and flexible piece of software that does | ||
| 196 | not rely on any centralized service. I use it both to keep important files | ||
| 197 | synchronized between my main devices and to quickly exchange | ||
| 198 | data locally between my phone and my laptop (e.g. pictures). One of the | ||
| 199 | advantages about its decentralized structure is that in the latter case | ||
| 200 | I do not need an internet connection (nor a cable). | ||
| 201 | |||
| 202 | After installing syncthing with | ||
| 203 | |||
| 204 | ``` | ||
| 205 | # pkg_add -u syncthing | ||
| 206 | ``` | ||
| 207 | |||
| 208 | I enabled the corresponding service | ||
| 209 | |||
| 210 | ``` | ||
| 211 | # rcctl enable syncthing | ||
| 212 | ``` | ||
| 213 | |||
| 214 | I also want it to run as my user instead as the default `_syncthing` user: | ||
| 215 | |||
| 216 | ``` | ||
| 217 | # rcctl set syncthing user sebastiano | ||
| 218 | ``` | ||
| 219 | |||
| 220 | Finally, I had to adjust the file descriptor limits. As documented in the | ||
| 221 | official doc `/usr/local/share/doc/pkg-readmes/syncthing`: | ||
| 222 | |||
| 223 | ``` | ||
| 224 | Syncthing is fairly hungry for file descriptors and the default limits may be | ||
| 225 | insufficient. On OpenBSD, Syncthing uses kqueue(2) to "watch" files, and since | ||
| 226 | kqueue(2) doesn't support recursive watching, each file has be watched | ||
| 227 | individually. The upshot of this is that each file in a watched folder will use | ||
| 228 | one file descriptor. | ||
| 229 | |||
| 230 | If you run Syncthing via the rc.d(8) script, then you can give | ||
| 231 | Syncthing more file descriptors by adding the following to login.conf(5): | ||
| 232 | |||
| 233 | syncthing:\ | ||
| 234 | :openfiles-cur=4096:\ | ||
| 235 | :openfiles-max=4096:\ | ||
| 236 | :tc=daemon: | ||
| 237 | |||
| 238 | Don't forget to rebuild the login.conf.db file (if necessary): | ||
| 239 | |||
| 240 | # [ -f /etc/login.conf.db ] && cap_mkdb /etc/login.conf | ||
| 241 | |||
| 242 | Note that in addition to ulimits, there is a kernel-level file descriptor limit | ||
| 243 | which may also need to be adjusted. This limit is managed through the | ||
| 244 | kern.maxfiles sysctl(8). | ||
| 245 | ``` | ||
| 246 | |||
| 247 | So let's be generous and set these limits very high: | ||
| 248 | |||
| 249 | ``` | ||
| 250 | # echo "kern.maxfiles=4000000" > /etc/sysctl.conf | ||
| 251 | # cat > /etc/login.conf | ||
| 252 | |||
| 253 | syncthing:\ | ||
| 254 | :openfiles-cur=1000000:\ | ||
| 255 | :openfiles-max=1000000:\ | ||
| 256 | :tc=daemon: | ||
| 257 | ^D | ||
| 258 | ``` | ||
| 259 | |||
| 260 | I can then configure syncthing using its web-based interface. To avoid | ||
| 261 | opening up a full-fledged web browser on this poor little thing, I can | ||
| 262 | use *ssh port forwarding* from my other laptop: | ||
| 263 | |||
| 264 | ``` | ||
| 265 | # ssh -N -L 8888:localhost:8384 darkstar | ||
| 266 | ``` | ||
| 267 | |||
| 268 | (I won't go into detail on this command; `darkstar` is the hostname of my | ||
| 269 | netbook, `8384` is syncthing's default port for its web-based interface, | ||
| 270 | `8888` was picked arbitrarily.) | ||
| 271 | |||
| 272 | I can then open `http://localhost:8888` from my other laptop to access | ||
| 273 | my netbook's syncthing configuration and add other devices and shared | ||
| 274 | folders. | ||
| 275 | |||
| 276 | ### All the rest | ||
| 277 | |||
| 278 | Now all that is left to do is pretty straightforward: install some more programs | ||
| 279 | (such as a browser, a media player and a pdf reader), copy my config files (e.g. | ||
| 280 | `.profile`, `.nexrc`) from my shared folder, clone some of my git repos. | ||
| 281 | |||
| 282 | Nothing that is worth describing in detail here. | ||
| 283 | |||
| 284 | ## Conclusion | ||
| 285 | |||
| 286 | I like my netbook, and I am glad that I found some practical use for | ||
| 287 | it even after 12 years. It's size make it a nice sofa companion, and | ||
| 288 | its clicky keyboard is just a pleasure to type on - much better than the | ||
| 289 | mushy one of my main laptop! It is always a pleasure for me to make good | ||
| 290 | use of a piece of hardware that most people would consider obsolete and | ||
| 291 | throw away without thinking twice. | ||
| 292 | |||
| 293 | Netbooks were not successful in their time, but I think similar devices | ||
| 294 | could find their niche today. After all, 13" laptops are quite popular | ||
| 295 | among the few who actually need one over a tablet or a smartphone. I | ||
| 296 | am even considering getting an 11" laptop as my next main device - but | ||
| 297 | of course I would never replace my current one as long as it is working | ||
| 298 | fine :-) | ||
| 299 | |||
| 300 | Long live netbooks! | ||
| 301 | |||
| 302 | To conclude, here is a picture of my netbook being used to write this | ||
| 303 | very post: | ||
| 304 | |||
| 305 |  | ||
diff --git a/src/blog/2022-09-10-netbooks/scramble.jpg b/src/blog/2022-09-10-netbooks/scramble.jpg new file mode 100644 index 0000000..0d9cb5f --- /dev/null +++ b/src/blog/2022-09-10-netbooks/scramble.jpg | |||
| Binary files differ | |||
diff --git a/src/blog/blog.md b/src/blog/blog.md index 41008ec..7af22f3 100644 --- a/src/blog/blog.md +++ b/src/blog/blog.md | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | [RSS Feed](feed.xml) | 3 | [RSS Feed](feed.xml) |
| 4 | 4 | ||
| 5 | * 2022-09-10 [Long live netbooks!](2022-09-10-netbooks) | ||
| 5 | * 2022-09-05 [Pipe man into col -b to get rid of \^H](2022-09-05-man-col) | 6 | * 2022-09-05 [Pipe man into col -b to get rid of \^H](2022-09-05-man-col) |
| 6 | * 2022-08-14 [How I update my website](2022-08-14-website) | 7 | * 2022-08-14 [How I update my website](2022-08-14-website) |
| 7 | * 2022-07-07 [The man page reading club: shutdown(8)](2022-07-07-shutdown) | 8 | * 2022-07-07 [The man page reading club: shutdown(8)](2022-07-07-shutdown) |
diff --git a/src/blog/feed.xml b/src/blog/feed.xml index 6c4a0a3..bb05925 100644 --- a/src/blog/feed.xml +++ b/src/blog/feed.xml | |||
| @@ -9,6 +9,13 @@ Thoughts about software, computers and whatever I feel like sharing | |||
| 9 | </description> | 9 | </description> |
| 10 | 10 | ||
| 11 | <item> | 11 | <item> |
| 12 | <title>Long live netbooks!</title> | ||
| 13 | <link>https://sebastiano.tronto.net/blog/2022-09-10-netbooks</link> | ||
| 14 | <description>Long live netbooks!</description> | ||
| 15 | <pubDate>2022-09-10</pubDate> | ||
| 16 | </item> | ||
| 17 | |||
| 18 | <item> | ||
| 12 | <title>Pipe man into col -b to get rid of \^H</title> | 19 | <title>Pipe man into col -b to get rid of \^H</title> |
| 13 | <link>https://sebastiano.tronto.net/blog/2022-09-05-man-col</link> | 20 | <link>https://sebastiano.tronto.net/blog/2022-09-05-man-col</link> |
| 14 | <description>Pipe man into col -b to get rid of \^H</description> | 21 | <description>Pipe man into col -b to get rid of \^H</description> |
