In this short post I will show you how you can quickly add a range of IPs on any RedHat based system (Rhel, Centos, Fedora, etc). When you have to add many IPs to a system this can be quite handy and save a lot of time.
Normally when you add a new IP to a network interface in a RedHat based system you create a file ifcfg-eth0:x in /etc/sysconfig/network-scripts/. For example:/etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.100
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
TYPE=Ethernet
Similar to the above example you can create several aliases. But what if you have to add a lot of IPs that are in a range like this? Let’s say that I want to add 100 IPs this way… this is possible, but not very effective, right? RedHat based systems offer a method to bind a range of IPs in a quick way allowing us to eliminate the need to create a lot of files and saving us time doing this.
Create a file /etc/sysconfig/network-scripts/ifcfg-eth0-range0 if this doesn’t exist, or just add to it if you already have it, the following lines:
/etc/sysconfig/network-scripts/ifcfg-eth0-range0
IPADDR_START=192.168.0.100
IPADDR_END=192.168.0.200
CLONENUM_START=0
where: IPADDR_START is the first IP and IPADDR_END is the last IP in the range. CLONENUM_START is the number that will be assigned to the first IP alias interface (eth0:0 in this example).
If you need to add more ranges of IPs then just use a different file for ex. ifcfg-eth0-range1, for each one of the ranges. You need to be careful and use the proper CLONENUM_START to not overwrite other aliases. Once you have configured the range/s of IPs you just need to restart the network service in order to activate it:
service network restart
Note: don’t use this method on a CPanel based system. Even though this will work fine, it is better to use CPanel/WHM in this case so CPanel can manage all the IPs properly. Here is a short post on how you can do the same thing ‘CPanel way’.
Jumat, 27 Juli 2007
Linux Tips: How to quickly bind a range of IPs on RedHat based systems
Diposting oleh Moh. Johan Rajabi di 06.06 0 komentar
Label: Linux
Senin, 09 Juli 2007
Rumor Alert: New ‘PSP2′ arriving right after E3?
Evenin’ ladies and gents, Frozencry here. I’d like to inform you all of some ‘info’ I’ve stumbled upon from a very big gaming retailer which I will not name. It relates to the rumoured new PSP in the works. In fact, it looks like some damned solid evidence that the PSP2 is not only a reality, but it should be arriving VERY soon; as in, sometime right after E3.
The info came about when the retailer I work for was low in stock for PSP units. So curiously, we inquired about it to our Head Office, and our answer? It went something along the lines of “There will be no more issues of the PSP, as we are currently awaiting for restock of a new PSP model.” Now, If that isn’t some damned solid proof that a new ‘PSP2′ is in the works, I don’t know what is.
Nonetheless, we shall see in a few days, as the behemoth that is E3 is almost upon us. Let the rumours and speculations and all that mumbo jumbo begin.
Source : http://neogamer.net/2007/07/08/rumor-alert-new-psp2-arriving-right-after-e3/
Diposting oleh Moh. Johan Rajabi di 04.53 0 komentar
Label: Game Console, Hardware
Installing VMware Tools in Fedora Core 6
# Install software called by by VMware Tools
yum install gcc
# Install kernel header files
yum install kernel-devel
# Check it matches the running kernel
uname -r # running kernel
rpm -q kernel-devel # installed kernel headers
# It the two versions do not match, run
yum -y upgrade kernel kernel-devel
# then reboot (but only if they did not match).
# Find out where the kernel headers are
ls -d /usr/src/kernels/$(uname -r)*/include
# You may need this later.
# If you already have VMwareTools-5.5.2-29772.tar.gz on disk, SKIP THIS STEP!
# Download VMware-workstation-5.5.2-29772.tar.gz from vmware.com
# Extract the VMware Tools iso from it
tar --strip-components=3 -zxvf VMware-workstation-5.5.2-29772.tar.gz
vmware-distrib/lib/isoimages/linux.iso
# Create a temporary mount point
mkdir /mnt/vmtools-temp
# Mount the image
mount -o loop linux.iso /mnt/vmtools-temp
# Copy VMware Tools from the mount
cp /mnt/vmtools-temp/VMwareTools-5.5.2-29772.tar.gz /tmp/
# Unmount the image and tidy up
umount /mnt/vmtools-temp
rmdir /mnt/vmtools-temp
rm linux.iso
# Unpack VMware Tools to a temporary directory
cd /tmp/
tar zxvf VMwareTools-5.5.2-29772.tar.gz
cd /tmp/vmware-tools-distrib/
./vmware-install.pl
# Do you want to run vmware-config-tools.pl? yes
# Fix xorg config
# If when you (re)start X, you get the error "Undefined Monitor "vmware"..":
vi /etc/X11/xorg.conf
# Add the lines
Section "Monitor"
Identifier "vmware"
EndSection
# To add better mouse support, add the lines
Section "InputDevice"
Identifier "Mouse0"
Driver "vmmouse"
Option "Protocol" "Auto"
Option "Device" "/dev/input/mouse0"
EndSection
# then find the "ServerLayout" section, and in that section, add the line
InputDevice "Mouse0" "CorePointer"
# TODO fix vmhgfs compile (currently broken)
# TODO fix fast ethernet driver compile (currently broken)
# TODO copy and paste broken
Diposting oleh Moh. Johan Rajabi di 00.35 0 komentar
Selasa, 03 Juli 2007
Options in OpenOffice.org Calc
By Bruce Byfield on Thu, 2007-06-28 15:30.
Like other OpenOffice.org applications, Calc has several dozen options in how it is formatted and operates. These options are available from Tools -> Options -> OpenOffice.org Calc. Thanks to OpenOffice.org's habit of sharing code between applications, some of the tabs for these options resemble those found in other OpenOffice.org applications. Others are unique to Calc and the business of spreadsheets. Either way, the more you know about Calc's options, the more you can take control of your work.
A survey of options
Several of the tabs in the Calc options are similar to the ones for other OpenOffice.org applications. The Grid tab sets options for a background grid, although, in Calc, you can often use cell borders instead for positioning objects like charts and graphics. Similarly, the Changes tab, where options are set for revision and multiple authoring, resembles the one in Writer in functionality, lacking only the accompanying illustrations. The Print tab may also be familiar, although under-populated with options, since spreadsheets are mainly online documents, and options for printing are contained in the Sheet tab for Calc page styles. However, one option that you may want to take note of is Print only selected sheets, which you can use by selecting Sheet tabs at the bottom of the editing window while pressing the Ctrl key.
The first place where most people will want to spend more time is the General tab. There, you can customize some of the basic behavior of Calc. Most people, I suspect, will want to set Calc to update links whenever they open a file unless they are using an older and slower computer. Conversely, few are likely to want to use printer metrics for text unless they have an older printer with embedded fonts that they choose to use or a printer that uses a non-standard formatting language. However, the options to expand formatting can be useful, and so can the option to expand references in formulas (that is, to automatically update them) when new rows or columns are added -- especially in spreadsheets that are constantly being altered or edited.
Options to highlight the headers of selected rows and columns and to show a warning when pasting data are enabled by default in most versions of OpenOffice.org, and should probably be left untouched when they are. But it's probably up to your work habits whether you customize how the cell selected shifts when you press the Enter key, or whether you use the Enter key to enter Calc's edit mode.
The next stop for most should be the View tab. One of its most practical uses is speeding up redraws and file opening on older computers by suppressing the display of different objects. Other options on the View tab are largely customizations. For instance, you might choose to go to the Window pane of the tab to turn off various widgets in the editing window, or to change the default color of cell borders or the size of the handles for manipulating selected objects. You can also choose whether zero values are displayed, or an indicator for notes. Long-time spreadsheet users have the option of having cell content that takes up more space than the cell's dimension display on top of adjacent cells -- although, with Calc's options for line wrap, there is really no need to endure this anachronism unless you like it.
Perhaps the most practical option on the View tab is Display -> Value highlighting, which changes the color of cell borders according to color. When this option is active, text cells are outline in black, numerical cells in blues, and cells with formulas or dates in green. And if you like value highlighting, you will almost certainly want to be sure that Show references in color is also selected, so that the cells that provide input into a formula are highlighted when the formula is selected -- although you can get the same effect only when desired by choosing Tool -> Detective.
Sort Lists is a less commonly used tab, but it can be a powerful one if you go to the trouble of customizing it. A sort list is a reoccurring pattern of cell contents, such as the days of the week or the months in the year (the default entries are for both, either in three letter abbreviations or with full names). You can add your own sort lists to the defaults, such as the names of people whose names will reoccur in a task list, or a pattern of numbers, such as counting by threes. If you type any item on the list, then drag vertically or horizontally on the lower right corner of the cell, you can immediately fill adjacent cells with other items in the list, repeating the items in the same order as often as necessary. Alternatively, when you select Data -> Sort, you can select a sort list as a custom sort order on the Options tab of the Sort window, the feature that gives sort lists their name.
All these options are potentially useful (at least to someone) but by far the most useful option tab for Calc users is Calculations -- calculations, after all, being what spreadsheets are mainly about. On this tab, you can set the default date format, as well as the number of times an iterative formula is run. Other options set whether Calc is case-sensitive when dealing with text, and whether Calc attempts to identify row and column labels when dealing with ranges of data.
However, the options with the farthest reaching consequences on the Calculations tab are Decimal Places and Precision as shown. Both can strongly affect the results you get when using Calc. As the name implies, the Decimal Places option sets the number of decimal places displayed in formula results. What is potentially confusing is that formulas are calculated with the full values, but that Calc may only display results rounded to the number of decimal places set. The default of two decimal places is enough for most users, but, if you don't know the difference between the values used for calculation and those for display, you may get frustrated by the apparent inaccuracy. All you need to do, though, is to change the number of decimal places displayed to get more accurate results.
Under this arrangement, the Precision as shown option can either be a helpful simplification or else a source of further error. If the option is selected, then subsequent calculations will use the rounded values displayed, not the numbers actually used in the original calculation. Given several generations of formulas, the inaccuracy caused by this option can mount steadily. For this reason, no doubt, Precision as shown is turned off by default, so that spreadsheets maintain the difference between the displayed and actual numbers.
Conclusion
Many users, especially new ones, can ignore the options in Calc. Which ones are turned off by default may vary slightly depending on whether you download OpenOffice.org from the project itself or get it through your distribution, but, in all cases, the choice of options is generally sensible for the majority of users. However, if you want to customize Calc to suit your work habits, desire more efficiency, or simply need to track down the source of some unexpected Calc behavior, take the time to familiar yourself with them. You may find just the settings you need to make your life easier.
Bruce Byfield is a computer journalist who writes regularly for Datamation, Linux.com, and Linux Journal.
Diposting oleh Moh. Johan Rajabi di 23.06 0 komentar
Label: Linux
Linux from Kindergarten to High School
Source :
http://www.linuxjournal.com
As the bell rings to begin class at Greater Houlton Christian Academy, enthusiastic students sit down at their shiny, new computer workstations. In one corner, the red cabinet housing the server hums quietly as two stuffed penguins look on fondly from their perch. Other penguins keep watch from different locations as the students enter their user names and passwords to access their accounts. Ask a student who ``Tux'' is, and he or she will point to the large penguin painted on the front wall of the computer lab and say, ``He's the Linux penguin!'' About this time KDE has loaded, and young boys and girls are opening the application they need for class as easily as kicking a ball.
Figure 1. First graders learning some penguin art fundamentals.
Now for a little history. Greater Houlton Christian Academy (GHCA) is a private school and nonprofit organization in Maine. As such, it does not have the same access to funding as the public school system. As the computer science teacher and system administrator, this means I have to be creative about providing our students with computer technology while working with a tight budget. In the past I relied on area businesses and generous individuals to donate their used computers. While these donations were a great blessing to us, they were a temporary solution at best.
Last year it became quite evident that we would need to replace our old, secondhand computers running Windows 95. The decision to move from donated computers to new computers was based on many factors, though our primary goal was to make sure our students had the best technology available for the enhancement of their educational experience. Therefore, this would be a software upgrade as well as a hardware upgrade. In fact, choosing the software was by far the bigger challenge.
Interestingly enough, it was during this time that many schools in the western US were being audited by Microsoft concerning the school's use of Windows and Office software. I began to realize my ignorance concerning exactly how strict and inflexible the Microsoft EULA is. It was also during this time that Microsoft's new licensing initiative, called Software Assurance, was causing quite a stir in the tech headlines. As my research opened my eyes to the various limitations to proprietary software, I began to think that the answer for us might be found in open-source software.
The decision to switch to an open-source platform for our new computer lab was not an easy one. My experience was with DOS and various versions of Windows and not with UNIX-compatible operating systems. I had experimented with Linux a few years earlier but found it somewhat difficult and incomplete. Because some time had passed, I decided to give Linux another try. Going with Mandrake's 8.0 distribution, I installed Linux at home to see if it could replace Windows in a desktop environment. To my amazement, I found Linux to be much more capable this time around. I was one step closer to making my decision to switch our computer lab to the Linux OS.
Other factors went into the final decision to go with open-source software, not the least of which was cost. By purchasing bare-bones computer ``kits'', we were able to save considerable money on the hardware. Part of the savings in purchasing a bare-bones system is that the computer does not come with an operating system. We knew by then we would have to spend more money on software than we did on hardware if we went with Microsoft. Not only would I need to consider the initial purchase of the operating system and application software, but I would also need to factor in the costs of upgrading our software every couple of years. Needless to say, going with an open-source platform would save us considerable money now and in the future.
Another key issue was flexibility. As many of you know, it takes time to install an operating system, customize it for the particular hardware it runs on and install the desired applications. Having purchased 20 new, identical computers, it made sense to completely configure one machine and then clone the hard drive to the other 19 computers. However, Microsoft's EULA prevents a user from doing this, even if they have 20 copies of Windows. Not only would Linux save me considerable time by allowing me to clone my configured PC, it also gave me great flexibility in the degree to which I could customize the OS for the hardware. By recompiling the kernel to take advantage of our specific hardware, I could fine-tune the OS to run at peak performance. Linux would even save us money in the cloning process, thanks to the dd command.
A few aspects, however, made the decision to switch to Linux a difficult one. The smaller software base to choose from and the lack of mature drivers for our hardware were among the lesser obstacles. The major obstacle was my own lack of experience with the Linux OS. In fact, most of the money and time spent in the software upgrade of our computer lab was for a shelf full of books I had to purchase and read to really feel confident using and teaching Linux. It isn't always easy to teach an old dog new tricks, but I found the experience one of the most challenging and rewarding experiences of my IT career.
Today our private school of over 170 students has one of the finest computer labs in Maine. We have 20 computers with Athlon 1600+ XP processors, 128MB of RAM, 20GB hard drives and all the accessories--3-D graphics, sound, 17" monitors and 100Mbps Ethernet networking. Our computers run Mandrake Linux 8.2 with KDE 3.0.2. What is most amazing is we upgraded our computer lab for under half the cost of what many neighboring schools paid for inferior equipment. Most of this savings was the result of switching to Linux.
Our servers also run Linux. Using NFS, students can access their accounts from any computer in the lab. Student- and staff-owned files are backed up on a daily basis, so gone are the days of ``the computer lost my homework.'' Our proxy server runs Squid to help speed our wireless internet connection to 20 workstations, and we use proxy software along with iptables to provide firewall protection. A nice program called Dansguardian provides filtering to protect our children from pornography and other inappropriate content.
Many of you may be asking at this point, ``How do you use Linux in teaching your students?'' GHCA is a K-12 school, and so we strive to offer some level of computer training for each grade. Kindergarten students, for example, can use such programs as Potato Guy to practice hand-eye coordination and familiarize themselves with how to use a mouse to manipulate objects on the computer screen. Elementary and secondary teachers integrate the computer lab into their curriculum by using the computer for research, multimedia enhancements or even something simple as coloring digital pictures.
Starting with grade seven, education in computer science takes a more formal approach. Seventh graders are taught keyboarding skills using programs such as KTouch and TuxTyping. Grade-eight students are taught the basics of programming with the kate editor and yabasic interpreter. It is during this class that students gain a better understanding of how computers process instructions.
Computer Fundamentals is a one-credit course that introduces the ninth-grade student to ``how a computer works'' and ``how to work a computer''. During the second semester, students learn about the purpose and use of the operating system and various applications, such as word processors, spreadsheets and web browsers. Because our computers run Linux, it is the Linux OS and open-source software that students learn in this class. Being sensitive to the fact that Microsoft currently dominates the PC market in corporate America, I do spend time discussing the similarities and differences between Linux and Windows.
Tenth- through twelfth-grade students can chose from a variety of computer electives, including how to upgrade and repair computers, web site design, advanced programming and even an upcoming course in robotics. In making the switch to Linux, I easily found all the tools needed to teach these courses using open-source software. In many cases, the open-source software we now use is superior to the proprietary software originally donated to us.
This is our first year with our new computer lab, and I am very pleased with how it is progressing. One of the most pleasing experiences I am having as a system administrator of a Linux-based lab is the actual ease of administration. Once I set something up in Linux, I rarely need to worry about it again. This was not the case with Windows. Last year we were constantly suffering from system crashes, frozen servers, strange bugs and the infamous ``blue screen of death''. Needless to say, it was a frustrating situation for many students. While Linux is not bug-free, it has been a far more stable operating system for both our workstations and servers. Linux also has shown itself to be a much more versatile operating system to administer in a network environment. My job is more pleasurable thanks to our switch to Linux.
As a teacher of computer science, I am finding this year a fascinating test for Linux. Very few of our students, parents or teachers knew what Linux was before this year. I have actually found this to be a great advantage in teaching computers. In the past, I have found students to be disinterested in learning about the personal computer running Windows, because it is something most of them grew up with at home. This lack of interest made it more difficult to teach the more-advanced aspects of the operating system. However, Linux is something completely new, different and unexplored. Instead of being intimidated by the change, as many adults might be, young people are excited to explore the ``uncharted territory''. This opens a door for me as a teacher, allowing me to educate eager minds in the more-advanced aspects of computer operating systems and software. In fact, it only took two weeks until students began to ask me, ``Where can I get Linux?''
People sometimes ask me, ``Is teaching our students Linux preparing them for the workplace?'' This question is based on the fact that Microsoft is the current dominating presence in operating systems and office software. It is a question I have thought over a long time, and the answer I always come up with is, ``Yes, most definitely.'' The basic principles of any type of operating system, office application or other similarly grouped software are the same. A student who becomes proficient in Linux will not find themselves lost in a Windows environment. I have found Linux to be the more advanced of the two operating systems, yet our students are very quickly and easily learning it. The process of copying a file or formatting a paragraph is not so different between one operating system and the other. The important thing is we are able to offer the latest in hardware and software tools to train our students in these fundamental principles--something we could not do if we went with proprietary software.
Another question that may be even more important to ask is, ``What is the future of Linux?'' When our students graduate a few years from now, will they enter a Microsoft-dominated workplace or will the tide have changed? Even in our small New England town of Houlton, Maine, businesses are beginning to look to Linux as an alternative to proprietary operating systems. These businesses will need qualified personnel familiar with the Linux operating system and open-source applications. Greater Houlton Christian Academy will be graduating young men and women who will be able to meet that need, a claim not many schools in our nation can currently make. In fact, some of our students may go on to write the future applications for Linux, giving back to the community that helped them during their school years.
For us, switching to open-source software running on the Linux operating system has been the right choice, allowing us to provide our students with modern equipment and software for a fraction of the cost of a computer lab running proprietary software. If Linux continues to grow in popularity and gain a foothold in the workplace, we will look back at our choice as one of the most important decisions we've ever made.

Michael Surran is the system administrator and computer science teacher at Greater Houlton Christian Academy (www.ghca.com) in Northern Maine. Michael enjoys church, outdoor adventures, target shooting, sci-fi, collecting penguins and his wife, Lisa, who also teaches at GHCA.
email: computerlab@ghca.com
Read More..Diposting oleh Moh. Johan Rajabi di 23.00 0 komentar
Label: Linux
Squid proxy How to filter or block a particular port
. I am using Debian stable Linux version and squid proxy server for our small software company. I need to block a port number 1234. How to filter a particular port?
A. You can easily filter any port with squid ACL (Access Control List).
ACL is used for defining an access List. When using “file” the file should contain one item per line By default, regular expressions are CASE-SENSITIVE. To make them case-insensitive, use the -i option.
Procedure to block a port
First open /etc/squid/squid.conf file# vi /etc/squid/squid.conf
Locate your ACL section and add configuration directive as follows:acl block_port port 1234
http_access deny block_port
http_access allow all
If you just want to skip a particular IP (192.168.1.5) try as follows:acl block_port port 1234
acl no_block_port_ip src 192.168.1.5
http_access deny block_port !no_block_port_ip
http_access allow all
Close and save the file.
Restart squid proxy server:# /etc/init.d/squid restart
Diposting oleh Moh. Johan Rajabi di 18.43 0 komentar
Label: PROXY
Restrict ssh access using Iptable
Linux iptables firewall can be use to block or restrict access to ssh server. Iptables command is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel. However, you can also use tcpd, access control facility for internet services.
Use iptables to Restrict ssh access
Following is simple rule that block all incoming ssh access at port 22iptables -A INPUT -p tcp -s 0/0 --sport 513:65535 -d 195.55.55.78 --dport 22 -m state --state NEW,ESTABLISHED -j DROP
However in real life you need to use something as follows. Let us assume that your ssh server IP address is 195.55.55.78, remember ssh server use TCP port 22 for all incoming connection. With iptables you can block all incoming connection at port 22 with following two rules:
iptables -A INPUT -p tcp -s 0/0 --sport 513:65535 -d 195.55.55.78 --dport 22 -m state --state NEW,ESTABLISHED -j DROP
iptables -A OUTPUT -p tcp -s 195.55.55.78 --sport 22 -d 0/0 --dport 513:65535 -m state --state ESTABLISHED -j DROP
If you just want to deny access to group of IPS then you need to add following rules to your script:IPS="202.54.1.20 64.66.44.22 64.66.44.25"
for i in $IPS
do
iptables -A INPUT -p tcp -s 0/0 -s $i --sport 513:65535 -d 195.55.55.78 --dport 22 -m state --state NEW,ESTABLISHED -j DROP
iptables -A OUTPUT -p tcp -s 195.55.55.78 --sport 22 -d $i --dport 513:65535 -m state --state ESTABLISHED -j DROP
done
Add all of above rules to your iptables firewall shell script (do not type @ shell prompt)
See also:
Read More..
Diposting oleh Moh. Johan Rajabi di 05.38 0 komentar
Label: Iptable



