Wednesday, March 28, 2012

Lubuntu 12.04 countdown!

The Lubuntu 12.04 countdown is ready

Sunday, March 25, 2012

Migrating to django 1.4

First i have fixed the warnings
[Sun Mar 25 21:15:41 2012] [error]   DeprecationWarning
[Sun Mar 25 21:15:42 2012] [error] /usr/lib/python2.5/site-packages/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
[Sun Mar 25 21:15:42 2012] [error]   "use STATIC_URL instead.", DeprecationWarning)
[Sun Mar 25 21:15:42 2012] [error] /usr/lib/python2.5/site-packages/django/core/cache/__init__.py:82: DeprecationWarning: settings.CACHE_* is deprecated; use settings.CACHES instead.
[Sun Mar 25 21:15:42 2012] [error]   DeprecationWarning
so i have deleted the line ADMIN_MEDIA_PREFIX from settings.py and need to configure the "/media" for the admin url also replaced
CACHE_BACKEND = 'locmem://'
with
{
    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
    }
}

Wednesday, February 15, 2012

For people who belive in ORM: Please learn SQL

Here is one example of what happens when django ORM can be optimized
Profiling Django Applications: A Journey From 1300 to 2 Queries

Sunday, February 12, 2012

EC2 is about 10-20 times more expensive than dedicated hosting.

Quote of the day via ycombinator:

Even if reserved instances save us 22% over 3 years, it still doesn't even come close. Reserved instances also force me to commit to using a certain type of EC2 instance for 3 years with lots of money upfront. Moreover, IO is ridiculously bad on EC2 and there's nothing that can be done about it. Even RAIDing a gazillion EBS volumes together doesn't do much. I'm glad the truth about how expensive EC2 really is is starting to come out. Hopefully it will force them to revise their pricing, or at least offer more processing power for the same price.

I ran some benchmarks a few weeks ago that show how expensive EC2 really is

Agreed. Here's a good relevant blog post by mark maunder challenging the "cloud hype"  http://markmaunder.com/2011/10/31/clouded-vision/

Another thing that is overpriced is the memory , here is a quote from the basecamp's next memory cache article (see the comments section)


They have brought 864GB of RAM that looks like below




Total price was $12,000
Compare that with Amazon :Just checked AWS Elastic Cache’s pricing.
It would cost around 20k / month for ~ 800 GB of Memory. (12 * Quadruple Extra Large nodes / 68 GB)

Saturday, February 11, 2012

Ati fglrx gpu blacklisted in latest chrome beta on Lubuntu/Ubuntu 11.10 with the fglrx driver




Although it works just fine if i use to ignore the blacklisting
Tested on two systems with the current drivers and quite new gpus

See bellow

Here are the details
:

Wednesday, February 08, 2012

php shell script that will run runs at specific hour with crontab and send emails with the html form extracted content


Here is how to create a daily crontab script that runs at specific hour 
gets the web content and then saves the output in a file folder (the form must use a sumbit button with post) and then 
it send email with the html file 

you need to install php5-cli , php-pear 
sudo apt-get install php5-cli php-pear

and then from pear Mail , Mail_Mime http://pear.php.net/package/Mail_Mime/redirected

sudo pear install Mail_Mime
sudo pear install Mail

crontab -l

# m h  dom mon dow   command
0 1 * * * /home/ubuntu/curl_cron.php


cat /home/ubuntu/curl_cron.php


Thursday, February 02, 2012

Suhosin is disbled by default in Debian, and soon Ubuntu - i hope

I think is the right aproach 
I don't believe in security by obscurity (this random patch it will secure your php ... riiight)

suhosin shouldn't be a patch it should be inside of php core or as module (think like the selinux situation) , So debian guys are right use the upstream unpatched version , let the core php devels decide if suhosin is right or wrong for them :less bugs , less patches , life is better = more security and fast updates in debian

Did i told you that upstream doesn't test suhosin patch when they run the tests ?
And with that patch php core is not the same , there are some bugs that i found related to it  (in debian/ubuntu) and it happens only when that invasive patch is applied

Wednesday, February 01, 2012

updating passenger in rails and ubuntu 10.3 lts

I had one issue with an old instalation of passenger and nginx (kernel 2.6.32 doesn't quite deliver signals to the nginx 0.8.x)

I download the current dark passenger

wget http://rubyforge.org/frs/download.php/75548/passenger-3.0.11.tar.gz
tar -zxvf passenger-3.0.11.tar.gz
cd passenger-3.0.11/
rake package
sudo su # and make me a sandwitch
cd pkg gem install passenger-3.0.11.gem

start the nginx wizzard
/var/lib/gems/1.8/gems/passenger-3.0.11/bin/passenger-install-nginx-module
choose (1),(1)
enter enter enter
and all is installed

Read what is needed to add to nginx config if you do an upgrade

mainly the new passenger path

Please edit your Nginx configuration file (probably /opt/nginx/conf/nginx.conf),
and set the passenger_root and passenger_ruby configuration options in the
'http' block, like this:

  http {
      ...
      passenger_root /var/lib/gems/1.8/gems/passenger-3.0.11;
      passenger_ruby /usr/bin/ruby1.8;
      ...
  }

After you (re)start Nginx, you are ready to deploy any number of Ruby on Rails
applications on Nginx.

Press ENTER to continue.

The END

encoding decoding strings in python3.x


I like to think of  encoding of strings in python3 to the analogy of encrypting your plain text into a random stream of bytes

string (plain text) -> encode (encrypt) -> bytes (stream)
bytes (stream) -> decode (decrypt) -> string (plain text)

and the codec you choose is your key (utf-8 ...)


Sunday, January 29, 2012

Typing so many times the password in sudo is good or bad ?

Well if you watch National treasure  you will see how easy is to spot the common keys that you press with a special fluorescent/UV light , also the fingerprints on a keyboard are more visible on thouse keys (that would be the keys for sudo for example , or the login window) also some social engineering helps (knowing the person)


- I'm here.
- Give me the letters for her password.
What do you got for me?
Hit me with it.
A-E-F-G...L-O-R-V-Y.
Anagrams being listed.OK.
Top results: "A glove fry."...
...
- It's "Valley Forge"."Valley For..."
I don't have that on my computer.It's "Valley Forge" -she pressed the E and L twice.
Valley Forge was a turning pointin the American Revolution.C
an I marry your brain?
We're in.


That is why is better to use the ssh-agent , password-less sudo
and spread your password keys over your keyboard , and one more hint
it shouldn't be any reference to anything known about you in public/private life (eg if you love history:historical references with years dates , places)


Thursday, January 26, 2012

Welcome to the U-nderland

All you want is here , minus start menu and the close menus and minus the menus ,
Oh i told you that you shouldn't use menus , It's a paradigm shift , everything is search and google



Via doctormo who will be removed from the ubuntu holly planet
But dude where is my menu and close button
In the hud , in the hud  a small voice creeps into the ethereal space

 

Ubuntu Romania and Libre Software Romania (software liber) are against ACTA

Between revolutions we have to fight ACTA too , I will copy paste the message from Stas




Apparently, while most of the Romanians were busy with „Băsescu” crisis and snow, ourgovernment decided to sign ACTA.
To be honest, I’m not sure who’s job was to inform European population about this upcoming decision, but they did it in the worst possible way. Anyway, if you feel the need of blaming your regional/representative politician, you can get his address from here:agenda.grep.ro.
For those who just woke up in this world, and have no clue what’s this all about, take a look at this video.

About the picture above is from doctormo

Configuring pydev for django

I love some of the pydev features and here is my usual django/python setup

Install eclipse classic

Configure updates and add pydev

Configure updates and add eclipse themes

Install ipython
sudo easy_install ipython

Create or import pydev/django project

Configure java script editor (WTP webtools) in updates (in my case for indigo , choose from the repository manager in updates)



Learn and configure howto do remote debugging for django

The eclipse git plugin it crashed on me , aka it failed when i tried to do a push
It's slower than the c based implementation (eclpise plugin for git is written in pure java )
Did i told you that doesn't work , ok So you need to use command line for git , it's faster and better

Sunday, January 22, 2012

Why Zope fails and Django is better


I quote a thread from reddit and if you still use zope/plone you fail , there is nothing pythonic in the zope
I did a beginner mistake once to think that zope is somehow python and i could handle all the complexity and zope core ugliness but now I know the complexity monsters can't be tamed (include there XML , JAVA2EE, zope ... )

As a Python programmer, hardly anything you knew was useful when trying to do stuff in Zope. It was its own universe, with its own physical laws. You could do some simple things via the web interfaces, but as soon as you want to do stuff in Zope's odd variant of Python, you had to start from scratch.
And as a result, we lost a whole generation of Python web programmers.
In that respect, Django is more of an anti-Zope -- it's plain old Python pretty much all the time, you don't have to unlearn or relearn anything, and it has done more to get new programmers to pick up Python than any single Python library or application ever released before it. Heck, the Django mailing lists are almost as crowded as the Python mailing lists these days.

Illegal parameter: -WG while switching project from free pascal 2.4 to 2.6

While switching compiler from 2.4 to 2.6 under debian sid i had this error whilile
compiling an project created under ubuntu with lazarus 0.9.30.x and fpc 2.4

Illegal parameter: -WG




Solution is to remove : Target OS specific options (Win32 gui application -WG) from Project Compiler Options




Wednesday, January 11, 2012

Debugging tips for #perl tfmail.pl on a shared host with no logs , and windows on it ...

Well the story is that the tfmail.pl shows only this
Application Error An error has occurred in the program so no debug errors or anything else
I had to add debug mode for the script and saw this tip how to do it :

With Perl there is something you can try that will attempt to redirect error messages to the browser so you can attempt to diagnose the problem. Open the script in your text editor, and under the path to Perl on the first line, place this:
use CGI::Carp qw(fatalsToBrowser);
Only then I saw that LOGFILE_ROOT was set to '.' and that made the script die I have fixed the line
use constant LOGFILE_ROOT   => '';
and reuploaded and all was ok after that

Tuesday, January 10, 2012

Fibonacci procedure for #firebird

I had to do  (recursive function example) Fibonacci stored procedure for Relational Databases exam
so here it is
To run it and test the numbers type in flamerobin
SELECT N_FIBONACCI
FROM FIBONACCI ('6')
=8


Sunday, January 08, 2012

Bloody Happy New Year

The last year , what i can say
One of my Childhood friends is Dead : Teodor Marian
I still don't know if he wanted to be a Priest like his father or if it was better for him to be a teacher
Before he Died (one week) i had this dream of playing around his House and i couldn't understand what is all about (I felt like someone from my family will Die).
I still can't find his Childhood face in my memory , Maybe is my Trauma that forbids access to it , I only rember his happy laugh and happy pieces of that period
The father of one of my coworkers is Dead
The New Year :
The Father of one of my coworkers is Dead
The Siamese Fish is Dead
The Sanitary Fish is Dead
All in All no matter how many walls you rise against the world there is something to shake the entire fundation
But now i feel better , life goes on and I know that there is something better than to dive into melancholy
I go back to ther roots , I love programming in Python , Pascal or any language
I still have one happy family at reea.net , i still have my Love and my future wife
I still have my Family near me even if they are so far away
Ohh Yes and still have the Exams this Month :)
There is always something (level of stress or excitement) that keeps you alive and kicking



Wednesday, December 28, 2011

My FSocial Network

Here is how my FNetwork looks like bellow The only observation I'm mostly strongly connected with coworkers , that means that i use the network for coworker notifications or maybe i'm workaholic :) I wish the visualisation was made with webgl

Tuesday, December 27, 2011

One way to run firebird pdo tests

Just to not forget how to run them i write here


TEST_PHP_EXECUTABLE=auto php -n ./run-tests.php ext/pdo_firebird
of course you can add username/password , db path
PDO_FIREBIRD_TEST_DSN='firebird:dbname=/var/lib/firebird/2.5/data/employee.fdb'
PDO_FIREBIRD_TEST_USER='SYSDBA' PDO_FIREBIRD_TEST_PASS='masterkey'
TEST_PHP_EXECUTABLE=auto php -n ./run-tests.php ext/pdo_firebird
Saw it via comment section from pdo firebird driver documentation