Friday, January 27, 2017

Facebook GPG

This news is almost 2 years old now but I just got back onto Facebook a few months ago and found this to be interesting.

Facebook allows you to upload your public key so you have have all of your notifications encrypted.

I haven't fully enable it yet, I've just sent the test email to my account and it worked just fine. I haven't enabled it yet because right now I using Gmail's web interface as my mail "client" as a test (more on that later). And the last time I checked (plus a real quick search right now) doesn't show any sort of GPG integration with Gmail. But I may yet switch after I am done (if I am done) with the Gmail web interface.

Saturday, January 14, 2017

Algorithmic Bias

Two days ago the ACM published a press release on algorithmic bias. Included in there is a PDF listing 7 principles for developers and organizations to consider when developing their algorithms. Computing automates many things and discrimination is unfortunately one of them.

Facebook has had a question come up with their ethnic affinity feature for ads. NOTE: I am not saying Facebook is engaging in discrimination with their ads. I haven't done any further research into this particular story to determine how the ethnic affinity actually works. I am merely posting it as an example of a question that has come up about an algorithm that a prominent company uses. If interested, please do additional research before making any judgments.

I don't know how much impact the ACM's statement will have on the developer community. But I do salute them for at least publishing this out there for awareness.

Friday, January 13, 2017

Sorting Algorithms

I just want to call out a nice site that has a visual representation of various sorting algorithms.

http://www.sorting-algorithms.com

They have eight different sorts offered, with different data sizes, and with data in various starting configurations (random, neatly sorted, reversed, few unique). Having the different input configurations is really nice as it will visually show you the strengths and weaknesses of the various sorts. It also includes a short discussion of the algorithms and lists their properies.

Wednesday, January 11, 2017

Laptop Hibernation

I enabled hibernation on my laptop where I am using LUKS + LVM on Fedora 25.

  1. Edit /etc/default/grub to add resume=swapdevice to GRUB_CMDLINE_LINUX (my device was /dev/fedora/swap since "fedora" is my volume group and "swap" is my logical volume for swap).
  2. sudo dracut -f
While I did install the hibernate status button extension, I was also able to test things out with 'sudo systemctl hibernate'. The laptop went into hibernation and I was able to boot back up picking up where I left off.

And the nice thing, my swap is on the encrypted volume so my save image is therefore encrypted as well.

Tuesday, January 10, 2017

LUKS & SSD

I tried out Fedora on my laptop. The installation went rather smooth. My laptop has a SSD that I used as my primary drive and I installed using it alone, using LUKS and LVM.

Since it is an SSD, I needed to configure things to allow discards so I could run a trim command against it. While I have done this before, I had not on Fedora. So I did some searching and came across a Q&A about the proper way of setting up fstrim on Fedora 23. I did not run into the same problems that person ran into that required extra steps so I wanted to share what worked for me.

I had to do the following:
  1. Change /etc/lvm/lvm.conf to set issue_discards=1
  2. Add 'discard' to the line in /etc/crypttab for my volume as the 4th field
  3. Run 'dracut -f' to create a new initrd
That was all. Upon reboot I was able to run 'fstrim -a -v' to see that all of my filesystems on the SSD were trimmed. I did not have to alter my grub config to make things work; the /etc/crypttab getting copied into the initrd seemed to be the only thing necessary for me.

I did then run the commands (as root) they had to enable the timer and service:

systemctl enable fstrim.timer
systemctl start fstrim.service

With that I had things working just fine. The timer worked as expected.