Blog Archive

Monday, May 31, 2010

Move the Minimize Maximize Close buttons to the Right in Lucid Lynx

I am using Ubuntu 10.04 Lucid Lynx in my PC. The Ubuntu Design Team has decided to move the Minimize, Maximize and Close buttons to the left of the title bar. Not exactly like Mac OS X, which looks like the following:

Close,  Maximize, Minimize in Mac OS X

Close, Maximize, Minimize in Mac OS X

while Ubuntu button layout is as follows:

Maximize,  Minimize, Close in Ubuntu Lucid

Maximize, Minimize, Close in Ubuntu Lucid

The difference is the order in which they appear.

UPDATE April 2: The button order in Lucid will now follow Mac OS X style.

The head of Ubuntu Design Team does not give out any particular reasons for that and Mark Shuttleworth says he wants to use the right part for something else, probably in the 10.10 release.

I agree that moving that to the right might have some benefits as it takes less mouse movement to get there rather than the right side, but I am always looking for one of those on the right side, because of my habit. So, I decided to move it to the right for now, but I may consider switching to the left to see how it works for me.

To move it back to the right, you will need to launch Configuration Editor (Alt+F2 and type in gconf-editor) and then navigate to apps>metacity>general. Look for button_layout on the right hand pane and double click on it to edit it. You should change it from

maximize,minimize,close:

to

menu:minimize,maximize,close

. This should do it.

Alternately, this can also be done by executing the following command from the terminal or from the Run Application Dialog (Alt+F2):

gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close

Sunday, May 30, 2010

Configure Pidgin for google application email

Once you download Pidgin, you'll need to configure your client to connect to the Google Talk service.

To configure your account:

  1. Open Pidgin.
  2. Select Add.



  3. Enter the following information in the Add Account window:

    • Protocol: XMPP
    • Screen Name: your Google Talk username (without any @ symbol or domain).
    • Server: Enter the portion of your email address after the @ symbol. For example, gordon@example.com will enter example.com as the server value. (If you're not a Google Apps for Your Domain user, please visit the Google Talk Help Center for instructions.)
    • Password: we suggest leaving this field blank for increased security, but if you'd like to log in automatically, enter your password
    • Local Alias: leave this field blank
    • Remember password: check the box if you'd like Pidgin to remember your password (you won't be prompted to enter it each time you log in, if you select this option)
    • New mail notifications: check the box if you'd like Pidgin to notify you of unread email in your inbox.



  4. Click on 'Advanced' tab and enter 'talk.google.com' in the Connect Server box.
  5. Uncheck  "Require SSL/TLS encryption" .
  6. Click Save.
You're now ready to connect to the Google Talk service using Pidgin.

A little modification from source:http://www.google.com/support/a/bin/answer.py?hl=en&answer=49147

Remake sources.list file

If you lost your "/etc/apt/sources.list" file
You can generate the file using following website
http://repogen.simplylinux.ch/

Friday, May 28, 2010

Upgade ubuntu using Alternate CD

Upgrade To Ubuntu 10.04 Lucid Lynx (or any new version)Without An Internet Connection

Well, if you don't have an Internet connection, you can still upgrade to Ubuntu 10.04 Lucid Lynx, but you'll need to download the Ubuntu 10.04 Lucid Lynx alternate CD somehow. You can download the Ubuntu Alternate ISO from HERE.


Then, you can then either write the Ubuntu 10.04 Lucid Lynx Alternate ISO onto a CD or simply mount the ISO image using the following command:

 $ sudo mount -o loop ubuntu-10.04-alternate-i386.iso /media/cdrom0 
Give exact path to "ubuntu-10.04-alternate-i386.iso" if your are not in the directory where you have saved the alternate cd image.
Once you insert the CD or mount the ISO image, a dialog should pop up offering you the option to upgrade using that CD / ISO image.


If of any reason the pop up doesn't come, you can start the upgrade manually by typing the command below.

 $ gksu "sh /cdrom/cdromupgrade" 

Share blogger posts on Facebook

Some questions of How do I share my blogger posts on Facebook ? , look my news article here:

Here's ,how make share button on your blogspot posts ,like appear at this blog . which will be good for readers to share your posts on Facebook, such as Digg button.

Oke, go to blogger dashboard -Edit HTML -Check Expand Widget - and find the code below:
<b:if cond='data:top.showAuthor'>

Place following code before the code above

<b:if cond='data:post.url'>
<a expr:href='&quot;http://www.facebook.com/share.php?u=&quot; + data:post.url'><img alt='www.tips-fb.com' border='0' src='http://i15.photobucket.com/albums/a398/syilpid/share_on_facebook_2.png'/></a>
</b:if>

The code above will appear be like this button:



If you want to using another button , can use these code below :

Cara memasang facebook di blog

<b:if cond='data:post.url'>
<a expr:href='&quot;http://www.facebook.com/share.php?u=&quot; + data:post.url'><img src="http://i15.photobucket.com/albums/a398/syilpid/share_on_facebook_4.png" border="0" alt="www.tips-fb.com"></a>
</b:if>




<b:if cond='data:post.url'>
<a expr:href='&quot;http://www.facebook.com/share.php?u=&quot; + data:post.url'><img src="http://i15.photobucket.com/albums/a398/syilpid/share_on_facebook_3.png" border="0" alt="www.tips-fb.com"></a>
</b:if>

Or use your own text , for example : "Share On Facebook"

<b:if cond='data:post.url'>
<a expr:href='&quot;http://www.facebook.com/share.php?u=&quot; + data:post.url'>Share on Facebook</a>
</b:if>

End...

Wednesday, May 26, 2010

Solve wired network not managed karmic koala

On Ubunty 9.10 (Karmic Koala), if clicking the Network Manager applet displaysdevice not managed, here is the instruction to enable it:
  1. Edit /etc/NetworkManager/nm-system-settings.conf and setmanaged=true. It should be:
    1[ifupdown]
    2managed=true
  2. Restart both networking and network-manager services. Or restarting the computer works too.
    1sudo /etc/init.d/network-manager restart
    2sudo /etc/init.d/networking restart


unattended download using wget

Here is quick tip, if you wish to perform an unattended download of large files such as Linux DVD ISO use wget as follows:

wget -bqc http://path.com/url.iso

Where,

=> -b : Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.

=> -q : Turn off Wget's output aka save disk space.

=> -c : Resume broken download i.e. continue getting a partially-downloaded file. This is useful when you want to finish up a download started by a previous instance of Wget, or by another program.

This tip will save your time while downloading large ISO image from the internet.

Monday, May 17, 2010

Recover Ubuntu Linux after windows XP wipes MBR

Recovering Ubuntu after Windows wipes Grub2 boot loader

The below blog makes possible to install XP after Ubuntu linux.First installl XP normally in empty drive. Windows wipes MBR of Ubuntu and boot loader Grub.You just need ubuntu live CD Karmic Koala 9.10 or above

Recover Grub 2 via LiveCD

  • First, grab a copy of the latest Ubuntu LiveCD and boot it.

  • Open a terminal and type

$ sudo fdisk -l

  • Now, you need to remember which device listed is your linux distribution, for reference, /dev/sda1 will be used. Now we need to mount the filesystem to /mnt

$ sudo mount /dev/sda1 /mnt

  • If you have /boot on a separate partition, that need's to be mounted aswell. For reference, /dev/sda2 will be used.

$ sudo mount /dev/sda2 /mnt/boot Make sure you don't mix these up, pay attention to the output of FDISK

  • Now mount the rest of your devices and some other things needed in the chroot

$ sudo mount --bind /dev /mnt/dev
$ sudo mount --bind /proc /mnt/proc
$ sudo mount --bind /sys /mnt/sys

  • Now chroot into your system

$ sudo chroot /mnt

You should be chroot'd into your system as root, you can now run commands as root, without the need for sudo.

  • Now you need to edit the /etc/default/grub file to fit your system

$ nano /etc/default/grub

  • When that is done you need to run update-grub to create the configuration file. If you have a separate /boot partition you need to mount it first!

$ update-grub

  • To install GRUB 2 to the MBR, next you need to run grub-install /dev/sda

$ grub-install /dev/sda

  • If you encounter any errors, try grub-install --recheck /dev/sda

$ grub-install --recheck /dev/sda

  • Press Ctrl+D to exit out of the chroot.
  • Once you exit back to your regular console, undo all the mounting, first the /dev and others

$ sudo umount /mnt/dev
$ sudo umount /mnt/sys
$ sudo umount /mnt/proc

  • Now you can unmount the root system. (But if you have a separate boot partition which you mounted earlier, you have to unmount this first, or you will get a "device busy" error message.)

$ sudo umount /mnt

  • And you should be free to restart your system right into GRUB 2 and then into your system installation.
If you had alternate OS entries, update-grub might say "Cannot find list of partitions!". Ignore it and continue - once you can boot into your linux installation, do so and then rerun update-grub and grub-install /dev/sda as root.

Wednesday, May 12, 2010

Disable auto login network share folders

Step 1:
Disconnect network folders In Run type net use * /d  It disconnects all the network shares
Step 2:
In Run type control userpasswords2
in the next window go to the second tab on top, named: Advanced
and from there open: Manage Passwords
There you should see if there is a password stored for the address that you have mentioned
If yes then delete it and close the windows with OK
try to connect again to that address, it should prompt for authentication.
Do not check the Remember option...

A short cut to this step

start >run > rundll32.exe keymgr.dll, KRShowKeyMgr
and delete saved password

Make samba share without password

How to set samba to allow read-only file sharing for your LAN computers as guest ? (without be prompted for a password).Because users won't be prompted for a user/password, this is meant to be installed in a LAN where all host are to be trusted.
Smoothen samba default security by changing the security variable: security and make sure it is set to share instead of user and that guest account is enabled

open and edit /etc/samba/smb.conf

security = share
...
...
guest account = nobody

Now, we can create a share to be accessible to guest users:

[Guest Share]
comment = Guest access share
path = /path/to/dir/to/share
browseable = yes
read only = yes
guest ok = yes

You can now test that your configuration is good using testparm:

$ testparm

If everything is fine, it is time to reload samba service to have your new configuration taken into account:

$sudo /etc/init.d/samba reload

That's it, anybody in your LAN can now access your share.




Tuesday, May 11, 2010

IP to host name and mac resolution

Just use below command

NBTSTAT -A IPADDRESS

shows mac address and hostname

More about Nbtstat

Nbtstat is designed to help troubleshoot NetBIOS name resolution problems. When a network is functioning normally, NetBIOS over TCP/IP (NetBT) resolves NetBIOS names to IP addresses. It does this through several options for NetBIOS name resolution, including local cache lookup, WINS server query, broadcast, LMHOSTS lookup, Hosts lookup, and DNS server query.

The nbtstat command removes and corrects preloaded entries using a number of case-sensitive switches. The nbtstat - a < name > command performs a NetBIOS adapter status command on the computer name specified by < name> . The adapter status command returns the local NetBIOS name table for that computer as well as the MAC address of the adapter card. The nbtstat -A < IP address > command performs the same function using a target IP address rather than a name.

The nbtstat - c option shows the contents of the NetBIOS name cache, which contains NetBIOS name-to-IP address mappings.

nbtstat -n displays the names that have been registered locally on the system by NetBIOS applications such as the server and redirector.

The nbtstat -r command displays the count of all NetBIOS names resolved by broadcast and by querying a WINS server. The nbtstat -R command purges the name cache and reloads all #PRE entries from the LMHOSTS file. #PRE entries are the LMHOSTS name entries that are preloaded into the cache. For more information about the LMHOSTS file, see the appendix "LMHOSTS Files" in this book.

Nbtstat -RR sends name release packets to the WINS server and starts a refresh, thus re-registering all names with the name server without having to reboot. This is a new option in Windows NT 4.0 with Service Pack 4 as well as in Windows 2000.

You can use nbtstat -S to list the current NetBIOS sessions and their status, including statistics. Sample output looks like this:

C:\>nbtstat -S

Local Area Connection:

Node IpAddress: [172.16.0.142] Scope Id: []

NetBIOS Connection Table

Local Name State In/Out Remote Host Input Output

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

TESTPC1 <00> Connected Out 172.16.210.25 6MB 5MB

TESTPC1 <00> Connected Out 172.16.3.1 108KB 116KB

TESTPC1 <00> Connected Out 172.16.3.20 299KB 19KB

TESTPC1 <00> Connected Out 172.16.3.4 324KB 19KB

TESTPC1 <03> Listening

Finally, nbtstat -s provides a similar set of session listings, but provides the remote computer names, rather than their IP addresses.

note-icon Note

The options for the Nbtstat command are case sensitive.

The Nbtstat switches are listed in Table 3.4.

Table 3.4 Nbtstat Switches

Switch

Name

Function

-a < name >

adapter status

Returns the NetBIOS name table and MAC address of the address card for the computer name specified.

-A < IP address >

Adapter status

Lists the same information as -a when given the target's IP address.

-c

cache

Lists the contents of the NetBIOS name cache.

[ Number ]

Interval

Typing a numerical value tells Nbtstat to redisplay selected statistics each interval seconds, pausing between each display. Press Ctrl+C to stop redisplaying statistics.

-n

names

Displays the names registered locally by NetBIOS applications such as the server and redirector.

-r

resolved

Displays a count of all names resolved by broadcast or WINS server.

-R

Reload

Purges the name cache and reloads all #PRE entries from LMHOSTS.

-RR

ReleaseRefresh

Releases and reregisters all names with the name server.

-s

sessions

Lists the NetBIOS sessions table converting destination IP addresses to computer NetBIOS names.

-S

Sessions

Lists the current NetBIOS sessions and their status, with the IP address.

/?

Help

Displays this list.


change user's home directory

To change the user's home directory, just use the 'usermod' command, which exists on all unices.
It works like this:
usermod -d /path/to/new/homedir/ username

Monday, May 10, 2010

add a user to the sudoers list

How to add a user to the sudoers list? Beleive it or not, this is a fairly common question and in all reality the answer is quite simple. Adding a user to the sudoers list on a fully installed Linux system such as Debian is only possible via the command visudo. Users in the sudoers list are allowed the privileges to run commands and open files as the root user. In the following quick tutorial, we will show you how adding a new sudoer is quickly done.

How to add a user to the sudoers list:

  1. Open a Root Terminal and type visudo (to access and edit the list)
  2. Using the up/down arrows, navigate to the bottom of the sudoers file that is now displayed in the terminal
  3. Just under the line that looks like the following:
  4. root ALL=(ALL) ALL

  5. Add the following (replacing user with your actual username):
  6. user ALL=(ALL) ALL

  7. Now press Ctrl+X and press Y when promted to save

That's it, your new user now has root privileges!

Example Sudoers Screenshot:

Adding a new sudoer

Restart GNOME without rebooting the computer

  • Save and close all open applications.

  • Use the Ctrl-Alt-Backspace shortcut keys to restart GNOME.

  • If Ctrl-Alt-Backspace is disabled, type

    sudo /etc/init.d/gdm restart

Wednesday, May 5, 2010

start program automatically in Debian

Starting programs automatically at startup in Gnome

Gnome Logo

There are some applications we always start as soon as we log into our Linux, as Firefox or our news reader.

If you want you can ask Linux to start these programs for you as soon as you log in, to do this just go to:

System->Preferences->Sessions in you Gnome menu.

Gnome Sessions screen shot

Now click on Add, and fill in the fields the appropriate info, so you can start you new application.

Gnome Sessions screen shot

Put in name the name of the application, in command the command you need to start that applications (better if you use the complete path) you can use the command which to know where an application is.

in this case I used

which firefox

Then fill in comment anything that will describe to you, what that command is going to do.

You can start as many applications as you want, but of course this will slow down your Linux boot up.

Assigning multiple IP address in debian

/etc/network/interfaces file contains network interface configuration information for the both Ubuntu and Debian Linux. This is where you configure how your system is connected to the network.

Defining physical interfaces such as eth0

Lines beginning with the word "auto" are used to identify the physical interfaces to be brought up when ifup is run with the -a option. (This option is used by the system boot scripts.) Physical interface names should follow the word "auto" on the same line. There can be multiple "auto" stanzas. ifup brings the named inter faces up in the order listed. For example following example setup eth0 (first network interface card) with 192.168.1.5 IP address and gateway (router) to 192.168.1.254:
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254

Setup interface to dhcp

To setup eth0 to dhcp, enter:
auto eth0
iface eth0 inet dhcp

Assigining Multiple IP address in Debian

Edit the file that Fedora places the interface info in, in Debian it's located in /etc/networking/interfaces.

auto eth0
iface eth0 inet static
address 192.168.1.20
netmask 255.255.255.0
gateway 192.168.1.1

auto eth0:0
iface eth0:0 inet static <---next interface in eth0
address 192.168.10.21 <--- can not be the same as any other IP
netmask 255.255.255.0
gateway 192.168.10.1

Following is file located at /usr/share/doc/ifupdown/examples/network-interfaces, use this file as reference (don't forget interfaces man pages for more help):

######################################################################
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
#
# A "#" character in the very first column makes the rest of the line
# be ignored. Blank lines are ignored. Lines may be indented freely.
# A "\" character at the very end of the line indicates the next line
# should be treated as a continuation of the current one.
#
# The "pre-up", "up", "down" and "post-down" options are valid for all
# interfaces, and may be specified multiple times. All other options
# may only be specified once.
#
# See the interfaces(5) manpage for information on what options are
# available.
######################################################################

# We always want the loopback interface.
#
# auto lo
# iface lo inet loopback

# An example ethernet card setup: (broadcast and gateway are optional)
#
# auto eth0
# iface eth0 inet static
# address 192.168.0.42
# network 192.168.0.0
# netmask 255.255.255.0
# broadcast 192.168.0.255
# gateway 192.168.0.1

# A more complicated ethernet setup, with a less common netmask, and a downright
# weird broadcast address: (the "up" lines are executed verbatim when the
# interface is brought up, the "down" lines when it's brought down)
#
# auto eth0
# iface eth0 inet static
# address 192.168.1.42
# network 192.168.1.0
# netmask 255.255.255.128
# broadcast 192.168.1.0
# up route add -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.2
# up route add default gw 192.168.1.200
# down route del default gw 192.168.1.200
# down route del -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.2

# A more complicated ethernet setup with a single ethernet card with
# two interfaces.
# Note: This happens to work since ifconfig handles it that way, not because
# ifup/down handles the ':' any differently.
# Warning: There is a known bug if you do this, since the state will not
# be properly defined if you try to 'ifdown eth0' when both interfaces
# are up. The ifconfig program will not remove eth0 but it will be
# removed from the interfaces state so you will see it up until you execute:
# 'ifdown eth0:1 ; ifup eth0; ifdown eth0'
# BTW, this is "bug" #193679 (it's not really a bug, it's more of a
# limitation)
#
# auto eth0 eth0:1
# iface eth0 inet static
# address 192.168.0.100
# network 192.168.0.0
# netmask 255.255.255.0
# broadcast 192.168.0.255
# gateway 192.168.0.1
# iface eth0:1 inet static
# address 192.168.0.200
# network 192.168.0.0
# netmask 255.255.255.0

# "pre-up" and "post-down" commands are also available. In addition, the
# exit status of these commands are checked, and if any fail, configuration
# (or deconfiguration) is aborted. So:
#
# auto eth0
# iface eth0 inet dhcp
# pre-up [ -f /etc/network/local-network-ok ]
#
# will allow you to only have eth0 brought up when the file
# /etc/network/local-network-ok exists.

# Two ethernet interfaces, one connected to a trusted LAN, the other to
# the untrusted Internet. If their MAC addresses get swapped (because an
# updated kernel uses a different order when probing for network cards,
# say), then they don't get brought up at all.
#
# auto eth0 eth1
# iface eth0 inet static
# address 192.168.42.1
# netmask 255.255.255.0
# pre-up /path/to/check-mac-address.sh eth0 11:22:33:44:55:66
# pre-up /usr/local/sbin/enable-masq
# iface eth1 inet dhcp
# pre-up /path/to/check-mac-address.sh eth1 AA:BB:CC:DD:EE:FF
# pre-up /usr/local/sbin/firewall

# Two ethernet interfaces, one connected to a trusted LAN, the other to
# the untrusted Internet, identified by MAC address rather than interface
# name:
#
# auto eth0 eth1
# mapping eth0 eth1
# script /path/to/get-mac-address.sh
# map 11:22:33:44:55:66 lan
# map AA:BB:CC:DD:EE:FF internet
# iface lan inet static
# address 192.168.42.1
# netmask 255.255.255.0
# pre-up /usr/local/sbin/enable-masq $IFACE
# iface internet inet dhcp
# pre-up /usr/local/sbin/firewall $IFACE

# A PCMCIA interface for a laptop that is used in different locations:
# (note the lack of an "auto" line for any of these)
#
# mapping eth0
# script /path/to/pcmcia-compat.sh
# map home,*,*,* home
# map work,*,*,00:11:22:33:44:55 work-wireless
# map work,*,*,01:12:23:34:45:50 work-static
#
# iface home inet dhcp
# iface work-wireless bootp
# iface work-static static
# address 10.15.43.23
# netmask 255.255.255.0
# gateway 10.15.43.1
#
# Note, this won't work unless you specifically change the file
# /etc/pcmcia/network to look more like:
#
# if [ -r ./shared ] ; then . ./shared ; else . /etc/pcmcia/shared ; fi
# get_info $DEVICE
# case "$ACTION" in
# 'start')
# /sbin/ifup $DEVICE
# ;;
# 'stop')
# /sbin/ifdown $DEVICE
# ;;
# esac
# exit 0

# An alternate way of doing the same thing: (in this case identifying
# where the laptop is is done by configuring the interface as various
# options, and seeing if a computer that is known to be on each particular
# network will respond to pings. The various numbers here need to be chosen
# with a great deal of care.)
#
# mapping eth0
# script /path/to/ping-places.sh
# map 192.168.42.254/24 192.168.42.1 home
# map 10.15.43.254/24 10.15.43.1 work-wireless
# map 10.15.43.23/24 10.15.43.1 work-static
#
# iface home inet dhcp
# iface work-wireless bootp
# iface work-static static
# address 10.15.43.23
# netmask 255.255.255.0
# gateway 10.15.43.1
#
# Note that the ping-places script requires the iproute package installed,
# and the same changes to /etc/pcmcia/network are required for this as for
# the previous example.

# Set up an interface to read all the traffic on the network. This
# configuration can be useful to setup Network Intrusion Detection
# sensors in 'stealth'-type configuration. This prevents the NIDS
# system to be a direct target in a hostile network since they have
# no IP address on the network. Notice, however, that there have been
# known bugs over time in sensors part of NIDS (for example see
# DSA-297 related to Snort) and remote buffer overflows might even be
# triggered by network packet processing.
#
# auto eth0
# iface eth0 inet manual
# up ifconfig $IFACE 0.0.0.0 up
# up ip link set $IFACE promisc on
# down ip link set $IFACE promisc off
# down ifconfig $IFACE down

# Set up an interface which will not be allocated an IP address by
# ifupdown but will be configured through external programs. This
# can be useful to setup interfaces configured through other programs,
# like, for example, PPPOE scripts.
#
# auto eth0
# iface eth0 inet manual
# up ifconfig $IFACE 0.0.0.0 up
# up /usr/local/bin/myconfigscript
# down ifconfig $IFACE down


Followers