Chromium build failed on Gentoo – fixed

This is where it started
localhost ~ # grep "error:" /var/tmp/portage/www-client/chromium-74.0.3729.169/temp/build.log
[3419/16611] python ../../mojo/public/tools/bindings/ --output gen/services/viz/privileged/interfaces/gl/gl__type_mappings --dependency gen/gpu/ipc/common/interfaces__type_mappings --dependency gen/media/mojo/interfaces/interfaces__type_mappings --dependency gen/ui/gfx/geometry/mojo/mojo__type_mappings --dependency gen/ui/gfx/mojo/mojo__type_mappings --dependency gen/url/mojom/url_mojom_gurl__type_mappings --start-typemap public_headers=//gpu/command_buffer/common/constants.h traits_headers=//services/viz/privileged/cpp/context_lost_reason_traits.h type_mappings=viz.mojom.ContextLostReason=gpu::error::ContextLostReason
x86_64-pc-linux-gnu-g++: fatal error: Killed signal terminated program cc1plus
localhost ~ #
localhost ~ # dmesg |grep cc1plus
[20473.830849] [ 28321] 250 28321 564527 228755 4042752 258622 0 cc1plus
[20473.830857] [ 28357] 250 28357 409737 144997 2793472 184788 0 cc1plus
[20473.830866] [ 28372] 250 28372 379021 235063 2592768 69175 0 cc1plus
[20473.830874] [ 28375] 250 28375 405111 298734 2744320 26004 0 cc1plus
[20473.830884] Out of memory: Kill process 28321 (cc1plus) score 237 or sacrifice child
[20473.830888] Killed process 28321 (cc1plus) total-vm:2258108kB, anon-rss:915020kB, file-rss:0kB, shmem-rss:0kB
[20473.960229] oom_reaper: reaped process 28321 (cc1plus), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
[39359.986750] cc1plus invoked oom-killer: gfp_mask=0x6200ca(GFP_HIGHUSER_MOVABLE), nodemask=(null), order=0, oom_score_adj=0
[39359.986750] cc1plus cpuset=/ mems_allowed=0
[39359.986750] CPU: 1 PID: 13930 Comm: cc1plus Tainted: G OE 4.19.44-gentoo #1
[39359.986751] [ 13918] 250 13918 527207 216835 3739648 232411 0 cc1plus
[39359.986751] [ 13930] 250 13930 449644 182289 3117056 187980 0 cc1plus
[39359.986751] [ 13939] 250 13939 383355 270389 2637824 40695 0 cc1plus
[39359.986751] [ 13942] 250 13942 397893 279494 2682880 35731 0 cc1plus
[39359.986751] Out of memory: Kill process 13918 (cc1plus) score 218 or sacrifice child
[39359.986751] Killed process 13918 (cc1plus) total-vm:2108828kB, anon-rss:867336kB, file-rss:4kB, shmem-rss:0kB
[39360.059949] oom_reaper: reaped process 13918 (cc1plus), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
localhost ~ #
Source compiled.
Test phase [not enabled]: www-client/chromium-74.0.3729.169
Install chromium-74.0.3729.169 into /var/tmp/portage/www-client/chromium-74.0.3729.169/image category www-client
Completed installing chromium-74.0.3729.169 into /var/tmp/portage/www-client/chromium-74.0.3729.169/image
Final size of build directory: 6666072 KiB ( 6.3 GiB)
Final size of installed tree: 456428 KiB (445.7 MiB)

Mac OS High Sierra on VirtualBox on Linux/Ubuntu 16.04/Xenial

    1. Need a way to download the install cd from Apple’s store
      I got an xcloud for a month – could have used macincloud
    2. download High Sierra from the app store on the mac
    3. Create virtualbox image
      I Had to go for generic Mac OSX 64 bit, not the specific High Sierra one !!
VBoxManage modifyvm Sierra  --cpuidset 00000001 000306a9 00020800 80000201 178bfbff
VBoxManage setextradata "Sierra" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "Sierra" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "Sierra" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "Sierra" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "Sierra" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
VBoxManage setextradata "Sierra" "VBoxInternal2/EfiGraphicsResolution" "1920x1080"
  1. Configure
  2. change resolution
    Method 1: VBoxManage setextradata “Type Your VM Name Here” VBoxInternal2/EfiGraphicsResolution HxV  (Recommended)
    Method 2: VBoxManage setextradata “Type Your VM Name Here” VBoxInternal2/EfiHorizontalResolution H  (Alternative)
    	  VBoxManage setextradata “Type Your VM Name Here” VBoxInternal2/EfiVerticalResolution V
    Resolutions to choose:
      1280x720 | 1920x1080 | 2560x1440 | 2048x1080 | 3840x2160 | 5120x2880 | 1280x800 | 1280x1024 |1600x900 | 1440x900
         HD 	FHD	    QHD          2K	     4K	         5K


Perl still does my hostnames resolving

Again, I had a large list of hostnames which I needed resolved to their ip addresses.

  • nslookup: slow
  • ping -c 1: slow
  • getent hosts: “random” ipv6 addresses
  • no fping available

So I still use perl for gethostbyname() or getaddrinfo():

Example below takes input from stdin/pipe.

perl -MSocket -nwle'my @addresses = gethostbyname($_); my @ips = map { inet_ntoa($_) } @addresses[4 .. $#addresses]; print "@ips"'

nginx change http request header value based on source address

Let’s say you want to change the value of a header value based on the source location, ie localhost vs external.  Or you can drop it all together. This is how it’s done in nginx.

We’re setting a variable first using map in the http{} block and then use it later in the location{} section.

  • Add this to the http{} section:   if loopback, it will set the $customkey variable to the original header value of ‘custom-key’, else it will default to empty
map $remote_addr $customkey { $http_custom_key ;
     default "";
  • Add this to the location{} section where you want the use this for your proxy_pass:  (re)set the header to the previously set variable or remove it.
proxy_set_header custom-key  $customkey;


boot-repair to the rescue

Installing ubuntu from the live-cd these days is too easy, really: insert usb stick, boot, install. Done.

The ability to try before installing is just the icing on the cake.  You check if all your hardware is supported (especially network, display, mouse/keyboard) and go…

If you installed it next to the preinstalled Windows and the latest update destroyed your GRUB bootloader config (or any other), use the same live-cd/usb stick to recover.

just run these lines in a terminal and let the repairing begin:

sudo add-apt-repository ppa:yannubuntu/boot-repair 
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

ansible meets xymon

Ansible can do many things many times.

As a huge fan of lightweight software, it’s hard to ignore ansible for automation tasks.  If you want to centralize xymon client management another step further, why not go agentless and have ansible manage that for you? Another benefit is that you also encrypt the data at the same time sending it over the network.  The xymon client can be configured to do that too, but keeping it simple is easier with ansible.

I’ll post some sample playbooks on the git repo.

Also working on an ansible xymon module.

revamping xymon continued..

For starters, the menu is built from the xymonmenu.cfg template in the server’s etc folder.

Then, the header and footer files are in the server’s web folder: stdnormal_header and stdnormal_footer.  There’s lots of others as well, and they have a lot in common, so you could optimize the pagegen code a little (but don’t, better to redo the whole presentation thing all together then, which I may end up doing later..)

Finally, the body is generated by the xymongen pagegen code.  And even though to me and most text based OS users/admins that’s ok, for the graphical OS community, it’s crap. Period.

So, that’s how I ended up going the rest api route.

Nothing fancy, but a little less painful to the eye (fonts also changed in the meantime):

revamping xymon’s pages with bootstrap

So, if you still want to work on xymon’s pages themes, it’s not that difficult.  I mean, it is design-wise, but technically it’s not.

There are different kinds of pages (status, log, info, history, …) but they all have a common menu and each page consists of a header, a footer, the common menu and a generated body with the status, data, report, history, etc..

I first started adding the bootstrap 4, jquery and a few other javascript files in the footer, an extra css file and a few modifications on the colors to make it a more flat look ‘n’ feel.

Some things are hardcoded, but this is open source, so you can change the body generation too, if you want.

more on that later …