geekdarling.ch - Matching algorithm

July 22nd, 2014
by leviathan

Hey folks
Since the GPLed dating platform code out there is crappy PHP work and not suited to help geeks meet each other either, I started designing a new matching algorithm in course of the rewrite of geekdarling.ch as a Ruby application.
Basically the idea is quite easy. First I travel the bipartite tree and cut it into subtrees matching the basic requirement of matching sexual orientation and this way saving CPU power by checking for bidirectional preferences.

Second step: I will then value additional attributes based on a two way connection and average the weight of every forth and back arrow.
matching2

For the example on the upper graphics that would mean: R=(((6+1)/2)+((3+4)/2)+0)/3=2.3
Illuminated! ;-)

I'm not quiet done yet, but that's where I'm going :-)
Please gimme feedback.

Posted in Tech | Comments (0)

Linux support for z2760

May 2nd, 2014
by leviathan

The following branch contains my attempts to develop support for the intel atom z2760 clovertrail platform.
Help appreciated.
http://git.o2s.ch/?p=linux-stable.git;a=shortlog;h=refs/heads/v3.15-z2760

Posted in Daily life, Tech | Comments (0)

int reactOnShitSituation(struct situation s)

April 4th, 2014
by leviathan
int reactOnShitSituation(struct situation s) {
    while(!s.eof) {// end of fuck
        open(s.beer);
        drink(s.beer);
        smoke(s.cigaret);
    }
    return BARF;
}

Posted in Daily life, Jokes | Comments (0)

sending HTML emails with inline images attached

February 20th, 2014
by leviathan
#! /usr/bin/python
# -*- coding: utf-8 -*-
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.header import Header
 
def sendEmail(you,greatingLine):
        # me == my email address
        # you == recipient's email address
        me = "VFSN Praesident <praesident @vfsn.ch>"
 
        # Create message container - the correct MIME type is multipart/alternative.
        #msg = MIMEMultipart('alternative')
        msg = MIMEMultipart('related')
        msg['Subject'] = Header("Verein Flugschneise Süd - NEIN","utf-8")
        msg['From'] = me
        msg['To'] = you
 
        # Create the body of the message (a plain-text and an HTML version).
        f = open('Mail_4.html', 'r')
        mail_content = f.read()
        f.close()
        mail_content = mail_content.replace('%Anrede%',greatingLine)
        mail_content = mail_content.replace('vfsn.gif','cid:vfsn.gif')
        html = mail_content
 
        # Record the MIME types of both parts - text/plain and text/html.                                                                                                                       
        part2 = MIMEText(html, 'html')                                                                                                                                                          
 
        part3_data = open('vfsn.gif', 'rb').read()                                                                                                                                              
        part3 = MIMEImage(part3_data, 'gif')                                                                                                                                                    
        part3.add_header('Content-ID', '<vfsn .gif>')                                                                                                                                            
        part3.add_header('Content-Disposition', 'attachment', filename='vfsn.gif')
        part3.add_header('Content-Disposition', 'inline', filename='vfsn.gif')
 
        part4_data = open('Bauverbot im Sueden_2_LQ.pdf', 'rb').read()
        part4 = MIMEImage(part4_data, 'pdf')
        part4.add_header('Content-Disposition', 'attachment', filename='Bauverbot im Sueden_2_LQ.pdf')
        part4.add_header('Content-Disposition', 'inline', filename='Bauverbot im Sueden_2_LQ.pdf')
 
        # Attach parts into message container.
        # According to RFC 2046, the last part of a multipart message, in this case
        # the HTML message, is best and preferred.
        msg.attach(part2)
        msg.attach(part3)
        msg.attach(part4)
 
        # Send the message via local SMTP server.
        s = smtplib.SMTP('localhost')
        # sendmail function takes 3 arguments: sender's address, recipient's address
        # and message to send - here it is sent as one string.
        s.sendmail(me, you, msg.as_string())
        s.quit()
 
csv = open('Adressen_4.csv','r').read()
for line in csv.split('\n')[1:]:
        lineArray=line.split(',')
        try:
                ret=lineArray[7]+" "+lineArray[4]+" "+lineArray[5]
                ret=ret.strip()
                if ret=="":
                        ret=False
        except:
                ret=False
 
        Anrede=ret
 
        try:
                ret=lineArray[12]
                ret=ret.strip()
                if ret=="":
                        ret=False
        except:
                ret=False
 
        Mail = ret
 
        if Mail and Anrede:
                print 'Sending to '+Mail+' with rcp message '+Anrede
                try:
                        sendEmail(Mail,Anrede)
                except:
                        continue
</vfsn></praesident>

Posted in Daily life, Tech | Comments (0)

openerp on CentOS-6 (with RPM)

February 8th, 2014
by leviathan

Howdy
First fit the package depencies like described here: http://gurn3ys.tuxfamily.org/?p=65
Somehow the installation prefix of the RPMs from the daily build service(http://nightly.openerp.com/7.0/nightly/rpm/) points to /usr/local which is... unhandy
The solution is to overwrite some rpm macros which check for unpacked files...
echo "%__os_install_post %{nil}" >> ~/.rpmmacros
And then installing and rebuilding the srpm with rpmbuild -ba

Posted in Daily life, Tech | Comments (0)

networkboot, u-boot, tftp

February 3rd, 2014
by leviathan

Hi
I'm using the following boot script in order to boot uImage and device tree blob directly from my PC.
No SD card removal, no flashing.
It boots out of RAM immediately
Edit ips and ethernet address accordingly to your network and hardware configuration.
Enjoy

setenv initrd_high 0xffffffff                                                      
setenv fdt_high 0xffffffff
setenv bootargs "root=/dev/mmcblk0p1  rootdelay=10 rw console=ttyS0,115200 panic=10 clk_ignore_unused"
setenv ethaddr D2:91:80:B7:AB:5C
setenv serverip 192.168.1.147
setenv ipaddr 192.168.1.145
ext4load mmc 0 0x43000000 boot/script.bin
tftp 0x49000000 sun7i-a20-cubieboard2.dtb
tftp 0x46000000 uImage
bootm 0x46000000 - 0x49000000

Posted in Daily life, Tech | Comments (0)

KDE Active on Odys Xelio

January 19th, 2014
by leviathan

 

Hi folks
I've now managed to get plasma-active up and running on the 50$ Allwinner A10 tablet from Aldi...
But it's not fun to use it, since it's already swapping like hell after a short period because of the low memory...
See the htop screeny attached...

xelio_htop

Posted in Daily life, Tech | Comments (0)

plasma-active on A10

January 15th, 2014
by leviathan

image

Posted in Daily life | Comments (0)

linux-next on INet-97F Rev 02

January 12th, 2014
by leviathan

As you might recall from my last post, I was trying to get linux-next running on the INet-97F Rev 02 as it can be found within the Odys Xelio and many other low cost consumer tablets made in China.
I now successfully managed to boot the linux-next uImage with a rudimentary DTB on it.
You can find the commit with the DTS added on my git repository: http://git.o2s.ch/?p=linux-next.git;a=commit;h=5495b546b3572f001c84a8c74e7547c5cc88d704
Unfortunately mainline doesn't yet contain the sunxi-kms graphics driver since it yet needs to be finally developed and ported forward by Luc Verhaegen.
As soon as his driver patches hit mainline, as well as the ones from Boris Brezillon (for NAND) I will be able to provide fully functional vanilla kernel builds for MER-Project and openSUSE builds.
So stay tuned! ;-)

Posted in Daily life, Tech | Comments (0)

linx-next on ODYS XELIO (vol.1)

January 11th, 2014
by leviathan

This tablet contains the INet-97F Rev 02 board, which has been supported by fedora arm remix already for a very long time.
Now that I have full access to the hardware it's only a question of time, until I've got together a complete DTS and have it up and running with a vanilla kernel.

image

Posted in Daily life, Tech | Comments (0)