Khalil Majdalawi's Blog Web development,Technology,Games and more…

27Nov/110

Black Screen on Ubuntu

Today i tried to install Ubuntu 11.10 on HP Pavilion g6 laptop and i faced a strange problem a black screen during installation!!!

so i tried connecting it to another monitor and it did work but after installation and installing latest update and drivers the problem still exist on the main monitor :S

so after some googleing and trying deferent solutions i found out that the problem in screen brightness level,  for laptop monitor the level is  0 or less "total black"  which is weird,  and the fn key is working in wrong way "inversed" WTH!! ,

to adjust the level you need to hit f3 without fn key :S , or find the solution the hard way  by setting it in this file /etc/rc.local by adding the following line before exit 0

echo 5 > /sys/class/backlight/acpi_video0/brightness
exit 0

Where 5 is the brightness level from 0 to 10

source

8Jun/103

How to fix the Ubuntu GPG Error BADSIG

If you are seeing Ubuntu GPG Error BADSIG use the one of the following methods to fix

Error Message:
W: GPG error: http://archive.canonical.com intrepid Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key

Try to run the following commands from terminal

sudo -i
apt-get clean
cd /var/lib/apt
mv lists lists.old
mkdir -p lists/partial
apt-get clean
apt-get update

source

Tagged as: 3 Comments
5Oct/095

Delete .svn folders recursively using command line

some times i work on small projects with friends and we use Subversion to track and store code changes, collaborate, and share project files so once we finish we usually upload it somewhere by copying the whole project folder so i face that subversion makes folder inside each folder in the project called ".svn" and that take time to remove manually and unnecessary size to upload
so i run a command inside the project folder to remove that folders recursively before upload.

Run this:

find . -name .svn -exec rm -rf {} \;

4Jul/093

How to get client MAC address in PHP

<?php
exec('arp '.$_SERVER['REMOTE_ADDR'],$user_mac);
echo substr($user_mac[1],strpos($user_mac[1],':')-2, '17');
?>

Note : this technique only works on local area networks with linux based server and its impossible to get mac address in php over internet

Tagged as: 3 Comments
15Jun/090

Mount and Unmout ISO Files in Ubuntu

Mount ISO File

First you need to make the directory to put the ISO file into using the following command

sudo mkdir /media/isodir

Then use following command

sudo mount your_image_file.iso /media/isodir/ -t iso9660 -o loop

Now you should have your iso file mounted, and accessible from your desktop.

Unmount ISO File

Just use following command

sudo umount /media/isodir

Tagged as: , No Comments