Tuesday, July 31, 2012

Converting sylpheed filters to claws

Download from the claws tools area filter_conv_new.pl

http://www.claws-mail.org/tools.php

Install libxml-simpleobject-per

sudo apt-get install libxml-simpleobject-perl

then unzip it and run it


perl filter_conv_new.pl
Converted 12 filters


Now the filters should apear in the sylpheed Filtering configuration area


Perl is great :)

Thursday, July 26, 2012

Enabling spamassassin in claws email

I was using sylpheed  so i have decided to enable local scanning for this i needed to upgrade the email client to claws mail (it does have the sa scanning plugin)

so first remove the sylpheed , then install claws email
sudo apt-get install claws-mail
then install the sa plugin

claws-mail-spamassassin


next step is to enable the spamd daemon

in /etc/default/spamassassin

enable
ENABLED=1


sudo /etc/init.d/spamassassin restart

Next load the plugin in the email client


and then configure it to use the local daemon

You can see it at work by marking sad figure over the emails with spam
I have created a filter to move them to Trash folder


Monday, July 16, 2012

Why amazon ec2 is better than heroku : it's the price

Compared with a ronin database instance = 200$

For 57.6$ per month if we calculate month=30 days on ec2 i can get a small ubuntu linux instance with 1.7G of ram with a lot more than 10.000 rows

http://aws.amazon.com/ec2/instance-types/

After that installing a firebird database can be easy if i choose a ubuntu instance

Next you can add nginx/django just for fun

For backup there are many python scripts to backup to s3/ebs snapshots

Friday, July 13, 2012

forum.ubuntu.ro is one of the most popular support forums in Romania



  • forum.ubuntu.ro is one of the most popular support forums in Romania with 23576 users and 129521 posts. (6369 users and 65895 posts in mid 2010).
  • huge spikes in traffic on www.ubuntu.ro every 6 months when a new Ubuntu version is released. More than 5800 hits when 12.04 launched.
http://i.imgur.com/ejK1i.png 

Romanian Team roadmap 
  • Continue improving Ubuntu translations and documentation, together with offering support via forum.ubuntu.ro
  • Take part in all major Romanian FLOSS event - next one will be FLOSS Camp 2012 (http://camp.softwareliber.ro/2012/)
  • Contribute with local organizations promoting free software and technologies in education.

More info on the ReAproval page



http://i.imgur.com/0VKK9.png

Thursday, July 05, 2012

FLOSSCamp Romania - Jul 26 - 29 / Brasov, Romania

 Help spread the word, and if you can, and you are there, is worth to participate, you will have a good time and meet great people.


Google plus events page 


And the site with the info about travelling 
http://camp.softwareliber.ro/2012/


Saturday, June 23, 2012

Linux-0.01 kernel building on ubuntu hardy

linux-0.01-rm-3.5 now builds ok on hardy but only on 32 bit version
The best way to try is to install hardy , or debian lenny in kvm-linux or virtualbox and then try the instructions bellow 

Official 0.0.1 project news and downloads are located here

You might need some packages first
$sudo apt-get install bin86 kvm qemu gcc build-essential


$wget http://ftp.be.debian.org/pub/linux/kernel/people/abdel/linux_0.01/sources/linux-0.01-rm-3.5.tar.gz

$tar -zxvf linux-0.01-rm-3.5.tar.gz
$cd linux-0.01-rm-3.5
$make

or time make

make[1]: Leaving directory `/home/mariuz/linux-0.01-rm-3.5/lib'
ld -s -x -M -Ttext 0 -e startup_32 boot/head.o init/main.o \
kernel/kernel.o mm/mm.o fs/fs.o \
lib/lib.a \
-o tools/system > System.map
(echo -n "SYSSIZE = (";stat -c%s tools/system \
| tr '\012' ' '; echo "+ 15 ) / 16") > tmp.s
cat boot/boot.s >> tmp.s
as86 -0 -o boot/boot.o tmp.s
00286 /*
00287 * This procedure turns off the floppy drive motor, so
00288 * that we enter the kernel in a known state, and
00289 * don't have to worry about it later.
00290 */
00286 /*
00287 * This procedure turns off the floppy drive motor, so
00288 * that we enter the kernel in a known state, and
00289 * don't have to worry about it later.
00290 */
rm -f tmp.s
ld86 -0 -s -o boot/boot boot/boot.o
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -fno-stack-protector \
-o tools/build tools/build.c
#chmem +65000 tools/build
objcopy -O binary -R .note -R .comment tools/system tools/system.bin
tools/build boot/boot tools/system.bin > Image
Boot sector 452 bytes.
System 89732 bytes.

real 0m4.512s
user 0m3.696s
sys 0m0.768s

then rename Image to linux0.01-3.5.img
qemu -hdb hd_oldlinux.img -fda linux0.01-3.5.img -boot a

you must use the hd image from here if you don't have it yet
wget http://draconux.free.fr/download/os-dev/linux0.01/Image/hd_oldlinux.img.zip
unzip hd_oldlinux.img.zip


Monday, June 18, 2012

PHP GD Bundled - Compilation Instructions for Ubuntu 12.04

I needed to recompile the gd in ubuntu 12.04 to work with gd bundled version Warning i don't use mysql but only firebird so your requirements may vary
  1. Open up a terminal.
  2. Become root by typing su and enter your root password when prompted.
  3. Download some packages we'll need for the install. Type apt-get install build-essential debhelper fakeroot dpkg-dev firebird2.5-dev 
  4. Change your current directory to your source one. cd /usr/src.
  5. Download the PHP 5 source code by typing apt-get source php5.
  6. We also need the PHP 5 dependencies. To download these, enter apt-get build-dep php5.
  7. Go into the downloaded PHP directory. cd php5-XXXX. just press after you've typed php5- to complete the folder name.
  8. Now we need to edit a config file to change it into the bundled version of GD. Type  editor debian/rules. (I have removed any reference to mysql in the cofigure lines )
  9. Locate the line that says --with-gd=shared,/usr --enable-gd-native-ttf \ and change it to --with-gd=shared --enable-gd-native-ttf \ by removing ,/usr. (Press ctrl+w to find something, if you search for gd, it is near the second occurrence). To save the file, we need to press ctrl+x then press y and then enter.
  10. Now we've done setting up we now need to compile it. Type dpkg-buildpackage -rfakeroot -d
  11. When it's done, you should have a load of .deb files in the parent directory. Find the one starting with php5-gd.
  12. Install it by double clicking on it, or from the terminal, type dpkg -i php5-gdXXXXXXX just press after you've typed php5-gd to complete the file name.

Sunday, June 10, 2012

Building Doom3 GPL code on #Ubuntu #Lubuntu 64 bits


As you might now doom3 source code is now open sourced
and it can be studied and forked and improved on github
https://github.com/TTimo/doom3.gpl
Here are the instructions to build it on Lubuntu / Debian sid 64

You might need the doom3 data from your legal sources :)
http://www.cyberciti.biz/faq/linux-install-doom3-game/


sudo apt-get install scons

apt-get install ia32-libs libc6-dev-i386 lib32gcc1 gcc-multilib  lib32stdc++6 g++-multilib lib32z1-dev

apt-get install libopenal-dev
apt-get install
apt-get install libglu-dev


apt-get install libX11-dev:i386 libXext-dev:i386 libxxf86vm-dev:i386

ln -s /usr/lib32/libz.a /usr/lib/libz.a

git clone https://github.com/TTimo/doom3.gpl.git

cd doom3.gpl
cd neo

scons NOCURL=1


build/debug/core/sys/scons/doom
DOOM 1.3.1.1304-debug linux-x86 Nov 26 2011 20:21:11
found interface lo - loopback
found interface wlan0 - 192.168.1.103/255.255.255.0
found interface virbr0 - 192.168.122.1/255.255.255.0
no 'base' directory in exe path /home/mariuz/work/doom3.gpl/neo/build/debug/core/sys/scons, skipping
no 'base' directory in cwd path /home/mariuz/work/doom3.gpl/neo, skipping
WARNING: using hardcoded default base path
------ Initializing File System ------
Current search path:
/home/mariuz/.doom3/base
/usr/local/games/doom3/base
game DLL: 0x0 in pak: 0x0
Addon pk4s:
file system initialized.
--------------------------------------
Unknown command 'vid_restart'
idRenderSystem::Shutdown()
Sys_Error: Couldn't load default.cfg

To build the doom3 with curl support there is already a pull request with the curl m32 fix
Update : The m32 curl fix is already applied



Building Linux Kernel 3.X.X-RC-X with an php script on Debian / Ubuntu

Install the prerequisite packages
$ sudo apt-get install kernel-package php5-cli git-core fakeroot ncurses-dev
$ sudo su
# git clone git://github.com/mariuz/kernelcompile.git
# cd kernelcompile
# php rc-kernel-compile.php
if all is ok you will be asked for kernel build option (menuconfig) (they are copied from your system config) after you have chosen the menu you can press exit and the build will continue and it will start compiling using all your available cpus

Here is what i usually change on the menu

Enable Preemptition Model for Low Latency (near realtime)

Processor Type and Features> Preemptiton Model (Preemtible Kernel(Low-Latency Desktop))

Please disable Xen

Processor Type and Features -> Paravirtualized Guest Support -> Xen

Proccessor Type and Features -> Timer frequency (1000HZ)
this is a for a desktop system

The latest deb package for kernel will be in /usr/src
you need to install it with

# dpkg -i linux-image*

Wednesday, June 06, 2012

upgrading from ubuntu 12.04 to debian testing or sid

A good idea is to install a light desktop manager like lxdm or xfce so at least you have a DM in case
gnome will not work out

Install debian keyring http://packages.debian.org/wheezy/all/debian-archive-keyring/download


modify /etc/apt/sources.list
delete all the lines and
add these ones 
deb http://ftp.us.debian.org/debian sid main contrib
deb-src http://ftp.us.debian.org/debian sid main contrib

apt-get update
apt-get -f -o Dpkg::Options::="--force-overwrite" dist-upgrade


there will be a lot of issues and it might bring your  machine unbootable
So be prepared with a testing debian stick or cd

Here are some of the issues that could happen while upgrading the machine there are many dpkg-new files in the /etc/init.d/ folder so here are some tips bellow

Init scripts and networking system
Get rid of upstart first. I had problems with sysv-rc and needed to force reconfiguration. Some init scripts were installed with "dpkg-new" in the name, I had to rename them. As with X, I tried few solutions, this is distilled but stil redundant version:
dpkg-reconfigure sysv-rc
cd /etc/init.d
mv acpid.dpkg-new acpid
mv anacron.dpkg-new anacron
mv atd.dpkg-new atd
mv cron.dpkg-new cron
mv dbus.dpkg-new dbus
mv module-init-tools.dpkg-new module-init-tools
mv procps.dpkg-new procps
mv rsyslog.dpkg-new rsyslog
mv udev-mtab udev
dpkg --purge --force-all base-files ifupdown initscripts netbase sysv-rc sysvinit sysvinit-utils
apt-get --reinstall install base-files ifupdown initscripts netbase sysv-rc sysvinit sysvinit-utils



http://virtually-a-machine.blogspot.ro/2010/09/live-migrating-ubuntu-to-debian-howto.html


Monday, June 04, 2012

The simplest VivaGraphJS graph test


Creating a graph in  VivaGraphJS with webgl

Create a graph with user id edges and for data
By definition, a Graph is a collection of nodes (vertices) and links (also called edges - identified pairs of nodes). In VivaGraph.JS nodes can be any object e.g. a string, a number, a function, another graph or object, and so on.

The graph g can be grown in two ways. You can add one node at a time:
g.addNode('1','User name 1');
g.addNode('2','User name 2');

Now graph g contains two nodes:1and 2. You can also use addLink()method to grow a graph. Calling this method with nodes which are not present in the graph creates them,If nodes already present in the graph 'addLink()' makes them connected
g.addLink('1', '2');

and at the end we add render loop

var renderer = Viva.Graph.View.renderer(g);
renderer.run();

here is the final output when loaded on the onload function for the html page , this is for the two users from above


we can add other nodes for example 3
g.addNode('3','User name 3');
and then create the links between them

g.addLink('2', '3');
g.addLink('3', '1');





Saturday, June 02, 2012

Here is is howto upgrade to the new FDB 0.8.0 driver

 The new driver is released FDB release 0.8.0 is out: http://pypi.python.org/pypi/fdb/0.8.0
 Highlights for this release:
 Support for Firebird Event Notifications (see KInterbasDB documentation for details)
 And as always, some bugs fixed.
 Target for next version: stream BLOB support (necessary for big BLOBs)
 Here is howto update it in ubuntu/debian , i love pip

sudo pip install --upgrade fdb 
Downloading/unpacking fdb
  Downloading fdb-0.8.0.tar.gz (164Kb): 164Kb downloaded
  Running setup.py egg_info for package fdb
    
Installing collected packages: fdb
  Found existing installation: fdb 0.7.2
    Uninstalling fdb:
      Successfully uninstalled fdb
  Running setup.py install for fdb
    
Successfully installed fdb
Cleaning up...

Saturday, May 26, 2012

How php compiles the source code ?

PHP compiles source code into Zend Engine bytecode - this is done by the Zend
compiler in zend_language_scanner.l, zend_language_parser.y and
zend_compile.c. This code is the executed by the opcode engine in
zend_execute.c and zend_vm_execute.h. The latter is generated from
zend_vm_def.h by means of the script zend_vm_gen.php.




For  a good intro to php internals there is a presentation in french 
http://julien-pauli.developpez.com/tutoriels/php/internals/presentation/


I saw it via this thread on php internals 






Thursday, May 24, 2012

Running thin server in development instead of mongrel

need to add to the  Gemfile

gem 'thin', :group => 'development'

then run

$ bundle install

to start it type
$ rails server thin

Tuesday, May 22, 2012

RubyRails for PHP programmers starting points

If you have php code that needs to be converted to ruby/rails there are a few starting points
hyperpolyglot should be your homepage:
http://hyperpolyglot.org/scripting

On the ruby site there is a nice intro on Similarities and Differences.

From Rails for Php Programmers i used this pdf PHP to Rails Reference (extract)
on the translating php cookies and session (params for post/get ...)

Also the PHP to Ruby reference is very good
https://github.com/maintainable/php-ruby-reference

Ps: main site http://railsforphp.com/ seems to be down at the moment but i guess you can fork and build the reference yourself

Saturday, May 19, 2012

Getting the list of friends and their feeds with python open_facebook

I use django facebook api and here is the example i use to list my friends and their feeds

new fdb firebird driver example :execute insert statement

Here is my example for inserting one row in firebird database with fdb python driver


Installing kinterbasdb on Ubuntu Server 12.04 64 bits (python 2.7.3)

 The official way is from svn , otherwise you will get this error

_kiservices.c: In function ‘_init_kiservices_ibase_header_constants’:
_kiservices.c:809:3: error: ‘isc_info_db_impl_isc_a’ undeclared (first use in this function)


Old driver and soon to be deprecated , the recommended way is to use fdb

svn co https://firebird.svn.sourceforge.net/svnroot/firebird/python/kinterbasdb/trunk/ kinterbasdb
cd kinterbasdb

sudo python setup.py install



Connect to firebird using the new python fdb driver

Install the firebird driver (you might need firebird2.5-dev headers)

 pip install fdb

use this documentation link  for the moment


and here is your first connection

Thursday, May 10, 2012

What oracle really wants is

A full rewrite of the Java classees with core api and classes and that is what Microsoft "suffered" with the C# Yes C#/.net combo is a bad rewrite of the Java language with COM api and all the unportable DirectX included https://www.eff.org/deeplinks/2012/05/oracle-v-google-and-dangerous-implications-treating-apis-copyrightable