Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

Wednesday, September 30, 2009

How to Change MAC Address

Changing MAC address of a machine is called spoofing a MAC address or faking a MAC address. In linux, you can change MAC address of your machine. This is how it is done.

First find the physical MAC address of your machine by running the following command :

$ ifconfig -a | grep HWaddr
eth0 Link encap:Ethernet HWaddr 00:1f:f3:cc:c2:f9

The hexadecimal numbers in blue denote my machine's MAC address. Yours will be different.

Next, login as root in Linux and enter the following commands -



# ifconfig eth0 down
# ifconfig eth0 hw ether 00:11:22:33:44:55
# ifconfig eth0 up
# ifconfig eth0 | grep HWaddr


Note above that I have changed the MAC address to a different number highlighted in blue. 00:11:22:33:44:55 is the new MAC address I have provided for my Linux machine. You can choose any 48 bits hexadecimal address as your MAC address.

Thursday, September 10, 2009

Disabling Macbook Pro Touchpad

We may want to disable Macbook Pro (or any other Laptop) Touchpad, such cases are:
(i) We have connected a USB mouse, so we do not want to use touchpad for now.
(ii) While typing, there is no use of touchpad, if touchpad is too sensitive, the cursor keeps on jumping due to slight touch of palm or finger.

I have written a script to disable/enable touchpad (which is using synaptics driver).





#!/bin/bash

## Disable touchpad if USB Mouse is attached

SYNAPTICS=`which synclient`

if [[ "$SYNAPTICS" == "" ]]
then
echo "$0: please install synaptics touchpad driver."
echo "Also make sure that 'Option \"SHMConfig\" \"on\"'"
echo " is added in Touchpad device Section in /etc/X11/xorg.conf"
exit
fi

USB_mouse_present=`grep -ic "usb.*mouse" /proc/bus/input/devices`
# if no USB Mouse; enable touchpad
if [ $USB_mouse_present -eq 0 ]
then
$SYNAPTICS TouchpadOff=0
else
$SYNAPTICS TouchpadOff=1
fi

# if any parameter [on|off] is given, override previous command
if [ $# -ge 1 ]
then
if [ "$1" = "on" ]
then
$SYNAPTICS TouchpadOff=0
else
$SYNAPTICS TouchpadOff=1
fi
fi

exit 0



Sample Run:
Turn on touchpad

$ ./touchpad.sh on

Turn off touchpad

$ ./touchpad.sh off

If we have plugged USB mouse, then just give following command

$ ./touchpad.sh

On removing USB mouse, give following, the touchpad will be enabled automatically. :)

$ ./touchpad.sh


PS: The configuration for synaptics driver can be referred from here or here.

Sunday, May 31, 2009

Making Soundcard Work in Macbook Pro

After installing Debian 5.0 (Lenny) on Macbook Pro (4,1), I found that
sound card was detected, but there was no sound. Then, I come to know
that, model=mbp3 option must be passed to snd-hda-intel kernel driver, to
make soundcard work. This is content of /etc/modprobe.d/sound file.


$ cat /etc/modprobe.d/sound

options snd slots=snd-hda-intel
# u1Nb.bVcdGDjFCiF:82801H (ICH8 Family) HD Audio Controller
alias snd-card-0 snd-hda-intel
# Add the following line as an option to snd_hda_intel module
options snd_hda_intel model=mbp3

Friday, May 22, 2009

Macbook Pro Touchpad: Synaptics Configuration in xorg.conf

I was trying to use touchpad on Macbook Pro (4,1) in Debian 5.0 (Lenny).
By default, it does not have tapping support, and multitouch support.
Even touchpad driver was also unavailable. Therefore, I had compiled
Linux kernel 2.6.29.3 added support for Apple Macbook Touchpad Driver.
Then after booting in new kernel with NVIDIA 8600 GT driver, I have
modified the xorg.conf with following lines.

## In case, you want to revert
$ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bk
$ sudo vi /etc/X11/xorg.conf



...
Section "ServerLayout"
Identifier "Layout0"
...
# Add Synaptics Touchpad as mouse
InputDevice "Synaptics Touchpad" "SendCoreEvents" #"CorePointer"
InputDevice "Mouse0" "CorePointer"
EndSection

...

Section "Module"
...
# Load synaptics driver for Macbook Pro Touchpad
Load "synaptics"
EndSection

...

Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/mouse0"
Option "Protocol" "auto-dev"
# not using edge scrolling
Option "HorizEdgeScroll" "0"
Option "VertEdgeScroll" "0"

# use two finger scrolling
Option "VertTwoFingerScroll" "1"
Option "HorizTwoFingerScroll" "1" # set to 0 if you don't want horizontal scrolling

# scroll speed, lower is faster
Option "HorizScrollDelta" "15"
Option "VertScrollDelta" "15"

# minimum pressure motion factor
Option "PressureMotionMinZ" "10"

# touch and untouch thresholds, higher numbers if you like to push hard
Option "FingerLow" "20"
Option "FingerHigh" "60" # change to 30 or 40 if you like

# FingerPress (Integer) : Above which counts as press
Option "FingerPress" "130"

# borders based on output from synclient
Option "LeftEdge" "70"
Option "RightEdge" "1120"
Option "TopEdge" "50"
Option "BottomEdge" "750"

# speeds, smaller number for a slower mouse
Option "MinSpeed" "0.8" # 0.5 is very slow, 1.5 is very fast
Option "MaxSpeed" "1.3" # up to 1.5 works ok
Option "AccelFactor" "0.10"

# tap times, change to suit your tapping habits
Option "MaxTapMove" "100"
Option "MaxTapTime" "100"
Option "MaxDoubleTapTime" "200"

# don't change these or two finger tap stops working
Option "TapButton2" "3"
Option "TapButton3" "2"

# must be commented out or normal tapping wont work
#Option "TapButton1" "0"

# Right Top Corner Button as right click
Option "RTCornerButton" "2"
Option "RBCornerButton" "0"

# Left Top Corner Button as middle click
Option "LTCornerButton" "3"
Option "LBCornerButton" "0"

# Palm Detection: Useful while typing
Option "PalmDetect" "on"
Option "PalmMinWidth" "10"
Option "PalmMinZ" "200"

# needed for disabled while typing fix
Option "SHMConfig" "on"
EndSection
...



Wednesday, July 23, 2008

Installing Linux (Fedora 8) on Macbook Pro

I was trying to install Linux on Macbook Pro along with Mac OS X, because
it has Intel Processor, Intel chipset on Motherboard
and Nvidia 8600 GT graphics card. I followed steps
given in Debian Wiki (Mainly upto rEFIt part) and
in Mactel (for remaining part).

I would like to suggest some tips regarding installation of
Fedora 8 along with Mac OS X on Macbook Pro.

  1. Audio: Download the latest Linux kernel and compile it with Intel HD Audio drivers 82801H (ICH8 Family).
  2. Video: Boot into new kernel, and install NVidia driver, restart X server by logging out and logging in.
  3. Keyboard: Download pomme daemon, Compile and install it. Now Optical Drive Eject button will work.
  4. Backlight: Even after installing pommed, I was seeing very bright screen. I was not able to stare at screen for more than a minute. Later, after some tweaking of /etc/pommed.conf , I was able to decrease the backlit. I changed init = -1 to init = 1, as shown below:
# nVidia GeForce 8600M GT backlight control (MacBook Pro v3 & v4)
lcd_nv8600mgt {
# initial backlight level [12] (0 - 15, -1 to disable)
init = 1
# step value (1 - 2)
step = 1
# backlight level when on battery [6] (1 - 15, 0 to disable)
on_batt = 6
}

PS: Everything else should work as given in Mactel site. Feel free to write
comments. If you have any doubt, mail me at mitesh[dot]singh[dot]jat[at]gmail[dot]com