Sunday, July 30, 2006

Reasons why Reiser4 is great for you:

* Reiser4 is the fastest filesystem, and here are the benchmarks.
* Reiser4 is an atomic filesystem, which means that your filesystem operations either entirely occur, or they entirely don't, and they don't corrupt due to half occuring. We do this without significant performance losses, because we invented algorithms to do it without copying the data twice.
* Reiser4 uses dancing trees, which obsolete the balanced tree algorithms used in databases (see farther down). This makes Reiser4 more space efficient than other filesystems because we squish small files together rather than wasting space due to block alignment like they do. It also means that Reiser4 scales better than any other filesystem. Do you want a million files in a directory, and want to create them fast? No problem.
* Reiser4 is based on plugins, which means that it will attract many outside contributors, and you'll be able to upgrade to their innovations without reformatting your disk. If you like to code, you'll really like plugins....
* Reiser4 is architected for military grade security. You'll find it is easy to audit the code, and that assertions guard the entrance to every function.

V3 of reiserfs is used as the default filesystem for SuSE, Lindows, FTOSX and Gentoo. We don't touch the V3 code except to fix a bug, and as a result we don't get bug reports for the current mainstream kernel version. It shipped before the other journaling filesystems for Linux, and is the most stable of them as a result of having been out the longest. We must caution that just as Linux 2.6 is not yet as stable as Linux 2.4, it will also be some substantial time before V4 is as stable as V3.

discussion about reiserfs

EVERY computer needs a u.p.s.

(Score:5, Insightful)
by FrankHaynes (467244) on Monday August 23, @11:59PM (#10052991)
Write on the blackboard 10^10000000 times:

"EVERY computer needs an uninterruptible power supply. EVERY one."

There are so many problems of which you might not be aware, aside from those requiring you to run fsck afterwards, which are solved by a good u.p.s. that you'd be penny-wise, pound-foolish for not putting a u.p.s. on every machine in sight.

My clients think that I can walk on water simply because I eliminated a large share of unexplainable wierdnesses from their machines by installing an inexpensive u.p.s. on every single one.

Solid, clean power is very important to a stable computing system. I cannot stress this enough.
> > E: /var/cache/apt/archives/tzdata_2006g-2_all.deb: trying to overwrite
> > `/usr/share/zoneinfo/Africa/Algiers', which is also in package locales
> >
> Absolutely, this happens when you have to put on tzdata, which is needed for
> libc6.
> dpkg --force overwrite /var/cache/apt/archives/tzdata._2006g-2_all.deb
> should do it

The answer was:

sudo dpkg --force-overwrite
--install /var/cache/apt/archives/tzdata_2006g-2_all.deb

But thanks for putting me on the right track.

1.9.7 really looks good.

Thanks, Bill, for the info that it was on sid. If anyone notices when
future versions make it there, I'd appreciate the announcement.

how to burn cd in Ubuntu

how to burn cd in Ubuntu

in nautilis (the file manager)

type: burn:///

Saturday, July 29, 2006

ugly openoffice fonts


I think the problem the OP has is withthe font rendering in OpenOffice. I have to agree that it does pretty bad job with most fonts. I haven't found any solution for this, but at least everything looks OK when printed to paper or exported to PDF

Friday, July 28, 2006

converting FLV to MPG

sudo apt-get install ffmpeg 
ffmpeg -i video.flv -ab 56 -ar 22050 -b 500  -s 320x240 video.mpg 

finally to make your life easier just put it a script file to excute later

mkdir ~/scripts;
echo 'ffmpeg -i $1 -ab 56 -ar 22050 -b 500 -s 320x240 $1.mpg' > f2mpg.sh;
mv Flv2Mpg.sh ~/scripts

now whenever you want to convert FLV file to mpg just shot the

 ~/scripts/f2mpg.sh Flv_video_file_name.flv

Tuesday, July 25, 2006

Disable Synaptics Touchpad

original article:


http://ubuntu.wordpress.com/2006/03/24/disable-synaptics-touchpad/


March 24, 2006

Posted by ubuntonista in ubuntu, guides. trackback

I needed a quick way to disable and enable my synaptics touchpad at will, and I found one.

Make sure that in you /etc/X11/xorg.conf file, you have:


Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
Option "SHMConfig" "on"
EndSection

Notice the Option “SHMConfig” “on” line — that is the one that you really need to have in there. This allows you to change some configuration parameters for the synaptics touchpad without restarting Xorg (Xserver).

Now that is taken care of.

All you have to do to disable your synaptics touchpad is to execute the command:
$synclient TouchpadOff=1

and to turn it back on, you can execute the command
$synclient TouchpadOff=0

TIP: To make it even easier to turn the touchpad on and off, you can set a keyboard shortcut and bind the shortcuts to the command to turn it on, and off, and use the keyboard shortcuts.

Sunday, July 23, 2006

change keybindings of show desktop, Ctrl+Alt+d to Windows D

With each release of GNOME, I think it pulls further ahead of KDE. I’ve been using GNU/Linux for 5 years now, and I have seen GNOME destroy KDE in terms of usability, and now (finally) in terms of speed as well. I love the things you can configure with GNOME when you know what youre doing. Using GConf, you can go to “apps–>metacity–>global_keybindings” and edit the keybindings to whatever you want. Change “show_desktop” to “M” and you’re set (Mod4 is the Winblows key). You can further your Windows-esque interface by setting “panel_run_dialog” to “R” and making one of the run_commands “F” and editting the corresponding command to be “gnome-search-tool”. T is nice to run an xterm, and I like to set B and Z to be “xmms -f” and “-r” to control xmms skipping while its still minimized. I am excited for 2.8! One question, my mouse cursor has a shadow with transparency, why can’t my windows have shadows?

customized keybindings and desktop elements

gconf-editor

unix autoexec.bat

/etc/profile

/etc/bash.bashrc

Friday, July 21, 2006

ubuntu: No sound in youtube.com (flash)

Original Article:

http://ubuntuforums.org/showthread.php?t=187752&highlight=sound+flash

The problem is that Flash is old and doesn't support Ubuntu's directory structure for esd properly. It wants to use /tmp/.esd/socket for the sound connection. But Ubuntu uses /tmp/.esd-/socket for the sound (the uid for the user that installed Ubuntu is 1000). A quick hack you can do to fix this is to symbolic link that directory. To do that, go to System - Preferences - Sessions - Startup programs and add
Code:
ln -s /tmp/.esd-1000 /tmp/.esd
to the list (assuming your uid is 1000, change it accordingly if it isn't), then logout and log back in. After doing this, Flash sound should work properly.


to get the the current logged user's id: go to terminal: Application > Accessories > Terminal. type: id



Wednesday, July 19, 2006

sql injection attacks increasing

PHP doesn't force you to do that by hand, you can make use of the numerous database abstraction layers for PHP, like PDO [php.net] or PEAR::DB [php.net].

Here is an example, taken straight from PDO's page:
$stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)");
$stmt->bindParam(':name', $name);
$stmt->bindParam(':value', $value);

$name = 'one';
$value = 1;
$stmt->execute();
The framework is there, PHP developers need to make use of it, but sadly things like the following are still common:
mysql_query('SELECT value FROM REGISTRY WHERE name = "' . $name . '"');

cpu frequency scaling

Original Article:


http://ubuntu.wordpress.com/2005/11/04/enabling-cpu-frequency-scaling/

I use the CPU Frequency Scaling Monitor on my panel to see the speed of my CPU. I have a centrino laptop. Ubuntu automatically increases the speed (frequency) of my laptop when the demand is more, and manages things very well.

However, when I am plugged in, I want to run my laptop at the maximum possible frequency at certain times. It turns out that the CPU Frequency Scaling Monitor can also have the functionality to change the Frequency, by “Governing” the CPU frequency. However, by default, on my laptop, left-clicking on the Monitor in the Panel did not give me the option to change the frequency.

In order to be able to change the operating frequency, your processor should support changing it. You can find out if your processor has scaling support by seeing the contents of files in the /sys/devices/system/cpu/cpu0/cpufreq/

For example, on my system:

$cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
gives:

1300000 1200000 1000000 800000 600000

Which means that the above frequencies (in Hz) are supported by my CPU.
and…
$cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
gives:

userspace powersave ondemand conservative performance

All those are the different “modes” I can operate the CPU at. Userspace, for example, regulates the frequency according to demand. Performance runs the CPU at max-frequency, etc…

On the Ubuntu Forums, I read that one can manually change the frequency by executing commands like:
$ cpufreq-selector -f 1300000
which will set the frequency to 1.3 GHz.

Now, I was interested in being able to change the power mode (between the different values listed in the “governors” above, manually by using the Cpu Frequency Panel Monitor.

I found out from the Forums, again, that changing the permissions of the cpufreq-selector binary by doing a:
$sudo chmod +s /usr/bin/cpufreq-selector

will allow me to acheive this. However, I was curious as to why Ubuntu does not, by default, allow me to choose the frequency using the CPU Frequency Panel Monitor, and what the “right” or “correct” way of enabling this is.

With a little bit of detective work, I found the reason why things are the way they are in Bug #17604 :

Oh, please, not another setuid root application if we can avoid it. Which file does cpufreq-selector need access to to change the CPU speed? And why should a normal user be able to change the CPU speed in the first place? The automatic CPU speed works well enough for the majority of users, and control freaks can always use sudo to manually set the speed, or deliberately shoot themselves in the foot by making the binary suid root (as explained in README.Debian).

Anyways, since I really want to “shoot my self in the foot” using my CPU ;) , so I read the readme:
$cat /usr/share/doc/gnome-applets-data/README.Debian

and as suggested in it, I did a
$ sudo dpkg-reconfigure gnome-applets
and answered “Yes” to the question regarding setting the suid of the cpufreq-selector executable. Now, by left-clicking on the CPU Frequency Monitor Applet, I can choose the frequency for my processor, and things couldn’t be better!!

P.S.: A lot of my detective work could have been avoided had I read the README in the first place. Stupid me.


install httrack from source

http://spiderzilla.mozdev.org/installation.html


Spiderzilla for GNU/Linux (or other *nix systems) Linux

This version is working only when you have xfree and HTTrack packages installed.
Why Xfree? Because Spiderzilla is using xterm.
After that you can install HTTrack from sources from this address httrack-3.33.tar.gz.

To install HTTrack here are the command lines:
$ tar xvfz httrack-*.tar.gz
$ cd httrack-*
$ ./configure --prefix=/usr/local && make
# make install
(root permissions required to install HTTrack)
$ /usr/local/bin/httrack

For more information look to www.httrack.com.

Install SpiderZilla for Linux
Download SpiderZilla for Linux (88 KB)

A script "skrypt.sh" has to be executable!
$ chmod +x skrypt.sh
(in ~/.mozilla/firefox/profiles/xxxxxxxx.default/extensions/{3cd27e92-1a30-11da-94c6-00e08161165f}/httrack/skrypt.sh)

Spiderzilla for MacOSX MacOSX

This version is working only when you have X11 and HTTrack packages installed.

You must install X11 for Apple in order to have xterm,
After that you can install HTTrack from sources from this address httrack-3.33.tar.gz.

To install HTTrack here are the command lines:
$ tar xvfz httrack-*.tar.gz
$ cd httrack-*
$ ./configure --prefix=/usr/local && make
# make install
(root permissions required to install HTTrack)
$ /usr/local/bin/httrack

./configure is crazy

TIA
configure: error: C++ preprocessor "/lib/cpp" fails sanity check.

Try apt-get gcc cpp g++

guess what, this substantial code works in linux mono c# yipee!!! :D

to compile in mono:


mcs m.cs -r:System.Data -r:System.Windows.Forms -r:System.Drawing

to run:

mono m.exe




-----------------------------------



original article:

http://www.bobpowell.net/dropshadowtext.htm

using System;

using System.Drawing;

using System.Drawing.Text;

using System.Drawing.Drawing2D;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;



namespace textdropshadow

{

///

/// Summary description for Form1.

///


public class Form1 : System.Windows.Forms.Form

{

///

/// Required designer variable.

///


private System.ComponentModel.Container components = null;



public Form1()

{

//

// Required for Windows Form Designer support

//

InitializeComponent();



this.SetStyle(ControlStyles.ResizeRedraw,true);

}



///

/// Clean up any resources being used.

///


protected override void Dispose( bool disposing )

{

if( disposing )

{

if (components != null)

{

components.Dispose();

}

}

base.Dispose( disposing );

}



#region Windows Form Designer generated code

///

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

///


private void InitializeComponent()

{

//

// Form1

//

this.AutoScaleBaseSize = new System.Drawing.Size(16, 36);

this.BackColor = System.Drawing.Color.White;

this.ClientSize = new System.Drawing.Size(376, 293);

this.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));

this.Name = "Form1";

this.Text = "Form1";

this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);



}

#endregion



///

/// The main entry point for the application.

///


[STAThread]

static void Main()

{

Application.Run(new Form1());

}



protected override void OnPaintBackground(PaintEventArgs e)

{

LinearGradientBrush b=new LinearGradientBrush(this.ClientRectangle,Color.Blue,Color.AliceBlue,90f);

e.Graphics.FillRectangle(b,this.ClientRectangle);

b.Dispose();

}



private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)

{

//Make a small bitmap

Bitmap bm=new Bitmap(this.ClientSize.Width/4,this.ClientSize.Height/4);

//Get a graphics object for it

Graphics g=Graphics.FromImage(bm);

// must use an antialiased rendering hint

g.TextRenderingHint=TextRenderingHint.AntiAlias;

//this matrix zooms the text out to 1/4 size and offsets it by a little right and down

Matrix mx=new Matrix(0.25f,0,0,0.25f,3,3);

g.Transform=mx;

//The shadow is drawn

g.DrawString("Text with a dropshadow",Font,new SolidBrush( Color.FromArgb(128, Color.Black)), 10, 10, StringFormat.GenericTypographic );

//Don’t need this anymore

g.Dispose();

//The destination Graphics uses a high quality mode

e.Graphics.InterpolationMode=InterpolationMode.HighQualityBicubic;

//and draws antialiased text for accurate fitting

e.Graphics.TextRenderingHint=TextRenderingHint.AntiAlias;

//The small image is blown up to fill the main client rectangle

e.Graphics.DrawImage(bm,this.ClientRectangle,0,0,bm.Width,bm.Height,GraphicsUnit.Pixel);

//finally, the text is drawn on top

e.Graphics.DrawString("Text with a dropshadow",Font,Brushes.White,10,10,StringFormat.GenericTypographic);

bm.Dispose();

}

}

}

Tuesday, July 18, 2006

What users hate about IT pros

http://www.networkworld.com/news/2006/071706widernet-end-users.html?page=2

Which brings up another common complaint: techno-jargon. The technical terms and shorthand that IT managers throw around create an air of mystery and superiority to those not in the know, some say. And that may be by design.

"While they make you feel stupid on the one hand, they also shroud solutions in mystery, which I believe is a job protection/justification strategy," says Lisa, a partner with a financial services firm in the Boston area.
—-FIXED!!!!——

/dev/snd/seq failed: No such file or directory

solution: modprobe snd-seq

Monday, July 17, 2006

how to change domain or workgroup in Ubuntu

How to change computer Domain/Workgroup

* Read #General Notes
* Read #How to install Samba Server for files/folders sharing service

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf

* Find this line

...
workgroup = MSHOME
...

* Replace with the following line

workgroup = new_domain_or_workgroup

* Save the edited file

sudo testparm
sudo /etc/init.d/samba restart

equivs (for yahoo messenger dependency workaround)

Circumvent Debian package dependencies
This package provides a tool to create Debian
packages that only contain dependency information.

If a package P is not installed on the system, packages
that depend on P cannot normally be installed. However,
if equivalent functionality to P is known to be installed,
this tool can be used to trick the Debian package management
system into believing that package P is actually installed.

Another possibility is creation of a meta package. When this
package contains a dependency as "Depends: a, b, c", then
installing this package will also select packages a, b and c.
Instead of "Depends", you can also use "Recommends:" or
"Suggests:" for less demanding dependency.

Please note that this is a crude hack and if thoughtlessly used,
it might possibly do damage to your packaging system. And please
note as well that using it is not the recommended way of dealing
with broken dependencies. Better file a bug report instead.


Cedega on Dapper
April 22nd, 2006.

The .deb package of Cedega will not install on Ubuntu’s Dapper, because of the missing “xlibs” dependency. Lots of workarounds are available on Ubuntu Forums and Transgaming’s support page. “Installing the Breezy version of xlibs” and “converting the .deb into .tgz and back to .deb” are examples of them. I like neither of them.

Introducing “equivs”. With equivs one can create dummy packages used to satisfy the (Debian) package administration. The process of creating a dummy involves two steps: creating a control file, and building the package. After installing this package with dpkg, the system “believes” the software to be installed, an will accept other packages depending on it.


-------------------------------------------------------------

So, let’s create a xlibs dummy package:

# sudo apt-get install equivs
# mkdir $HOME/temp ; cd $HOME/temp
# equivs-control xlibs
# pico xlibs
(contents of xlibs)

Section: misc
Priority: optional
Standards-Version: 3.5.10

Package: xlibs
Version: 6.8.2-77
Maintainer: Your Name

# equivs-build xlibs
# sudo dpkg -i xlibs_6.8.2-77_all.deb