Installing debian on the 96boards poplar board

OK, I’ve received my 96Boards Poplar board. It comes with Android 5 pre-installed, and that’s not what I plan to use. I’d like to use Debian Linux instead to tinker a bit more with it.

The documentation is a bit hairy, and I was unable to directly install the Debian files on it so here are my notes to avoid other poplar beginners waste time.

  • Build Debian from sources as described in the documentation, steps 1..6
  • If you’re using Archlinux, then configure the TFTP server “tftp-hpa” and not “atftp” as this one has a limitation in the BLKSIZE and it simply serves truncated image files! And if you’ve disabled IPv6 on your Archlinux box, then add the -4 option to it’s options in the file /etc/conf.d/tftpd file

    TFTPD_ARGS=”–secure /srv/tftp/ -4″

  • Step 7 now becomes:

    cd ${TOP}/recovery
    sudo rm -rf /srv/tftp/recovery_files
    sudo cp -a recovery_files /srv/tftp
    sudo chown -R root:root /srv/tftp/recovery_files

  • The next steps about flashing the image won’t work. Or at least I was unable to make the board stop to the poplar# prompt as described there. Instead, use the USB stick method, but please use the prebuilt fastboot.bin and not the one you just built.Follow the Building recovery media instructions, only at “step 3: copy fastboot.bin” just copy the one downloaded from here
  • Now insert the stick in one of those 2 stacked USB ports, press the “usb_boot” switch and turn-on the board. Be vigilant to press a key when prompted in the `screen` terminal you’ve already started. If the board was already on, them press the “usb_boot” and while holding it depressed, press the “reset” button and keep the “usb_boot” depressed another second or two. Keep an eye on the screen terminal and press the key to interrupt the boot when prompted.
  • Now follow their instructions to flash Debian via TFTP and… have fun!

Make spamassassin learn spam messages right from mutt

If you’re using mutt and you also have your private e-mail server running spamassassin, then you’ll see some spam messages still getting through the pipeline, with scores just below the default 5.0. So here’s the cure: use sa-learn on the server in order to train spamassasin bayesian filter and help it increase score on real spam.

You already have:

  • offlineimap syncing your remote mailbox with a local folder from where mutt reads the messages.
  • Junk folder in your IMAP mailbox, and server-side SIEVE scripts automatically move spam messages into this folder.

The big picture:

  • Manually move the messages you want classified as spam into the Junk folder; offlineimap will automatically send them to the server upon next sync operation
  • Have a cron-job on the server call the sa-learn utility on the Junk folder

Detailed steps:

file .muttrc
————
macro index ,j “:set confirmappend=no delete=yes auto_tag=yes\n=Junk\n:set confirmappend=yes delete=ask-yes\n” “Send message to Junk folder”
————

Log-in to the mail server then:

file /root/learn-spam.sh
———–
#!/bin/bash
sa-learn –spam [path to dovecot Maildir]/.Junk/cur
———–

#chmod +x /root/learn-spam.sh
#crontab -e

crontab file
———–
# run each day at 01:00 AM the learn-spam.sh script
0 1 * * * /root/learn-spam.sh
————

Voilà ! Each time you’re on a spam message in mutt, just hit ,j and the next day you’ll get more messages automatically classified as spam in the Junk folder.

Bluetooth headset i3block

Recently I purchased a bluetooth headset as I really missed the ability to listen to my music in good conditions. They work quite well and I pretty happy with this wire-free system.

As an i3 window manager user I wanted an easy way to get it connected or disconnected, as I’m also pairing it with my phone. You might already know i3blocks and it’s ability to extend with custom blocks. These days I put together a bluetooth-headset i3block and I already submitted it to the main repository. Meanwhile, you can still get it from my personal clone. And BTW, if you happen to know a means of connecting/disconnecting bluetooth devices on ArchLinux without root access, please share!

Enjoy!

Only two weeks from Randa, so many changes for me!

Three weeks ago I attended my second Randa Meetings. I found the same gentle Mario, richer now, as he has a little boy. The little boy’s actually a tester for the KDE Edu GCompris suite 😉 I’d like to thank Mario and his family for their support in organizing this event. It’s not that simple to keep happy so many people.

The kind people (I better say hackers) I already knew where joined by new faces, and it’s a pleasure to see our community is a very vivid and active one. They join this sprint from a bunch of different countries and I find it very interesting to discuss with them about their countries and experiences. And finally to see we are all the same.

Attending Randa was on my way from Lyon to Timisoara, Romania, where I started a new job on September 15. And that’s not my home town, neither my family’s. Actually, it’s my first time I live in this town, and I quite enjoy it. However, new job, new apartment, new people – all this let little to time for KSecret Service hacking. But as you can see, I can blog about it, so new commits will follow on the source code 🙂

Hopefully, until next Randa Meetings 2016 we’ll have a stable version everyone will be happy with. Until then, you only have two things to do, please:

  • Stay tuned and be a pre-alpha tester – I’ll blog here when first usable versions will become available
  • Donate to the ongoing fundraiser, to keep these KDE Sprints possible

Oh, last but no least, I may well organize a KDE Sprint here in Timi?oara. Anybody interested?

 

KSecret Service just created its first secrets file

Greetings from Randa!

Take a look at this:
2015-09-08-183923_ksecrets_first_file

Well, this is the first secrets file ever created with KSecret Service, and it happened here, in Randa. For the impatient – just hold your keyboards, the code is not yet ready. The tests are still failing, but items started to appear on disk, encrypted with libgcrypt.

Stay tuned and meanwhile remember, the fund raising campaign for KDE Sprints is still ongoing. Please consider to donate by clicking the banner below to make coding sprint like this one possible.
KDE sprints 2015 fundraiser campaign

Next week I’ll be in Randa

Since Akademy 2015 KSecrets Service development continued. I did lots of code cleanup. The async API now uses QFuture and the secrets file backend, based on libgcrypt, was added. Tests are there to confirm it’s not yet working. 🙂

One week from now I’ll be in Randa. The hacking ambiance will surely help to hopefully get a first pre-alpha version of the service. I also look forward to peer reviews and feedback on this new codebase.

This kind of events is made possible by our generous donors. If you’d like to join them and donate, helping the KDE community and me, then just click the image below:
KDE Sprints Fundraiser

Quick tip – sending notifications from the desktop to your phone with kdeconnect-cli

This entry is in the series “script addicts” using I3WM.

Put this in the scripts that are creating notifications:

kdeconnect-cli -d --ping-msg "${notificationMsg}"

That’s it! Now, the notifications will hunt you around if you’re not in front of your workstation.

Goodbye Akademy 2015, See You Randa 2015

OK, Akademy 2015 ended last week. This is my second Akademy, though the first full one.

A Coruña is located on the Atlantic front and on my way there, I encountered rainy spots and the rain was a familiar one for me, after having lived several years in northern France (Paris and Pays de la Loire). But this time I actually found it quite enjoyable, knowing that I left behind a 39°-heated Lyon. So, yes, A Coruña is warmer than what we could encounter in other parts of Spain. I shared my car with Sandro Knauß, who came to Lyon from Germany by train, so the one full-day trip was quite nice, KDE hacking-oriented. But be assured, we were also able to talk lots of other topics.

The venue and the hosting in Rialta were just perfect. The local team did an awesome job when organizing the event. They had it all: welcome party – we arrived at the right moment for the Queimada – sponsored food during the week-end (thanks Blue Systems), essential goodies (they carried the VIM T-shirt), “social event” – that was really a party where I had an excellent time -, the day trip and all the schedules which weren’t difficult to follow. Rialta has free swimming pool and I actually managed to use it.

Akademy is about KDE technology but also about meeting like-minded people. Getting along together is really easy, language barrier took apart, and I actually really enjoyed just sitting there and hacking with others, then having a beer or discussing technical issues or ideas. I already miss these spontaneous late evening hacking moments.

Speaking about KDE technology, we are at a turning moment, with Plasma Mobile becoming available. KDE is now ready to take on the mobiles platforms and that’s pretty cool. I look forward to the moment when I’ll have a Linux smartphone running both KDE software and Android applications (with Shashlik, bien-sur). I’ll do my best to help and I already plan to support KSecrets Service on mobile.

KSecrets Service had it’s own BoF. The updated slides are here. I’m working right now in implementing it and that would bring us to Randa, where I intend to continue even further and hopefully I’ll even have a working version by that time.

Randa is a great location for hacking. In fact, no, not Randa, but the venue in Randa is quite perfect for that 🙂 They have that big room under the roof, upstairs, where I look forward to hack, between some BoF’s or swiss meals. Some people who couldn’t make it to Akademy will go to Randa, so I look forward to meeting them there. Oh, and if you can, please help them getting there by the means of a small donation.

Finally, but not less importantly, I’d like to thank KDE e.V. and the sponsors for organizing these events and for providing travel reimbursement.

Stop using GIT for synchronizing files!

Well, this quick blog post is a sort of a quick rant.

That’s the second time I see someone trying to use GIT for binary files synchronization. That’s true, it’s quite easy to create a local GIT repository, then adding a remote is a piece of cake and “TADA” local commits could be pushed to the remote than from there cloned / pulled into another machine. But! Because there’s a really big “BUT”!

Remember for what GIT was designed. That’s right, source file handling, with history and merging. What are source files? They are text files, yes. That’s not binary. GIT can actually compare successive version and only handle diffs (patches). Have you tried using the patch tool with binary files? That makes you laugh, isn’t it! So why using GIT for file sync won’t you also make you laugh? Should I continue now? 😉 Well, I should continue, because GIT also has history. So you’ll force it to store every binary version you ever had, into it’s little .git directory. Is that what you really want?

If file synchronization is needed, then consider rsync, unison or equivalent tools, pretty please.

I3/mutt/offlineimap with decent mail notifications

Today I’ll show you my last trick to get decent email notifications on my I3 environment, without using anything else than offlineimap and mutt. Ok, there’s something else, a couple of scripts but nothing scary.

Before going further, I’d like to ensure you’re using i3blocks. If not, then please configure it then come back and read on.

Until today I was using the classical offlineimap configuration which polled my IMAP server every several minutes directed from a crontab. However, that method has several drawbacks:
– lack of instant mail delivery
– offlineimap would occasionally get stuck upon wifi issues.

Investigating these problems, I found this: https://blog.mister-muffin.de/archive/2013/06/1/

That script was a very good starting point for what follows. So here is the setup:

  • the script ~/bin/mail-check.sh is launched upon I3 session start
    • it calls mail-idle.py which would either return a timeout or a string containing the name of the offlineimap account name that has mail, and the folder name
    • it handles the timeouts itself so if mail-idle.py or offlineimap gets stuck for some reason, they get killed
    • when new mail is found, it uses notify-send,  then calls offlineimap to retrieve the mail from the specified folder and it updates i3blocks
    • finally, it calls notmuch to get the new mail indexed

Put this script in ~/bin/mail-check.sh.
chmod +x ~/bin/mail-check.sh

Then save this script as ~/bin/mail-idle.py. Modify lines 25..27 to suit your configuration. Beware that you should use the same values as in your ~/.offlineimaprc file, if not the scripts will not correctly invoke offlineimap.
chmod +x ~/bin/mail-idle.py

Get the i3blocks blocklet command from here and save it to ~/.config/i3blocks/mail_status.sh. Then adjust it on line 2 to get it inspect your local mailboxes. Also, adjust line 6 if the directory containing your mails is not ~/Mail.
chmod +x ~/.config/i3blocks/mail_status.sh

Activate the blocklet into ~/.config/i3blocks/config:

[mails]
command= ~/.config/i3blocks/mail_status.sh
interval=once
signal=12

As you may have noticed, the blocklet will be updated by the other parts of the system using this command:
pkill -SIGRTMIN+12 i3blocks

Hang-on, we’re almost done! 😉

Get the tool activated upon I3 session start by adding this to ~/.config/i3/config:
exec --no-startup-id ~/bin/mail-check.sh &

Stop your current mail retrieval scripts and then restart your I3 session. You should now start having notifications upon new mail arrival. That is, when some of the IMAP folders supervised by mail-idle.py get mail, then you should see a dunst (or whatever you use) notification, and the i3blocket should become red, displaying the offlineimap account name containing new mails, with their count.

Last step is getting mutt update the i3blocket upon mail reading. Just add this macro somewhere in your ~/.muttrc:
macro index <F5> "<sync-mailbox>:set wait_key=no\n!pkill -SIGRTMIN+12 i3blocks^M"

Restart mutt and use F5 to sync your maildir and eventually clear the i3blocklet when no unread mail is left.

Posted in i3