Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


Trump Book

Posted by takyon on Thursday January 04 2018, @04:05PM (#2906)
13 Comments

Desktop Devuan on ZFS

Posted by DECbot on Wednesday January 03 2018, @04:05AM (#2903)
5 Comments
OS

Over the New Years break I finally decided to change OS on my laptop. A little background, the laptop started on Ubuntu 14.04 (12.04 LTS is my preferred, but no longer possible) and then changed to FreeBSD. Frankly, FreeBSD was exciting, unpolished, and ultimately ditched because because my Minecraft frame rates hovered around 4 fps.
 
Due to my work schedule and home responsibilities, stripping systemd from modern Ubuntu didn't seem like a sustainable option. With the recent release of Devuan 1.0, it seemed like a perfect time to give it a try. Why Devuan? well, you know the old phrase, learn Debian and know the Debian derivatives, learn Red Hat and know the Red Hat derivatives, learn Gentoo and know how to compile everything (still compiling?), learn Slackware and know linux. Well, I learned Debian and am most comfortable with it--Devuan fits the Debian without systemd niche. The one caveat, playing with ZFS when testing FreeBSD was pretty neat, and I'd like to continue using it. Unfortunately, Devuan + ZFS is not available strait out of the box. So, I practiced my googlefu and found a few guides to make it happen. Results? I'm writing from chromium on Devuan with root on ZFS. Wifi works, suspend works, music and video works... pretty much everything works. The best part, my Minecraft framerate now averages around 40 fps.
 
Here's my sources:

http://xenotrope.blogspot.com/2017/08/encrypted-zfs-on-root-for-devuan-zfs.html

https://talk.devuan.org/t/quest-for-the-devuan-laptop/600
 
And the steps executed are below. The bulk of it comes from the first link, but that guide is for a server install, so I had to work out a few things to get the desktop going from the install.

Wipe and partition the destination disk.
# wipefs --force --all /dev/sda

# /sbin/parted --script --align optimal /dev/sda mkpart primary 1MiB 100%

# /sbin/parted --script --align optimal /dev/sda set 1 boot on
(so, I cheated here an used gparted from the Devuan live usb. I made two partions, one 16GB swap partion and the rest for my zpool.)
 

Check the partition table:
# /sbin/parted --script /dev/sda p
 

Get the laptop online, then edit your package sources.

# echo 'deb http://auto.mirror.devuan.org/merged jessie-backports main contrib' > /etc/apt/sources.list.d/backports.list
 
That will add the repository with ZFS, but you also need to add contrib and non-free to get your wifi drivers and such. Fire up your editor and add them to your source list.
# vi /etc/apt/sources.list
edit the line:
    deb http://auto.mirror.devuan.org/merged jessie main
to this:
    deb http://auto.mirror.devuan.org/merged jessie main contrib non-free
 

Update and install cryptsetup (in my case, it was already installed).

# time apt update

# time apt install -y cryptsetup
 

Setup your encryption
# cryptsetup luksFormat -h sha512 /dev/sda1 (in my case, sda1 is swap, and thus I used sda2 here. For the rest of this journal, I will copy my source article and use sda1 everywhere.)
# cryptsetup luksOpen /dev/sda1 cryptroot
 

Time to install and compile the kernel modules. You'll need to first het the kernel headers

# time apt install -y linux-headers-$(uname -r)

# time apt-get install -y -t jessie-backports zfs-dkms
 

zfs is only in the jessie-backports repository, so you have to specify it. Watch for errors here, fix them before continuing.
 

Now with zfs-dkms package installed, add it to the kernel.
# /sbin/modprobe zfs
Again, fix any errors before continuing.
 

Time to setup your zpool and datasets.
# zpool create -f -O mountpoint=none -O compression=lz4 -O atime=off -o ashift=12 zdevuan /dev/mapper/cryptroot
# zfs create -o mountpoint=/ zdevuan/root
# zfs create -o mountpoint=/boot zdevuan/boot
# zfs create -o mountpoint=/home zdevuan/home
# zpool set bootfs=zdevuan/root zdevuan

 

With that done, export the pool, import and mount.
# zpool export -a
# zpool import -R /mnt zdevuan

 

Just keep following the guide. If you're using the desktop live usb, you'll have to install debootstrap
# apt-get install -y debootstrap
# time /usr/sbin/debootstrap jessie /mnt /https://auto.mirror.devuan.org/merged

 
The guide notes that --no-check-gpg flag will fubar the process.
 

Next we copy some things from the live USB to the new system.
# cp -v -p /etc/apt/sources.list.d/backports.list /mnt/etc/apt/sources.list.d
# cp -v -p /etc/locale.gen /mnt/etc

 

Here I departed from the guide as I found that debootstrap doesn't install the rich set of applications that differentiate the desktop environment from a server. The most annoying is the lack of wifi, which makes fixing this a pain. Since I didn't feel inspired to run a 100ft ethernet cable from the basement and installing the wifi firmware after my first reboot, I created a list of installed packages from the desktop live USB that I later fed to apt-get after the system is chrooted.
# dpkg-query -f '${binary:Package}\n' -W > /mnt/root/pkg_list
 

Getting back on track, we edit /mnt/etc/fstab for the new system. Remember to add your swap partition here if you created it.

    /dev/mapper/cryptroot / zfs defaults,noatime 0 0
    zdevuan/boot /boot zfs defaults,noatime 0 0
    zdevuan/home /home zfs defaults,noatime 0 0

 

Edit /mnt/etc/crypttab to add the UUID of the encrypted container. I'm using blkid to get the UUID of the cryptroot LUKS container.
# blkid /dev/sda1
# echo 'cryptroot UUID=UUID_HERE /rootkey.bin luks,keyscript=/bin/cat' > /mnt/etc/crypttab
 

Now create a key--this will take some time. Depending on your system, you'll likely to have time to get drive thru coffee from the neighboring zipcode. The original guide author recommended switching to another terminal screen to continue on while dd plugs away.
# time dd if=/dev/random iflag=fullblock of=/mnt/boot/rootkey.bin bs=512 count=4

 

Set the hostname.
# echo myhostname > /mnt/etc/hostname
# echo '127.0.0.1 myhostname' >> /mnt/etc/hosts

 

I copied the interfaces file from the USB stick, the author did otherwise.
# cp -v -p /etc/network/interfaces /mnt/etc/network/interfaces
 

Mount the system directories.
# cd /
# for i in /dev /dev/pts /proc /sys; do mount -B $i /mnt/$i; done

 

Chroot into the new system. Do some basic setup, and then install zfs into the new system.
# chroot /mnt /bin/bash --login
# passwd
# passwd -u root
# dpkg-reconfigure tzdata
# ln -sf /proc/self/mounts /etc/mtab
# apt update
# apt install -y locales kbd
# time apt install -y cryptsetup linux-image-amd64
# time apt install -y linux-headers-$(uname -r)
# time apt-get install -y -t jessie-backports zfs-dkms zfs-initramfs

 

If you went out for coffee, your LUKS key should be done by now. If so, create the crypto keyfile hook fo rthe initramfs.
# cryptsetup luksAddKey /dev/sda1 /boot/rootkey.bin
# chmod 0 /boot/rootkey.bin
# vi /etc/initramfs-tools/hooks/crypto_keyfile

Add the following lines to the crypto_keyfile:
    #!/bin/sh
    cp -p /boot/rootkey.bin "${DESTDIR}"

 

Set the script as executable.
# chmod +x /etc/initramfs-tools/hooks/crypto_keyfile
 

Symlink the crypto device into /dev. If you ever want to update your kernel, checkout the original author's other howto on adding a udev rule for automating this. Otherwise, you're expected to never, ever update your kernel.
# ln -sf /dev/mapper/cryptroot /dev
 

Since Devuan Jessie doesn't yet have a ZFS-compatible bootloader, borrow one from Devuan testing and then return it. FYI, it's called Ascii.
# cp -v -p /etc/apt/sources.list /etc/apt/sources.list.orig
# echo 'deb http://auto.mirror.devuan.org/merged ascii main' >> /etc/apt/sources.list
# apt update
# time apt install -y grub-pc/ascii
# mv /etc/apt/sources.list.orig /etc/apt/sources.list

 

Edit your grub config file.
# vi /etc/default/grub
 

Make the following changes to the grub file:

    -GRUB_CMDLINE_LINUX_DEFAULT="quiet"
    -GRUB_CMDLINE_LINUX=""
    +GRUB_CMDLINE_LINUX_DEFAULT="boot=zfs"
    +GRUB_CMDLINE_LINUX="cryptdevice=UUID=UUIDHERE:cryptroot"
    +GRUB_ENABLE_CRYPTODISK=y

 

Hopefully you can now build your initramfs and install grub without any errors.
# update-iniramfs -u -k all
# update-grub
# grub-install /dev/sda

 

With that done, it is time to install those packages to make your system run like the desktop live USB.
# time xargs -a <(awk '! /^ *(#|$)/' "/root/pkg_list") -r -- apt-get install
 

Pay attention to what installs and what isn't in the repositories. The first time through I had no wifi drivers. I also didn't add the non-free repository, so it was an easy fix once I figured out what happened. Obviously, there will be some redundancy and some undesired packages. Feel free to edit the pkg_list file to your liking before piping it to apt-get.
 

When this is done, add users, groups, configure sudo, etc. Once you're finished, exit the chroot.
# exit
 

Set the mountpoint /boot and /home to "legacy" so they will mount at boot time.
# zfs set mountpoint=legacy zdevuan/boot
# zfs set mountpoint=legacy zdevuan/home

 

Kill off the processes keeping you from unmounting your zpool. If you skip this, you'll be forced to manually import your zpool from single-user mode.
# killall irqbalance
# umount /mnt/sys
# umount /mnt/proc
# umount /mnt/dev/pts
# umount /mnt/dev
# zfs umount -a
# zpool export -a
# halt -p

 

Liberal use of lsof | grep /mnt/whatever to find the process that is using the mount point. Fire up your PID assassin of choice and kill those processes preventing you from unmounting your zfs datasets.
 

At this point, your machine is off. Remove your live USB media and boot the system. Here's your no compromise system with apt, zfs, and no systemd on your desktop. Next up...figuring out hibernation with encrypted partitions and zfs because suspend drains my old, anemic battery in about 12 hours.

 

Let me know if this guide was any help.

Cheers!

Soylent ASCII

Posted by urza9814 on Tuesday January 02 2018, @11:26PM (#2901)
8 Comments
Code
So I was setting up xscreensaver using phosphor and was looking for a plaintext version of Soylent to feed into it. Couldn't find one though, so I've ended up with the following awk script. Posted here in case anyone else wants to save five minutes point out a way to do this in one line :)

# Print plaintext headlines from SoylentNews.org

curl https://soylentnews.org/index.atom 2>/dev/null | awk '
/entry/{
  if(title != "" && summary != "")
    {
    sub("<summary[^>]*>", "", summary)
    gsub("&lt;", "<", summary)
    gsub("&gt;", ">", summary)
    gsub("</p>", "\n", summary)
    gsub("<[^>]*>", "", summary)
    gsub("’", "'"'"'", summary)
    gsub("—", "--", summary)
    gsub("[“”]", "\"", summary)
    print title
    print department" dept. |  posted by: "author
    print summary
    print "\n"
    }

  title=""
  summary=""
  author=""
  department=""
  summary=""
}
/<title>/ {
  gsub("<.?title>", "", $0)
  title=$0
}
/<summary [^>]*>/ {
  description=1
}
/<\/summary>/ {
  description=0
}
/<name>/ {
  gsub("<.?name>", "", $0)
  author=$0
}
/<slash:department>/ {
  gsub("<.?slash:department>", "", $0)
  department=$0
}
{
  if(description == 1)
    { summary = summary""$0 }
}'

Gretchen Carlson Becomes Chairwoman of the Miss America Org.

Posted by takyon on Tuesday January 02 2018, @06:11PM (#2899)
1 Comment
/dev/random

Gretchen Carlson named chair of Miss America organization

Former Fox News Channel anchor and 1989 Miss America Gretchen Carlson was named chairwoman of the Miss America Organization's board of directors Monday, and three other past pageant winners will join her on the board.

The new leadership comes less than two weeks after leaked emails surfaced showing CEO Sam Haskell and others disparaging the appearance, intellect and sex lives of former Miss Americas. Haskell resigned Dec. 23, along with two other top leaders.

The selection of Carlson marks the first time a former pageant winner has served as the leader of the nearly 100-year-old organization. The organization also announced the appointments of three other past Miss Americas: 2012 winner Laura Kaeppeler Fleiss, 2000 winner Heather French Henry and Kate Shindle, who won in 1998 and now serves as president of the Actors' Equity Association. Their appointments take effect immediately, as does Carlson's.

Previously: Miss America on Life Support

iTunes Store login prompt won't take "No" for an answer

Posted by MichaelDavidCrawford on Saturday December 30 2017, @11:53PM (#2896)
13 Comments
Code

Summary:

Pressing "cancel" when prompted to log in to iTunes Store must be done repeatedly.

Steps to Reproduce:

Change your Apple ID password then use your iPhone for a while. Eventually you will be prompted to log in to iTunes Store.

Tap "Cancel".

The dialog disappears briefly then immediately reappears.

Sometimes tapping "Cancel" a second time causes the dialog to disappear for just a few minutes but it will inevitably reappear, just about always in pairs.

Expected Results:

iTunes Store login prompt will never reappear after I tap cancel just once.

Actual Results:

The login prompt doesn't believe that "No Means No" and perpetually bothers me when I'm trying to use my device.

Version/Build:

iOS version 10.0.1 (14A03)

Configuration:

Model Identifier MNA62LL/A

256 GB Flash

Bernard Kouchner: Ban/Boycott Austria EU Presidency

Posted by takyon on Saturday December 30 2017, @09:06PM (#2895)
9 Comments

Italy Plans to Send Anti-Migrant Military Mission to Niger

Posted by takyon on Thursday December 28 2017, @09:42PM (#2894)
30 Comments

In Search of: Tests of HTML List Elements (<UL>, <OL>, <LI>)

Posted by martyb on Tuesday December 26 2017, @09:42AM (#2890)
5 Comments
Code

UPDATE: TheMightyBuzzard clarified that I did not need all that I was seeking here. Many thanks to those who read/replied. And, it looks like it unearthed a bug in our UTF-8 implementation!

I started down the path of writing tests for one of the bugs that was fixed in the upcoming rehash release. Specifically WRT how SoylentNews handles Ordered List (OL) and Unordered List (UL) elements, and while I was at it, I was going to toss in Definition List (DL) elements, too. I'd have these defined with various attributes all at the top level, and then with nested versions of these. It's a relatively straightforward (though time-consuming) exercise.

A quick stab at getting started on this for UL elements can be found in this comment on our dev server instance.

Then I realized "Am I the very first person who has wanted to do this?" I'd think that any HTML-consuming application would already have gone down this path. FireFox, Opera, Safari, Chrome, etc.

A quick search has failed to produce what I am looking for. It seems that if I were to download the development version of FireFox, that there is a set of automated tests that I might be able to leverage, but that would be a huge hit on my limited bandwidth cap, so I'm holding off on that approach -- I'd like to think that I should be able to just download the test cases themselves.

So, I ask my fellow Soylentils: Where can I find an exhaustive set of tests of UL, OL, LI, (and, ideally, DL, DT, DD) elements?

TV shows you like

Posted by Gaaark on Sunday December 24 2017, @05:41PM (#2888)
17 Comments
Soylent

Just looking for good shows to watch that are a little different and off the scope:

My wife found us a good british comedy called 'Man Down' that turned out to be 'brill', funny as hell.

I've been actually enjoying ST Discovery (although, definitely not canon), Superstore, ...

Anyone have a must watch show i may have missed? I don't care: throw whatever my way.

Welcome to Your Future: An Inspiring Holiday Message

Posted by takyon on Sunday December 24 2017, @01:17AM (#2887)
11 Comments
Career & Education

Mood music for post.

⛄🎅🎄🎁👼

INITIATING...

Out of boredom, I did a Google News search for "arcology". This was the lone result:

Paolo Soleri accused of sexual abuse by daughter

No serious arcologies have been built despite decades of research/advocacy. Various projects have been proposed but not realized:

Crystal Island
Shimizu Mega-City Pyramid
Dubai City Tower
Sky City 1000
X-Seed 4000

But the dead stiff Paolo Soleri is now just another #MeToo rapist. Is disinterment on the table?

In the future, there will be no arcologies. Soleri's ideas have been celebrated and studied, and others have proposed arcologies, but there will always be pesky obstacles like a global financial crisis, lack of lengthy carbon nanotubes, or the threat of terrorism. If you put one million people in a single building, the incentive to find the one or handful of weak spots becomes that much greater. Because more kills = higher score. Instead of arcologies, expect more apps and socially-conscious VR.

If we don't see nukes flying in every direction, we'll get to experience new and exciting wars soon. Perhaps right here on American soil. They'll be fought with bioweapons, maybe some directed energy weapons, and Hackaday-chique explosives powered by 3D printing and Raspberry Pis. American ingenuity is not dead: it has to kill America first.

A select few elites may be able to escape the carnage. The Musky One will soon have four spaceports from which to launch his escape vehicle to Mars. Why else would he plan for 2024 when everyone else is talking about 2035? He saw the writing on the wall and wants to print his "Get Out of Judgment Day Free" card ASAP. Assuming Muskman survives the journey, he will live in a cave on the side of a cliff as the free market's chosen God-Emperor of the Red Planet. The ratio of women to men will be around 10 to 1, if not 50 to 1. You can guess what comes next. Homo sapiens sapiens erectus muskii.

So as you celebrate Christmas, Kwanzaa, or New Year's this season, take a look at the people around you. Look for the pressure points, the joints, and any visible signs of weakness that could be exploited. Do so reflexively. Make a higher level of paranoia your new normal. Become more ascerbically cynical and distrustful than you already were as a SoylentNews reader. Get ready for mankind's final adventure, a global battle royale with no winners.