Posts Categorized: Problems

Ubuntu 16.04 with Ryzen 7 and GA-AB350 Gaming Rev. 1

At time of writing, the stock motherboard BIOS and the kernel that ships with Ubuntu 16.04 LTS do not seem to work well with a Ryzen 7 1700 and GA-AB350 Gaming (Revision 1.0) getting stuck during boot.  I was only able to boot after turning ACPI off, which limited me to a single thread.

However, Fedora’s live CD worked fine for me on this machine. What I ultimately did was clone Fedora’s kernel repo and build F25’s kernel. (At time of writing, that’s at 4.10.4) Booting with this kernel has allowed me to boot without turning ACPI off.  Apparently, one of Fedora’s patches fixes the issue I was having with my new hardware configuration.

The process is as follows:

Prerequisites: You need to have the packages installed that would allow you to build the kernel before doing this. I think all that’s needed is sudo apt-get install build-essential gcc g++ butI’m not 100% sure as I ended up installing a lot of packages while trying to get this to work. Check the Ubuntu docs on how to custom build a kernel.

(Note for the following, at this point I had switched to root, if you stay as a regular user, use sudo as appropriate.)

Now that that’s out of the way:

  1. Clone the the Fedora kernel repo with git.
    git clone git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/fedora.git
  2. Then checkout branch 25, nevermind the warnings about a detached HEAD, we’re not adding anything to our kernel build so we’re not doing any commits.
    cd fedora && git checkout origin/f25
  3. Copy the non-hidden files to /usr/src/linux-4.10.4. Create the directory if it doesn’t yet exist.
    mkdir /usr/src/linux-4.10.4 && cp -rv * /usr/src/linux-4.10.4
  4. Change directory and configure the kernel build. I used the Fedora 4.8.6 config as my base.
    cd /usr/src/linux-4.10.4
    wget -O .config https://s3.amazonaws.com/rrbits/config-4.8.6-300.fc25.x86_64
    make oldconfig

    When configuring, just selecting all the defaults worked fine for me.

  5. Build your kernel
    make
  6. Build your modules
    make modules
  7. Install your modules. Since we used oldconfig to configure it, these will have a lot of debugging symbols, so let’s strip them while we install them.
    make INSTALL_MOD_STRIP=1 modules_install
  8. Finally, we install our kernel.
    make install

Watch the final output on make install. When building on Ubuntu, it should automatically copy everything to boot, build your initrd, and run update-grub.  If it doesn’t you may have to do these steps manually, otherwise, check and make sure it grub saw your new kernel and initrd.  If it did, you should be good to go.  Make sure you use the kernel you built when you boot.

“Fun” with Mobile Website Backgrounds

I’m building a responsive WordPress site, based on the work already done by the team on Twenty Thirteen, for work. I ran into a bit of an issue though when my masthead image worked fine on desktop browsers, but was broken in mobile browsers. It was like the image was too large or too small for the div I was positioning it in on some devices.

Well, turns out it was caused by a difference in size between physical pixels and CSS pixels on the device. My header and divs all had positions and sizes defined in CSS pixels and were sitting atop this background image. However the image was being sized based on physical pixels. With the mismatch that occurred, the elements no longer lined up properly. The solution was simple enough however: just add a background-size declaration that set the background image’s size in CSS pixels explicitly.

Anchor links in TCPDF

A question was posed on StackOverflow regarding html anchor links like ‘#test’, and how you might go about preserving them.  However, it got deleted before I could post my answer.  This is current as of today, May 22, 2013.

If you are using a version of TCPDF less than 5.9.193, links that start with `#` need to be changed to reference a page number and, optionally, Y position.  For example, `#3,4.5` to jump to page 3 at position 4.5.

As of 5.9.193, you can link to named destinations with html links this way.  However, for this to work, you need to add the named destination yourself with the `setDestination` method. [1] So with the example of `#test` you’ll need to have created a named destination called `test` with `setDestination`.

For an example of how this might be used, see the feature request that got it added: Feature request #265 HTML href link to destination or bookmark

[1.] As far as I’ve experienced, these do not seem to work in Firefox’s current PDF.js reader however.

TCPDF Does not Support Indic scripts

The other day I ran across an interesting question on Stack Overflow regarding the use of indic fonts with TCPDF.  Languages like Tamil and Malayalam fall into this category. [How can I create Malayalam PDF using TCPDF in PHP?] At first I thought it was just a simple font issue, but that was not the case.  Even with font subsetting off, and trying a number of different Malayalam capable fonts, I was having the same problem the question asker was facing. I began googling for information regarding Malayalam and TCPDF, but to no avail.  I found out that Tamil was a related script, so I did searches on that and the outlook was not good regarding proper rendering in TCPDF.

Finally after switching my google queries to specifically search for information about indic script support in TCPDF, I found this comment by a person called “Santhosh” regarding TCPDF’s lack of indic script support:

It is technical limitation. For TCPDF, the true type font need to be converted to afm format first, then for each script, the diacritics or ligature rules are implemented in tcpdf itself. That is what done for adding Arabic/Persian support. For complex scripts this is not a correct approach. Indic shaping engines like Pango has evolved by taking about 10 years. The shaping logic is very complex and duplicating it inside a PDF library is wrong approach. Instead the PDF library should depend on Pango or the upcoming Harfbuzz rendering engines. The PDF export library in Mediawiki uses reportlab pdf library. That also attempts to the rendering by itself. And ended up in having no support for any Indic languages and many bugs for Arabic scripts(Note that this extension is disabled in many Indian wikiprojects). Fonts are not enough for rendering, a shaping engine is also required for complex script to interpret the glyph formation rules. This is what PyPDFLib is trying to solve by using Pango for script rendering and Cairo for graphics.

I’m happy to have come across his posts as I might’ve banged my head against a wall trying to answer this Stack Overflow question for a while.  I don’t know anything about these languages so I don’t think I could have answered the question as quickly or as thoroughly as I did if it weren’t for finding this.

You can read the full blog post and comment thread here: Creating a new Language ecosystem- Sourashtra as example

Laziness

  1. If a task can be automated and done better by a robot. It should. Humans should not perform such tasks.
  2. If making the robot is harder than the task, only make the robot if saved energy over time is greater than doing the task.
  3. If the task is useless, pursue it only if it enables happiness.
  4. Useless tasks that do not promote happiness are scourge and should be eliminated forthright.

Beating FFXIII was clearly category 4.

Solved: GIMP Script-Fu Console Image ID

Problem: In experimenting with GIMP’s Script-Fu console, I could not figure out what values to feed in to scriptfu-rounded-corners (you know, to see what would happen) for image and drawable.  It was surprisingly simple though.

Continue reading