Home arrow Aaj Ka Tip
Main Menu
Help Docs
Gnu/Linux Distros
Aaj Ka Tip
Aaj Ka Command
Free Software

Aaj Ka Tip
Code reuse Print E-mail

Why write code that we already wrote for previous programs? Well here is a small tip that might save you
some time: Make a generic file with reusable functions.
Many languages make this easy to do. Object oriented languages like Java or C++ for example allow you to
make a class with utility functions, and then import them in your main program. This way you can use the
generic class in all your programs. Even in C you can do this by including the generic C file when compiling
with a command like:
gcc -o myprogram myprogram.c generic.c
Your generic utility functions would be in generic.c and gcc would simply add the file to myprogram.
Domains to search in Print E-mail

When you try to access a Web site, or any remote site, you need to specify the full hostname. This means the
machine name plus the domain name:
lynx my.yahoo.com
If you have a few domain names that you access a lot, you can make your life easier. You can edit
/etc/resolv.conf and add the domains there:
search domain.net yahoo.com
This means that the system will search in those domains for hostnames. From now on type:
lynx my
The system will now look for "my", if that hostname doesn't exist it will look for "my.domain.net", and at
last "my.yahoo.com".
Internet for your LAN Print E-mail
Internet for your LAN

Many companies have local networks, and it is becoming even more popular in homes, where 2 or 3 systems
are linked together using ethernet wires. Most providers only offer 1 IP address per connection, which means
that you can't put all of the systems on the Internet at the same time, unless you use a special gateway.
Linux comes with something called IP-Masquerade. With it, you can assign LAN IPs, which are IPs that
can't go on the Internet directly, and then use the Linux system as a gateway. All you need to implement this
is a Linux system with 2 ethernet cards, and an Internet connection. The Linux system has IP-Masquerade
enabled, and the LAN systems will have access to the Internet using the Linux gateway as a transparant proxy
You can find more on the subject by reading the IP-Masq HOWTO and other networking documentation at
http://metalab.unc.edu/pub/Linux/docs. You also need to make sure your Internet provider accepts this kind
of network on their connection.
Take Backp of MBR Print E-mail
MBR is in the first 446 bytes of the Hard Drive
The next 66 bytes consists of the partiton table

to take backup of the MBR to a file /root/hda_mbr

dd  if=/dev/hda  of=/root/hda_mbr  bs=446  count=1

to replace with the backed up MBR,In case ypu deleted the MBR

dd  if=/root/hda_mbr  of=/dev/hda  bs=446  count=1

bs=byte size
rpm--->tgz in slackware Print E-mail
To convert rpm packages to tgz in slackware


rpm2tgz package.rpm

this will create the tgz packages

<< Start < Previous 1 2 3 4 5 6 7 8 9 10 Next > End >>

Results 64 - 72 of 110

Join Us
About Us
Contact Us
Support Us
Login(only for dev.)

Royalty Free Images

O'Reilly User Group discount!

Powered By GIMP GIMP
Contact Webmaster Copyleft 2011 gnulinuxclub.org