Friday, July 15, 2011

Share Internet with squid & Iptables


implement a nice trick to share internet with squid and block website using port redirection.
open your sysctl.conf
vim /etc/sysctl.conf and change line
net.ipv4.ip_forward = 1 (by default its 0)
save & exit from file 
1. Install Squid
yum -y install squid*
2. Edit Squid.conf file 
To Block website apply copy and paste this below lines as per your source network
acl blocksite dstdomain .orkut.com
http_access deny blocksite 
acl our_networks src
http_access allow our_networks
vim /etc/squid/squid.conf then search for http_port you will see 3128 by default port there so change it to 8888
save & exit from file
3. service squid restart
4.Now share your internet using iptables by executing following command:-
iptables -t nat -A POSTROUTING -o eth1 < Live-IP-Lan-Card> -j MASQUERADE
5. Now redirect your 80 port to 8888 
iptables -t nat -A PREROUTING -i eth0 (Local-Lan-Card) -p -tcp –dport 80 -j REDIRECT –to-port 8888
Now your Outlook will work directly without doing anything but client will not able to surf block websites which you blocked in squid.

Mounting NTFS Partition on RHEL 5.x


irst Setup RPMForge Repository by running this command :- wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Install DAG’s GPG Key by executing following command:-
rpm – -import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
Verify the package you have downloaded:-
rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm
Install the package :-
rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm
or if you dont find packages here try some other repositories like rpmfusion, epel hope you will get it..
after this run yum list command if that runs completely
then Intall gcc packages from your RHEL CD/DVD or any other repository where gcc packages available.
GCC Packages is must for Mounting NTFS.
After GCC installed
run this command :-
yum -y install fuse fuse-ntfs-3g dkms dkms-fuse
if you are running xen kernel then only run this command
yum install kernel-xen-devel
if you are running PAE kernel then only run this command
yum install kernel-PAE-devel
Now Make Entry in your /etc/fstab file
make backup of your /etc/fstab by executing this command
cp /etc/fstab /etc/fstab.bkp
now open your /etc/fstab file in your favorite editor
vim /etc/fstab like below example
/dev/sda1          /mnt/ntfs      ntfs-3g      defaults       0  0

save & exit from file
Then execute this two commands in exact order
umount -a
mount -a
That’s it. Now You will able to see NTFS by executing df -kh or access your NTFS Volume from your mount point.

Fedora 10 Autologin


Took a small detour to Fedora land, I found no option how to enable autologin in gnome, so here’s how to do it.
Please remember to back up your files first! :
cp /etc/gdm/gdm.schemas /etc/gdm/gdm.schemas.backup
nano /etc/gdm/gdm.schemas
and locate
`
daemon/AutomaticLoginEnable
b
false  Change this to true.
`
And finally edit this:
`
daemon/AutomaticLogin
s
  Put the username here.
`
If you have look a bit further down, you’ll find options how to enable timed login too, if you use that instead you must leave auto login disabled.

10 obscure Linux distributions


1: Damn Vulnerable Linux

Damn Vulnerable Linux is exactly what it sounds like. According to the Web site, “Damn Vulnerable Linux (DVL) is everything a good Linux distribution isn’t. Its developers have spent hours stuffing it with broken, ill-configured, outdated, and exploitable software that makes it vulnerable to attacks.” What value would such a distribution hold? Training. The idea behind this distribution is to train Linux admins. And what better way to train someone than to hand them a broken distribution to fix? With older/broken versions of Apache, MySQL, PHP, FTP, and SSH, your admins in training will have their hands full.

2: CAINE Linux

CAINE Linux might be one of the niftiest of the niche Linux distributions. CAINE stands for Computer Aided INvestigative Environment. Basically, it’s CIS Linux designed for digital forensics. CAINE includes TheSleuthKitAutopsy Forensic Browser, steganography tools, and plenty of tools for wiping hard drives. This distribution also includes a semi-automated tool for the compilation of the final report on a digital forensics investigation.

3: Zeroshell

Zeroshell is an interesting Linux distribution aimed at embedded systems — specifically, networking hardware. It’s administrated through a Web interface and can provide all networking services required for a LAN. With Zeroshell, you can set up Failover, RADIUS, Captive Portal, Quality of Service management, HTTP Proxy, Wireless Access Point, Host-to-LAN VPN, LAN-to-LAN VPN, Routing with Static or Dynamic IP Addressing, and much more.

4: Parted Magic

Parted Magic is similar to the Gparted Live CD, only it adds a few more tools (such as Clonezille, TestDisk, Partimage, Trucrypt, G4L, SuperGrubDisk, and ddrescue). This type of tool is ideal for managing partitions as well as troubleshooting drives and various issues. This particular Linux distribution works on x86 hardware and requires 256MB of RAM to operate in. Parted Magic can work with the following partition types: ext2, ext3, ext4, fat16, fat32, hfs, hfs+, jfs, linux-swap, ntfs, reiserfs, reiser4, and xfs.

5: Tiny Core

Tiny Core is exactly what the name implies. It’s a tiny Linux distribution, coming in at under 10 MB (with a GUI included). But don’t think Tiny Core is limited to tiny tasks. Once it’s installed, you can begin adding the applications you need. But by default, you will have a minimal X desktop with networking. Tiny Core is based on Tiny X, Busybox, Fltk, and the 2.6 kernel.

6: CAELinux

CAELinux focuses on computer aided engineering. It’s based on open source titles like Salome,Code_Aster, and OpenFOAM. CAELinux is an Ubuntu-based distribution that can simulate physics involving nonlinear thermo-mechanics, coupled fluid-structure dynamics, seismic/nonlinear explicit dynamics, contacts, visco-plasticity, fluid dynamics, heat exchange, convection heat transfer and radiation, and electro dynamics. This distribution offers a wiki with plenty of documentation for each application.

7: Musix

Musix is a Knoppix-Debian distribution aimed at artistic and educational uses in the field of music. It’s a live CD, so it can be run without installation. The two applications that draw the most attention on this distribution are Rosegarden and Ardour. Between these two applications, you will have everything you need for music composition and recording. You will also find tools like Inkscape, Blender for 3D animation, and Cinelerra for video editing.

8: SLAMPP

SLAMPP is a slackware-based Live distribution that is truly a one-stop-shop for system server needs. With this distribution running, you are ready with HTTP, FTP, DHCP, DNS, and many more servers. And this can all be achieved without even installing the distribution! That’s right. By using a live DVD, you can have all of those servers up and running in no time. SLAMPP is the “instant home server” distribution.

9: Ubuntu Christian Edition

Ubuntu Christian Edition is, as its name implies, an Ubuntu-based Linux distribution geared toward the Christian faith. This distribution includes a plethora of faith-based software (such as Xiphos,OpenSong, and E-Sword, along with tools for parental controls.

10: Ubuntu Satanic Edition

From its name, you might think Ubuntu Satanic Edition is a converse distribution to Ubuntu Christian Edition. It’s not. According to the Web site, USE “brings together the best free software and free metal music on one CD.” The “Undead CD” is based on Ubuntu 10.04 and includes all the standard software, along with a mélange of typically dark, heavy metal-esque themes, as well as a full 50-minute album of the best Creative Commons-licensed metal music. What else does USE offer that standard Ubuntu doesn’t? Nothing more than some serious attitude that will ensure your fellow workers know who rocks harder!

10 things Linux does better than Windows

#1: TCO

This can o’ worms has been, and will be, debated until both operating systems are no more. But let’s face it — the cost of a per-seat Windows license for a large company far outweighs having to bank on IT learning Linux. This is so for a couple of reasons.
First, most IT pros already know a thing or two about Linux. Second, today’s Linux is not your mother’s Linux. Linux has come a long, long way from where it was when I first started. Ten years ago, I would have said, hands down, Windows wins the TCO battle. But that was before KDE and GNOME brought their desktops to the point where any given group of monkeys could type Hamlet on a Linux box as quickly as they could type it on a Windows box. I bet any IT department could roll out Linux and do it in such a way that the end users would hardly know the difference. With KDE 4.1 leaps and bounds beyond 4.0, it’s already apparent where the Linux desktop is going — straight into the end users’ hands. So with all the FUD and rhetoric aside, Windows can’t compete with Linux in TCO. Add to that the cost of software prices (including antivirus and spyware protection) for Windows vs. Linux, and your IT budget just fell deeply into the red.

#2: Desktop

You can’t keep a straight face and say the Linux desktop is more difficult to use than the Windows desktop. If you can, you might want to check the release number of the Linux distribution you are using. Both GNOME and KDE have outpaced Windows for user-friendliness. Even KDE 4, which has altered the path of KDE quite a bit, will make any given user at home with the interface. But the Linux desktop beats the Windows desktop for more reasons than just user-friendliness. It’s far more flexible than anything Microsoft has ever released. If you don’t like the way the Linux desktop looks or behaves, change it. If you don’t like the desktop included with your distribution, add another. And what if, on rare occasion, the desktop locks up? Well, Windows might require a hard restart. Linux? Hit Ctrl + Alt + Backspace to force a logout of X Windows. Or you can always drop into a virtual console and kill the application that caused your desktop to freeze. It’s all about flexibility… something the Windows desktop does not enjoy.
#3: Server

For anyone who thinks Windows has the server market cornered, I would ask you to wake up and join the 21st century. Linux can, and does, serve up anything and everything and does it easily and well. It’s fast, secure, easy to configure, and very scalable. And let’s say you don’t happen to be fond of Sendmail. If that’s the case you have plenty of alternatives to choose from. Even with serving up Web pages. There are plenty of alternatives to Apache, some of which are incredibly lightweight.
#4: Security

Recently, there was a scare in the IT world known as Phalanx 2. It actually hit Linux. But the real issue was that it hit Linux servers that hadn’t been updated. It was poor administration that caused this little gem to get noticed. The patch, as usual in the Linux world, came nearly as soon as word got out. And that’s the rub. Security issues plague Windows for a couple of reasons: The operating system comes complete with plenty of security holes and Microsoft is slow to release patches for the holes. Of course, this is not to say that Linux is immune. It isn’t. But it is less susceptible to attacks and faster to fix problems.
#5: Flexibility

This stems from the desktop but, because Linux is such an amazingly adaptable operating system, it’s wrong to confine flexibility to the desktop alone. Here’s the thing: With Linux, there is always more than one way to handle a task. Add to that the ability to get really creative with your problem solving, and you have the makings of a far superior system. Windows is about as inflexible as an operating system can be. Think about it this way: Out of the box, what can you do with Windows? You can surf the Web and get e-mail. Out of the box, what can you do with Linux? I think the better question is what can you NOT do with Linux? Linux is to Legos like Windows is to Lincoln Logs. With Lincoln Logs, you have the pieces to make fine log cabins. With Legos, you have the pieces to make, well, anything. And then you have all the fanboys making Star Wars Legos and Legos video games. Just where did all those Lincoln Logs fanboys go?
#6: Package management

Really, all I should have to say about this is that Windows does no package management. Sure, you can always install an application with a single click. But what if you don’t know which package you’re looking for? Where is the repository to search? Where are the various means of installing applications? Where are the dependency checks? Where are the md5 checks? What about not needing root access to install any application in Windows? Safety? Security? Sanity?
#7: Community

About the only community for Windows is the flock of MCSEs, the denizens at the Microsoft campus, and the countless third-party software companies preying on those who can’t figure out what to do when Windows goes down for the count. Linux has always been and always will be about community. It was built by a community and for a community. And this Linux community is there to help those in need. From mailing lists to LUGs (Linux user groups) to forums to developers to Linus Torvalds himself (the creator of Linux), the Linux operating system is a community strong with users of all types, ages, nationalities, and social anxieties.
#8: Interoperability

Windows plays REALLY well with Windows. Linux plays well with everyone. I’ve never met a system I couldn’t connect Linux to. That includes OS X, Windows, various Linux distributions, OS/2, Playstations… the list goes on and on. Without the help of third-party software, Windows isn’t nearly as interoperable. And we haven’t even touched on formats. With OpenOffice, you can open/save in nearly any format (regardless of release date). Have you come across that docx format yet? Had fun getting it to open in anything but MS Word >=2007?
#9: Command line

This is another item where I shouldn’t have to say much more than the title. The Linux command line can do nearly anything you need to work in the Linux operating system. Yes, you need a bit of knowledge to do this, but the same holds true for the Windows command line. The biggest difference is the amount you can do when met with only the command line. If you had to administer two machines through the command line only (one Linux box and one Windows box), you would quickly understand just how superior the Linux CLI is to the vastly underpowered Windows CLI.
#10: Evolution

For most users, Vista was a step backward. And that step backward took a long time (five years) to come to fruition. With most Linux distributions, new releases are made available every six months. And some of them are major jumps in technological advancement. Linux also listens to its community. What are they saying and what are they needing? From the kernel to the desktop, the Linux developer community is in sync with its users. Microsoft? Not so much. Microsoft takes its time to release what may or may not be an improvement. And, generally speaking, those Microsoft release dates are as far from set in stone as something can be. It should go without saying that Microsoft is not an agile developer. In fact, I would say Microsoft, in its arrogance, insists companies, users, and third-party developers evolve around it.
That’s my short list of big-ticket items that Linux does better than Windows. There will be those naysayers who feel differently, but I think most people will agree with these points. Of course, I am not so closed-minded as to think that there is nothing that Windows does better than Linux. I can think of a few off the top of my head: PR, marketing, FUD, games, crash, and USB scanners.