Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Sunday, April 20, 2025

MacBook Air (early 2015)

Those things, now that Apple no longer provides updates to macOS for Intel Macs, are getting really inexpensive by now.

My latest purchase was an 11" MacBook Air (early 2015) with an Intel Core i5, 8GB RAM and a 128GB SSD. The thing cost me €150 and came in good condition. There is a scratch on the clam shell, nothing I do care about. 
When I ordered the device, the one thing I cared about was the 8GB of RAM. I do not actually care about the amount of storage that came with it for two reasons, both of those later in this post. The other thing some people might be bothered by is the Intel Core i5, rather than a Intel Core i7. My understanding is that the i7s used in this machine were just i5s which could run of a higher clock speed, correct me if I am wrong. And here, the i5 actually plays into my use case of the device, lower CPU clock speed means longer battery life. So, for my use case, the i5 was a good thing.

There was a lot of typing "use case" in the previous section. Here is what I intend to use the thing for: travel. Hours of battery operations with tasks such as text-processing or displaying PDF-documents. With the speed of my typing, the entire computer might just to to sleep between the hits on the keyboard. And as for reading, maybe an e-Ink display would suit me better...

Those Intel-Apples are getting pretty inexpensive by now, but by no means those are cheap computers. The build-quality is exceptional, at least in this generation; the one with the good keyboards. The screen is what it is, good enough for me though. Me needing reading glasses by now, I wonder if "Retina Displays" would make any severe difference to me.

Apple is phasing out the support for Intel Macs, hence their low prices on the 2nd-hand market. Is this a bad thing? Yes and No!
Over the last few years, I did secure a few bargain Intel Macs of my likings, knowing that Linux can be installed on those very easily. My (presently) preferred flavour is Linux-Mint Cinnamon. Very easy to install, very easy to deal with. Disclaimer: my experience with Linux dates from 1993 onwards, with SLS and Slackware. And even before that I was using 386BSD. So, my definition of easy might differ from yours.
Installing Linux-Mint Cinnamon exhibit only a single simple to overcome hurdle: the lack of a WiFi-driver. I overcame this by using a generic USB-WiFi-dongle, which got me online. Once the OS was up, I could install the required driver. Now Linux was up and running. HOWEVER, the facetime-camera did not work and I could not get it to work either. With the camera not working, the ambient light adjustment does not do anything While I could ignore the camera, the ambient light-thing was a real bummer!
So, I decided to re-install some macOS for the time being. There are some options to do that, depending on what is wanted: https://support.apple.com/guide/mac-help/reinstall-macos-mchlp1599/mac
First time I tried Option-Command-R, every fell apart... now idea why.
I then tried Options-Shift-Command-R (finger acrobatics involved!), which worked (I don't recall which OS this ended up with).
Some time later, the first option worked, resulting in macOS Monterey.
One of my initial thoughts was to run Linux and macOS parallel, which dual boot, using the macOS home directory from Linux. While dual boot worked out for me, the using of the macOS home-directory from Linux did not.
There is another idea, which would work, but for the time being does not appear practical to me: partition the SSD into 3 parts. A first for macOS (APFS), a second for Linux (ext4) and a third for home (exFAT). I am pretty sure this would work, however, 128GB are pretty tight for such games.

Now to the elephant in the room, the jumping point (German: der springende Punkt) here is the use-case again. How much storage is actually needed? See above, some LibreOffice documents here and there, some PDFs here and there... not much space needed for those. Of course it is a different story should one consider photo-shoots in RAW or even videos. But, let's be honest, who would consider a MacBook Air for video editing?
As promised, there are 2 solutions to consider:
  1. Upgrade the machine with a bigger SSD. No problem with the MB-A 2015. The back can be removed easily, just a few screws to remove and it pops right off. Apple uses a proprietary SSD socket, however, adapters (eg. from China) to regula M.2 from can be found for about €2. Not all M.2 SSDs will work, you will find information about this on the InterWeb.
  2. Just of what you have, that's what I do. In addition to the internal SSD, I am using an old WD external USB3 spinny HDD. This external HDD serves 2 distinct purposes 1) external storage (dah) and 2) time-machine backups. The setup of such a disk is explained below.
Setting up the external USB3 disk is no magic either, however, at first, this might not be as obvious as it seems to the regular consumer.
My path was the following:
  • using disk-utility to erase the NTFS partition
  • reformat as APFS
  • partition the external HDD into an APFS particion twice the size of the internal SSD
  • format the remainder of the external HDD with exFAT 
Why exFAT for the second partition, you might ask. Simply said the two partitions will serve different purposes. The APFS partition will serve Time-Machine for backups.
The exFAT partition can be used as external data storage, which can be used with non-macOS computers, thereby allowing for very easy data transfer. Think of the photos or videos I mentioned above.

In my case, we are looking at 
  • 128 GB internal SSD
  • 256 GB Time-Machine storage
  • 768 GB shared/scrap/data/video/photo/etc space
Will the external drive connected all times? Of course not. When out and about, 128GB seems more than enough. Once back at the bed, connect the drive, backups will start, move the data about. All good! To be honest, I don't think that I would need any more storage than that in a daily task situation.

Concluding: get one of this Intel MacBooks now that they are soooo cheap. Don't get any of the ones with the bad butterfly keyboards! (older is better in this respect, DO THE RESEARCH). 
Review you use-case. What to you actually need when using your ultra-portable computer.

As a final tip: When you are already in your MacBook, apply fresh thermal paste to the CPU. Do that in the manner you found thermal compound in there. Apple left out parts of exposed semiconductors for a reason.
After having applied fresh thermal paste to my MacBook Air 11" (early 2015), I have not heard of the fan since.

 

Monday, April 14, 2025

PYTHON on a Chromebook

Spoiler: Thonny works.

In my previous post, I touched the topic of running Linux and BASIC on a Chromebook. The question was, does Thonny (Python 3) run too? Yes, it does.

Installing Thonny by
sudo apt install thonny
draws in a lot of stuff and takes a while. However, in the end you will get a working Thonny with a Python3 interpreter. I have not checked out any of the advanced things, such as matplotlib or NumPy. Presently I do feel confident that those will work just fine.


BASIC on a Chromebook

This continues my series into the past of many of us. Many of us learned programming by using the BASIC language. I school, I was forced to learn PASCAL, which was not of much use, other than understanding programming principles, which I already knew from BASIC. Learning F0RTRAN was the real step into the world of computing.

Anyway, this post is about BASIC on Chromebooks. I do own several of those. Not everyone of those is able to run Linux easily (there is always a way to force the hardware, one way or the other). This post is concerned with Chromebooks which can be easily set to run Linux applications.

To set any such Chromebook to do that, access "Settings" => "About ChromeOS" => "Linux Development Environment". If your Chromebook has that, install the Linux-thing. This might take a while.

Once your Chromebook has the virtual machine with (Debian) linux on board, you might start a (Linux) terminal and install "BWBASIC" by typing
sudo apt install bwbasic
in the terminal.

For the fun of it, I did install geany the same way. Now you can run your BASIC programs on a Chromebook in style. 
I have not yet checked the use of the FreeBasic Compiler. I see no reason why this should not work.

Can I run Python/Thonny on my ChromeBook? Stay tuned!


Friday, February 28, 2025

BASIC on Linux

Who does not remember the good old times when all (home) computers came with BASIC. To recreate the good old time feeling, BASIC had to be back on my Linux systems.

I figured out a combination of bwbasic and FreeBasic

The Bywater BASIC interpreter offers an interactive environment, similar to GW-BASIC. With a tiny trick, bwbasic can be used in a batch mode directly from shell. The "trick" being using the SYSTEM or QUIT statement at the end of the code, rather than the END statement. Here is an example:

10 for i=0 to 10
20 gosub 100
30 next
40 ?
50 system
100 ? i;
110 return

Line numbers are not necessary, however, line numbers allow to edit the code in the bwbasics interactive environment.

Sometimes, one might want to compile a program. In comes the FreeBasic compiler. It is important to point out that bwbasic and FreeBasic are not 100% compatible. I order successfully compile code as displayed above, one needs to the a "-lang" option. I found "fbc -lang qb [filename]" to work fine.
Another remark, while SYSTEM and QUIT are equivalents under bwbasic, fbc does understand SYSTEM, but not QUIT.

One interesting comparison is the performance of the interpreter and the compiled code.

Interpreter:
$ time bwbasic count.bas
Bywater BASIC Interpreter/Shell, version 2.20 patch level 2
Copyright (c) 1993, Ted A. Campbell
Copyright (c) 1995-1997, Jon B. Volkoff

 0 1 2 3 4 5 6 7 8 9 10

real 0m0.007s
user 0m0.003s
sys 0m0.004s

Compiled code:
$ time ./count
 0 1 2 3 4 5 6 7 8 9 10

real 0m0.038s
user 0m0.005s
sys 0m0.007s

When using the interpreter, the first 4 lines of the output are not controllable by the user of bwbasic. However, a very simple trick with the stream editor gets rid of the problem. It does not even cost a lot of extra time. This way, the output can be piped to yet another program. Have a look:
$ time bwbasic count.bas | sed 1,4d
 0 1 2 3 4 5 6 7 8 9 10


real 0m0.013s
user 0m0.005s
sys 0m0.018s

You may have noticed, that there is an additional empty line at the of the output. This line can also be suppressed with the stream editor. For doing that, you might want to use the following:
$ bwbasic count.bas | sed '1,4d;$d'
In my view, this is the preferred way of using the basic interpreter in a script envirronment.

There is yet another program I want to push into the mix, Geany. This IDE integrates perfectly with the FreeBasic compiler. Just be sure to add the "-lang qb" to the Build Commands. Click Build -> Set Build Commands. The "Compile" Command would therefore look like this: fbc -lang qb -w all "%f"

Geany also supports "Run" Commands. Making use od the stream editor as above, the command looks like this: bwbasic "%f" | sed '1,4d;$d' Obviously, this run option won't function on interactive programs... just saying.

Finally, one can write a little script, to run basic sources from the command line. Here is an example:
#!/bin/sh
bwbasic $1 | sed '1,4d;$d'
Of course, this can also be defined as a alias or function in you shell environment... One such option could be:
$ function run () { bwbasic $1 | sed '1,4d;$d';}


Dell Wyse 5070 Linux setup

In my previous post. I discussed the use of a Dell Wyse 5060 thing client. There is a better option, which meanwhile made it into my collection, the Dell Wyse 5070. 

The version I got is equipped with a 16GB onboard eMMC device, which is big enough for a small Linux installation. My joice fell on Xubuntu Minimal. With some additional software installed, 48% of the eMMC drive are used, roughly 6.5GB.

To keep things simple, I am using an external 2TB USB3 HDD. This disk is partitioned into a Linux swap and an ext4 partition. The ext4 partition serves as home-drive.

Swapping over USB3 is certainly not ideal. However, with only 4GB RAM, swap is desireable. In order to improve on the swap situation, zram takes care of part of the virtual memory. The total virtual memory is now 4GB (HDD) + 1.8GB (zram).


Monday, November 9, 2020

Raspberry Pi OS on USB

Lately, for various reasons, I got into using Raspberry Pis, in particular in combination with the GPIO.
What puts me off by a bit is the fact that the regular RPis used (micro) SD cards. While reading from an SD card might not be that bad, but writing to it, over and over again, will destroy over a short period of time. Thereby destroying the data you stored on it.

For my projects, therefore, another solution had to be found.

In this series of posts, I will document my experiences using various methods and devices to avoid the wear and tear of an SD card.

This first episode reflects on using BerryBoot to boot from and load the OS from USB connected devices.

Using and installing BerryBoot is very simple. Download the archive provided in the above mention link. Make sure you picked the file that fits your Raspberry Pi. 
During writing this article, it appears that the BerryBoot image now changed to a single archive for all variants of the RPi. I have not tested this, since I just a few hours prior to the writing of this post, downloaded the archive for Pi0 to Pi3+ boards.
Anyway, I stick with what I have and what worked for me earlier.

In my present test, I am using a Raspberry Pi 1 B+ with a 2GB micro-SD card as a boot device and a USB-2 HDD enclosure with a 320GB 3.5" hard-disk. The enclosure came with a 2TB disk, which is used in something else by now.
Further, the enclosure is powered externally by a 12V wall-ward. This, of course, is important, since a Raspberry Pi would never be able to provide the power for any HDD.

Following the procedure as set out on the BerryBoot page, an OS will be written to the USB attached device. I opted for a full install of Raspberry Pi OS, as it is presently called.
After having booted "into" the HDD, the experience is certainly less snappy, compared to running the OS from the SD card. However, the mere difference is storage space should put up some questions: 8GB SD card vs. 320GB HDD.
Initially, no swap space was created. So, I decided for creating a swap-file on the root directory of the hard-drive. That did not work. It appears that under BerryBoot, using a swap file is impossible.

A solution to the missing swap-file is to install zram-tools, which will enable a virtual swap into compressed memory.

In following posts, I will discuss various other options for booting a Raspberry Pi from USB devices.





Saturday, May 16, 2020

FreeDOS - Linux-MINT dual boot

Transferring data from FreeDOS to the cloud is something I need, but not able to achieve over WiFi, mind you, my FreeDOS computer is a netbook.
So, I believe the easiest way would be to install a Linux distribution alongside FreeDOS. The 30GB HDD offers enough space for doing so.
With a Linux on the machine, it will be easy to boot into Linux when data-transfer is needed. Reading and writing from a DOS partition is something that Linux is able to do since a very long time.

I went for Linux MINT Tara i386, just because I had a USB thumb-drive with that particular distribution readily in my drawer.

Concerning the installation, nothing special to report. I decided to use 14GB for Linux and left 16GB for FreeDOS, plenty for both operation systems.

After installation, FreeDOS did not boot from GRUB. It turns out that one needs to boot FreeDOS from a thumb-drive and re-write the system files using the "sys" command.

What FreeDOS is concerned, that's it.

The native screen resolution of netbooks can be a low for your GUI on Linux.
However, resolution scaling works beautifully, should you need more real-estate on the screen.
Here are two tiny scripts I use to toggle scaling:

$ cat nb_scale1
#!/bin/bash
xrandr --output LVDS1 --scale 1x1 --panning 1024x600
 

$ cat nb_scale1_5
#!/bin/bash
xrandr --output LVDS1 --scale 1.5x1.5 --panning 1536x900


Enjoy toying with DOS and Linux on a small netbook.
 

Sunday, May 10, 2020

Running FreeDOS in QEMU

As indicated before, I also have a Debian 8 latop, which is perfectly fine for my daily tasks, and hence, I do not have the desire to discard the Linux running on it, in particular since everything, including WLAN is running perfectly on this hardware.
This latop, a HP/Compaq nx6110, was also able to run the FreeDOS live-CD.

Anyway, I installed FreeDOS on a virtual drive on this particular computer. Again, the hardware, i.e. keyboard, is just perfect for my regular use under Linux.

When installing the FreeDOS image, I encountered some minor problems getting the networking to up and running. Finally, I ended up with a script as follows:

#!/bin/bash
qemu-system-i386 -m 32M -drive file=drivec.img,media=disk,format=raw -net nic,model=pcnet -net user


With this script, I am able to browse the internet using Lynx. I am pretty sure that I will be able to use other network services too.

Friday, March 24, 2017

Printer HP LaserJet Pro MFP M130fw

Sorry for the long silence on this channel. There were so many things on my plate, I had no time sharing any of my latest IT (Linux) adventures.

For my place in TO (Toronto, Ontario), I thought it might be important to finally upgrade my IT with a printer. And talking printer, I envisioned a laser printer, for documents and boarding passes ;-)
There was a sales campaign with HP going on. So, I ended up with buying a relatively recent model, which is able to also scan (copy and fax).

My IT in Toronto is all based on Linux Mint 18.1 MATE. The printer, being a recent model, is not (yet) supported in Linux. However, the model is also a cloud printer. So, while I wait for native support, I linked it up to hpeprint, which allows for printing PDFs by sending emails to hpeprint.com.

Concerning scanning, a similar email based approach can be selected. However, the printer can connect to SMB-shares on Linux Mint.

In order to configure the printer, connect to its web-server using it IP address. I recommend to assign an address in your router's DHCP-server.

Now that we are talking SAMBA (SMB), I might just drop a few word about Linux Mint's caja-share file browser's inability to connect to shares.
This is not a fault of caja-share. It is not a fault of the samba-server in Linux Mint.
The problem lays in the file /etc/samba/smb.conf ... locate this:
# Change this to the workgroup/NT-domain name your Samba server will part of
        workgroup = workgroup
        name resolve order = bcast hostand add the line in boldface.
Don't forget to restart your smbd!
Having done that, not only Linux Mint computers will be able to share directories, also the HP LaserJet MFP M130 will be able to connect to the shares and depose files in said shares.

Taking it back to the printing aspect of the HP device. Installing cloud services was working fine in my environment. While the "All-in-One Remote" and "HP ePrint" apps are working fine on my Android phone, the HP Print Plugin is unable to locate the printer in my network...



Sunday, January 1, 2017

Acer C7 Chromebook on Linux for good

Having played with the device again for a while, I realized that not that much changed concerning the use of Chromebooks. With C7 with its HDD is surely less snappy as the Samsung Chromebook, although graphics performance is a lot better.
I figure, a real chromebook needs to be used in the cloud and not as a standalone device. All in all, 300GB of storage don't seem to make a lot of sense.

New BIOS

The decision to flash the Acer C7's BIOS fell yesterday.
The following 2 pages contain all the information needed to do so:
https://www.coreboot.org/Chromebooks
https://johnlewis.ie/custom-chromebook-firmware/rom-download/

Should you need visualization, Johnny Phung made a comprehensive video. Johnny also got a video for getting Linux on the device.

Thanks to John's work, the process of backing up the original ROM is a lot easier. John hosts a script which takes care of everything, you have to be online to run it though.
Installing coreboot with a SeaBIOS payload was the easiest thing in the world!

Linux

My choice of distribution fell on Linux Mint 18.1 64bit (MATE) https://linuxmint.com/ , since I already made a USB dongle for this distro. Further reasons (actually reasons why I created the dongle in the first place) Linux Mint MATE is relatively lightweight, still very comfortable.

The installation was pretty straight forward. Although here is a slight change a made: using 4GB for swap rather than 2GB as suggested by the installer. A personal choice, nothing spectacular.


After the install there were 2 things not working, not at all: the touchpad and the special function keys.

Most important piece, the touchpad.
Searching here and there, this page popped up: http://marstella.net/?p=278
Some searching in my little minted C7 revealed, the cyapa module seems now part of the chromeos-laptop module.
KI4GDT, the author, indicates the importance of the order in which modules are loaded. It seems, with the chromeos-latop module loaded first, everything goes belly up. To blacklist the module appears a good idea (/etc/modprobe.de/blacklist.conf).
For reasons unknown to me, loading the modules with /etc/modules did not work; yes, I know, it should.
I am a pragmatic guy, so I placed the following lines in /etc/rc.local
modprobe i2c-i801
modprobe i2c-dev
modprobe chromeos-laptop

Now, the touchpad works just fine.

The function keys for audio volume control.
This was certainly a lot easier to fix. Linux Mint offers a configuration tool for keyboard shortcuts.
Menu => Preferences => Keyboard Shortcuts
My choice: MUTE [ctrl]-F8; Volume down [ctrl]-F9; Volume up [ctrl]-F10
In this way, the F-keys are still available for other purposes.

The function keys for screen brightness control.
There might be a more elegant solution using mate-power-control.
My approach: xbacklight.
Here is what needs to be done (in a terminal) to install it:
sudo apt-get install xbacklight
In the keyboard shortcuts application you need to create "Custom Shortcuts" by pressing the add button. I created the following:
Name: Backlight darker - Command: xbacklight -dec 5 - assigned to [ctrl]-F6
Name: Backlight brighter - Command: xbacklight -inc 5 - assigned to [ctrl]-F6
With every hit of the respective shortcut, the brightness of the display varies by 5%.

Conclusion

The performance of the Acer C7 could certainly be improved by the use of an SSD. For my purposes, this won't be required.
My C7 came with 2GB of RAM in a single module. Since RAM is so cheap nowadays, I might just get another 2GB module.

Wednesday, September 25, 2013

Hackintosh, really?

There are pros and cons on running OS-X (even on Apple hardware).
On the pro, we would all agree on the eye-candy OS-X provides us with.
There are some cons however, the one most striking con is the outdated "finder 7" style header bar, which still is present in Mountain Lion today. Why do I have to activate an application first, before I can close it?! This is really not up to modern standards. Yes, one can close a window on its decoration, however this will close the application only in exceptional cases.

There is still this argument about application, especially for artists, available on OS-X only. Honestly, I am not too sure about this at all. The Linux community seems to be catching up in a high pace. Seen the applications available under "AV-Linux", the Mac world locks rather empty and expensive.

Regarding the look and feel, in terms of OS-X pros, today, there is severe competitor to the Apple operating system. The (free) OS is called "elementary OS Luna".
I played for some days with this Ubuntu based system, which in terms of eye candy comes very close to OS-X. Check the review on DistroWatch.

My personal experience with this Linux distribution is very positive in terms of the experience being very close to what my settings on OS-X would be, without the above mentioned depreciated finder-7 retro-experience Mountain Lion still provides today. Actually, I personally prefer the elementary OS Luna experience over the OS-X Mountain Lion experience, in particular since it avoids the clumsy retro experience of the header bar.

In terms of available multi-media applications, linux is catching up fast, cf. AV-Linux. Since elementary OS is based on Ubuntu, which is based on Debian, the Ubuntu and the Debian software repositories are available, providing an extensive range of applications.

In addition to the above, there as an elementary OS community, providing cool tools such as elementary tweaks, which helps to shift the elementary experience even closer to OS-X.