Iceweasel 3, fix high CPU usage

February 3, 2010 by paragasu

type about:config, and change the browser.cache.memory.enable value to false

firefox 3 RC1 high cpu and memory usage

jQuery, check if element exists

February 2, 2010 by paragasu


if($('#some-div').length)){ /* exists */}

how to tell if an element exists

postgresql dblink query across database

January 29, 2010 by paragasu

google apps spf records

January 28, 2010 by paragasu

type TXT
value

v=spf1 a mx include:aspmx.googlemail.com include:_spf.google.com ~all


google incorrect spf records

spf checker

ckeditor – how to make simple uploader work

January 22, 2010 by paragasu

edit the html page where you call the ckeditor instance.

CKEDITOR.replace('editor',
{
filebrowserUploadUrl:'/path/to/upload/script.php';
});

the line above will display the upload from whenever user click on the image icon.
the upload script should return

<script type="text/javascript">
window.parent.CKEDITOR.tools.callFunction(1, '<url of uploaded file>', '');</script>


ckeditor external file uploader

ckeditor image uploader problem

xfce4 enable restart and shut down for normal user

January 7, 2010 by paragasu


#apt-get install sudo
#visudo

add the following

your_username ALL=NOPASSWD:/usr/sbin/xfsm-shutdown-helper


enable restart and shutdown from xfce4

XUL is interesting

January 6, 2010 by paragasu

multiseat system

January 6, 2010 by paragasu

how to save file into postgresql database

January 6, 2010 by paragasu

you need a column in a postgresql table with the type OID

create table files(
file_id serial primary key,
file oid not null
);

to insert file

INSERT INTO files(file) values(lo_import('/tmp/filename.ext');

to read the file

SELECT lo_export(file, '/tmp/filename.ext') WHERE file_id=2;

you can get the file in the /tmp/filename.ext.

store upload image postgresql

autologin with startx

January 6, 2010 by paragasu

edit /etc/inittab
comment out the line

#1:2345:respawn:/sbin/getty 38400 tty1

add the line

1:2345:respawn:/bin/login -f YOUR_USER_NAME tty1 /dev/tty1 2>&1

edit the .bash_profile and add

startx

autologin in debian