How to read this blog

:: git, rss

By: Maciej Barć

Git

Because contents of this blog are stored in a git repository you can just

1
git clone --verbose --recursive https://gitlab.com/xgqt/blog

then, read the "raw" ORG files in 'posts' directory or make the HTML version executing the 'dev.sh' script (remember that you will need GNU Emacs to render the posts into HTML files).

Then, you can just git pull to read the news whenever you wish, maybe do it with cron or a script that will pull many repos at once, for example with this script.

RSS

Org-Static-Blog creates a RSS Feed file rss.xml, so to subscribe add the link https://xgqt.gitlab.io/blog/rss.xml to your favorite RSS reader.

You can also subscribe to the GitLab repository Atom feed.

EmojiD

:: joke

By: Maciej Barć

Short story long

We were discussing some vulnerabilities on the src~prepare~ group's [matrix] channel and when we're talking about systemd errors. I just felt like opening their GitHub and browsing the code. I was just reading the comments… and I saw a comment about kernel APIs and there a emoji. My feeling is probably best expressed my common "KEK". I chuckled. The "Abstract" in 0.0.1 is the original idea I typed on [matrix]. The funniest part of this "development" for me is probably that Emacs on my system doesn't display properly ANY of the emojis in emojid. I had to go back and forth between the source and log files opened in FF (because it renders the emojis properly), emojipedia and "broken" Emacs.

0.0.1 "😃 ️ 🌍 🍞 🚗 📞 🎉 ♥️ 🏁"

What you do is clone the repository, execute make and run the binary. Read your log and see if your system is "affected" :P.

👋

And remember emoticons made of the symbols found on the keyboard will always look better ;)

2020 recap

:: new year

By: Maciej Barć

Recap

What I did this year:

  • began studying at WSIiZ
  • drank a lot of alcohol with friends
  • installed NetBSD ;)
  • learned Nginx and Ansible
  • recruited new people to the src_prepare group
  • struck a nerve with some commies
  • took maintainership of gallery-dl and PPSSPP
  • tweaked my configs
  • went back to KDE and Firefox (missed them)
  • worked with Zigbee (probably not doing that again)

Wishes

What do you wish in new year?

I wish you all merry Christmas and happy new year. Less bugs, more resolved issues, no wontfixes, better compatibility. Faster compilation, less failures. And of course no lawsuits, no copyright infringements and better government.

Portage system replication

:: gentoo, portage, sysadmin, system

By: Maciej Barć

Intro

Backing up using this method takes a lot less space - ~60MB (without distfiles) and can be restored on almost any system (running portage) and tweaked afterwards for, say, CPU architecture. I've created a a short script with similar method in here.

What we need

  • ebuild repositories are installed with git
  • distfiles (those might be gone when we want to replicate)

Backup

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# System info
emerge --info > info.txt

# Portage tree
cp -Lr /etc/portage .

# Portage layout
tree -a -L 2 /etc/portage > layout.txt

# Packages in @world
cp /var/lib/portage/world .

# Installed sets
cp /var/lib/portage/world_sets .

# Installed packages (with versions)
qlist --installed --nocolor --umap > qlist-use.txt
qlist --installed --nocolor --verbose > qlist-ver.txt

# Distfiles
cp -rv "$(portageq envvar DISTDIR)" distfiles

# Ebuild database
cp -r /var/db/pkg pkgdb

Restoration

To faithfully restore the system perform those actions as root

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Copy the portage tree to /etc
rm -dr /etc/portage
cp -r portage /etc/portage

# Checkout the gentoo repo to a commit specified in info.txt
cd "$(portageq get_repo_path / gentoo)"
git checkout # <commit ID>

# Copy distfiles
cp -r distfiles/* "$(portageq envvar DISTDIR)"/

# Fake-install @world and sets
cp world /var/lib/portage/world
cp world_sets /var/lib/portage/world_sets

# Emerge the exact packages from qlist-ver.txt
emerge --keep-going=y -1Oav $(sed 's/^/=/' qlist-ver.txt)

Old Access Point

:: hardware, router, access point

By: Maciej Barć

Introduction

On some old routers, namely TP-Link's TL-WR840N version 2, there may not be a option to switch to access point mode. This is what you have to do to access that mode indirectly.

Steps

  • Power off the router
  • Unplug RJ cable from the WAN port
  • Connect the router to a PC (using one of the LAN ports)
  • Power on the router
  • Log it to the web console entering your router's IP, you can find out the IP by executing ip --color a (on a Linux box) if the router's DHCP server is still active
  • In LAN settings give your router a static client IP that fits into a network you want to connect it to; example: 192.168.100.100/24 (make sure no other hosts are associated with that IP in the target network)
  • Restart the router
  • Log in to the web console entering the IP you have set
  • Turn off the DHCP server (DHCP -> DHCP Settings -> DHCP Server: Disable & Save)
  • Power off the router
  • Plug the cable from a network you want the router connected to to one of the LAN ports
  • Power on the router
  • Log in to the web console entering the IP you have set
  • Turn on the wireless network and set it up (SSID, password, etc.)
  • Done! :D

Sources