Fawzan's OS212 Page
Note that this page assumes that you are using Linux (Ubuntu, Arch, or any distro really) as your main OS. Some of the tips here may be able to help you regardless if you are on Windows or MacOS (in fact, some of the screenshots are taken in Windows for convenience).
If you want to request some tips or find any mistakes in this page, please contact me through Discord (Dekano#6884) or LINE if you happen to know my id.
General tips:
Technical help:
I find this class to be the most enjoyable class after Introduction to Digital System. However, I’ve seen someone who calls this class as a sadistic demon or more evil than Lord Dominator. Here’s how I become good at this class (and Linux in general) to the point I helped the assistants answering your questions on Discord.
One skill you need to develop, which is pretty much requirement for every single class in the CS major, is to learn how to google your problem. I thought this is a skill that everyone takes for granted but I guess spending a lot of times tinkering my jailbroken iPad taught me this skill nine years ago unknowingly. If you get an error or don’t know how to do something, try to search the error code or “how to do X” in google.
For example, I had problem getting my new laptop, Lenovo Yoga Slim 7, to hibernate properly when running under Linux. So, I searched “Lenovo Yoga Slim 7 hibernate Linux” and I found this github thread containing the solution for my problem (frankly, I had to use the older, LTS kernel in order for the provided method to work). If you can’t find the solution anywhere on the internet or if it’s very specific to this class like assignments, don’t be afraid to ask on a forum or your friendly assistants.
Also, if you want to learn how to use a command, run man command
or curl cheat.sh/command
. It gives you useful information on its usage.
The best way to be good at Linux is, well, to switch to Linux as your main OS and learn how to live with it. No, i’m not saying you should install Gentoo right away. However, you should install a Linux distro in your VirtualBox, play around with it, and, after you are ready, install it to your existing computer.
My go-to distro for beginners is Pop OS (non-LTS version) for the following reasons:
See this video on how to install Pop OS or this video on dual booting Windows 10 with Pop OS. It’s very easy and you’ll definitely enjoy it more than Windows or MacOS.
Do you want to use vim? That’s wonderful to hear. Here’s a simple way to learn its unique keybinding:
vimtutor
. That’s itvimtutor is a program, a part of vim itself, that teaches you the basic usage of vim. Play around with vimtutor in the afternoon, use vim consistently, and you’ll get used to vim’s blessed keybindings in just under a week.
Seriously, who designed this arrow keys?
If you get “no implicit conversion of Hash into Integer” error when generating your github page locally (full log), it means you have ruby version 3.0.0. Jekyll, as the writing of this tip, doesn’t support such version. You should install the version 2.7.3.
Steps to fix it in Linux using rbenv
:
rbenv
and ruby-build
(I’m using Arch so I follow what this page says)rbenv init
and do what it saysrbenv install 2.7.3
, wait for it to install, run rbenv global 2.7.3
to change your ruby version globallyGEM_HOME
and GEM_PATH
as the output of ruby -e 'puts Gem.user_dir'
(apostrophe included) or just don’t set them/leave them empty (I’m not really sure about the latter)ruby -v
. You should run the version 2.7.3.gem install github-pages jekyll jekyll-sitemap jekyll-seo-tag
Now go back to your repo and run bundle exec jekyll serve
again.
If you are too lazy to install the Debian VM yourself, you ought to import the provided OVA file. In this case, you should rename the username and the hostname (NOT the name of the guest) to your Github username. Here are the steps:
/etc/hostname
and change the hostname to your github usernameyourname
with your Github username)
usermod -l yourname cbkadal # Rename the original username to your name
groupmod -n yourname cbkadal # Rename its group of the same name to your name
usermod -d /home/yourname -m yourname # Move its homedir to /home/yourname
useradd -m yourname # Add a new user of your name along with its homedir
passwd yourname # Give the new user a password
cp -r /home/cbkadal/* /home/yourname # Copy all content inside the old account into new one
chown -R yourname:yourname /home/yourname # Take ownership for the new user
usermod --shell /bin/bash yourname # Change the shell of the new user to bash
# The following commands are optional
groups cbkadal # See all groups the old account is in
usermod -aG groupname yourname # Add your new account to the group the old one is in
# NOTE: You have to do it for every group one by one
# Only add to any group you want. No need for all
userdel -r cbkadal # Delete the original account
Sometimes, you may forgot to add the second drive for your LFS partition as it is one of the requirement for your Debian VM. Don’t worry, you don’t need to waste another time reinstalling Debian. Use that time for playing Genshin Impact instead (or Banjo-Kazooie if you are me). Here’s how:
(This should be relevant for week 03 where you need to create the third disk. Just change “sdb” to “sdc”, /mnt/lfs
to /yourgithubname
, and mkfs.ext4
to mkfs.ext2
)
Step 2
/mnt/lfs
directory (even if you already created it just in case) with the following:
mkdir -p /mnt/lfs
lsblk
to see its name (usually, its either “sdb” or “vdb”. We’ll use “sdb” in this tutorial. If it shows “vdb” or anything else, replace every “sdb” in any given commands accordingly)mkfs.ext4 /dev/sdb
blkid
to see it. (pro-tip: run the following command to save some time later)
blkid | awk '/dev\/sdb/{print $2}' >> /etc/fstab
Step 7 through 9
/etc/fstab
so that the added drive can be mounted on startup. Just nano or vim into it and follow everything you see in the last line of the following image. Save your edit and reboot. You should have the added drive mounted on startup
If you run the previous command, you should have the target UUID at the last line. Just edit it from there.
If you export your debian VM with EFI enabled and import it as separate guest, it may NOT BOOT even if you change the disk or use an ISO. I honestly have no idea why this happens but this askubuntu page may give some clue.
If you like using EFI, QEMU + Virt-Manager is a better option although this OS class mandates you to use VirtualBox. So, don’t enable EFI in VirtualBox for your time and sanity.
Don't tick the "Enable EFI" option!