Permissions and umask

August 30, 2008 by

you might have found that sometimes you can’t -for example- copy (or write) files into X directory when you’re using your user

but at the same time you can copy files into the same X directory using the “root” user

so how do i get the permission for writing in X using any user … not root only!!

Read the rest of this entry »

System time isn’t correct

August 27, 2008 by

This problem was always facing me in Ubuntu.

the problem is that the system clock is some hours forward or backward, and that’s because Ubuntu by default considers that your system clock is adjusted to the UTC time.
So if your system clock is adjusted to your local time, here the problems will start.

Now you should configure your system to consider that you system clock is adjusted to your local time. So, you should do that:-

Open this file with your favorite text editor:

/etc/default/rcS

Find this line:

UTC=yes

replace it with:

UTC=no

Now restart your machine and you will find that your system time is correct.

touchpad doesn’t work as a left click

August 25, 2008 by

Hello

problem

first time i installed fedora(9) on my Dell laptop, i found that i couldn’t use the mouse touchpad as a left click

and that didn’t bother me, because it was useful somehow 😀

but when i tried to install ubuntu, i found that the toutchpad click is working very well

that doesn’t mean that the solution is to install ubuntu!!!

you must think and search for your problems’ solutions and never give up till you find them!!

Solution

few days later, i found the solution on cat-h4ck3rz forum and i wanted to share it

#vi /etc/X11/xorg.conf

add the following line in the ServerLayout Section

InputDevice "TouchPad" "CorePointer"

then add this new section:

Section "InputDevice"
Driver "synaptics"
Identifier "TouchPad"
Option "SendCoreEvents"
Option "Protocol" "auto-dev"
Option "SHMConfig" "on"
Option "TapButton1" "1"
Option "TapButton2" "2"
EndSection

that’s it!

now restart your X window using (alt+ctrl+backspace)

and you’ll find your touchpad click is working!

good luck 😀

Compiz Crash

August 23, 2008 by

Yeah.. Compiz does it alot, Especially with Nvidia graphic cards.

So, what happen’s?

  • First you will find that the border around all windows is gone!! it disappears!!.
  • then if you open a terminal you will see that the text is not visible in it!!!
  • some times you find that Minimization an Maximization is not working.

Do you know why does it all hapen?

that’s because compiz which is your window manager is crashed!! and unfortunately, the window manager is the application that is responsible for making a border around your windows to enable you to resize or drag the window.
It’s also responsible for the minimization and maximization for windows, desktop effects, etc

Now I think you see how annoying it is when it craches!!

So, what is the solution?

some times.. just pressing Alt+F2 then writing this command solves the problem:

compiz –replace

but sometimes it dosen’t solve the problem and when you run this command in a terminal you get an error output like that:

Checking for Xgl: not present.
Detected PCI ID for VGA: 01:00.0 0300: 10de:0185 (rev c1) (prog-if 00 [VGA controller])
Checking for texture_from_pixmap: present.
Checking for non power of two support: present.
Checking for Composite extension: present.
Comparing resolution (1024×768) to maximum 3D texture size (2048): Passed.
Checking for nVidia: present.
Checking for FBConfig: present.
Checking for Xgl: not present.
Attempted to unregister path (path[0] = org path[1] = freedesktop) which isn’t registered
Attempted to unregister path (path[0] = org path[1] = freedesktop) which isn’t registered
Attempted to unregister path (path[0] = org path[1] = freedesktop) which isn’t registered

Or sometimes like that

Checking for Xgl: not present.
No whitelisted driver found
aborting and using fallback: /usr/bin/metacity

this Error happens with Nvidia graphic cards and the soulution is so simple:

first: check if you have the nvidia-glx driver installed in your system.

second: if it’s installed but you still have the same problem then you should edit this file by hand:

/etc/X11/xorg.conf

and in the “Screen” section add this line:

Option “AddARGBGLXVisuals” “True”

now restart your X server by pressing Alt+Ctrl+BackSpace and you should find that the problem is solved.

if it’s not add this line also to the same file in the same section (But I Really Don’t Recommend That, Do it only if you have to)

Option “DisableGLXRootClipping” “True”

I hope this helps anybody.

bash features

August 23, 2008 by

Bash Features

(1) Expansions:-

we may use Expansions like:

*

and this matches any string, including the NULL string (zero or more character)

?

this matches any single character (single one character)

[ …. ]

matches any one of the enclosed characters

also this can be used to match any character from a range-of-characters by using a hyphen ()

(2) Auto Complete:-

the auto complete feature is used for completing commands and file names

you can use this feature by simply press “tab” button in your keyboard while writing the command

suppose we want to run “ifconfig” command

just type “ifco” and press “tab” button, you’ll find it’s completed automatically to “ifconfig”

the same thing is with file names

notice if you press “tab” twice, you’ll get a list of all possible commands/files that starts with the letters you wrote

for example: type “ifc” and press “tab” twice, you’ll find “ifcfg” and “ifconfig” commands

the next letter will determine if you want “ifconfig” or “ifcfg” command

(3) History:-

you can get the previous command you wrote again by one of these ways:

a) #history

history command prints the last 1000 command you’ve already typed

b) #!!

this is used for executing the last command again

c) #!r

and this is used for executing the last command that begins with “r” letter again

d) you may also press “ctrl+r”

and there you can type the command you want to search for it in the history (note that it’s a reverse search, so it’ll get the last command you’ve typed that begins with the letters you’re searching for)

(4)

$

used to define variables (example: $x)

$()

known as: Command Substitution

and this is mostly in scripts

you’ll understand more when you type:

#echo the date is $(date)

$(())

$[]

these are used in arithmetic operations

try to type

#echo $[4+5]

and

#echo $((4+5))

they’re quite the same!

Keyboard Shortcuts

ctrl+l —-> clear page

ctrl+d —-> log  off

ctrl+s —-> lock account

ctrl+q —-> unlock account

ctrl+u —-> clear line (from end to start)

ctrl+k —-> delete line (from start to end)

ctrl+c —-> Terminate (end process)

ctrl+z —-> Stop (but still not terminated)

ctrl+r —-> reverse search (from bottom to top)

Prepar your server -LAMP Server-

August 18, 2008 by

now will start to prepare the server to start write our script

then will install program to admin our database && execute MySQL Query , you can get them from synaptic package manager

  1. MySQL Query Browser
  2. MySQL Administrator

you will find them in Application >> Programming >> 1 && 2 . you have to set the root pass word when you install them . that pass you will login with and the user will be “root” . also you will select the server folder on your hard as default “/var/www” you can edit it that folder .

let us test the server

  • add new file in “/var/www” call it “index.php” write “<?php echo “you have 100% cooool server lol” ; ?>” , then go to your firefox and go to http://localhost/” if you see a page with the text “you have 100% cooool server lol” then ok .
  • go to application >> programming >> MySQL Administrator && MySQL Query and try your user name “root” and your pass”******” if you loged in then ok .
  • create another file in “/var/www” call it “info.php” write in it <html>
    <head>
    <title> PHP Test Script </title>
    </head>
    <body>
    <?php
    phpinfo( );
    ?>
    </body>
    </html>
  • then go to your FF and go to http://localhost/info.php
    phpinfo is one of the “built-in” functions that PHP does. There are many others, but this one is a nice one to use to start of as a test.
    All working well so far? Good.

P.S

in Linux you maybe not the root user so you will not be abol to edit “/var/www” then go to your terminal and write “sudo nautilus” then the pass of the root user then edit as much as you need .

OK now your server working well start write some code :D ,
so till the next post keep it up & keep freak :)