Linux

Tips for Linux Users

Convert ^M to newline character in text files

In vi use the following:

:%s/^M/\n/g

or with perl on the command line:

$ perl -pi.bak -e 's/^M/\n/g' <filename>

NOTE: Be sure to create the ^M by typing ctrl+V followed by ctrl+M.

^M is ASCII 13 (Ctrl+M), which is the carriage return.

Different operating systems use different symbols to set the end of a line/new line.
Unix uses newline (\n)
Mac uses carriage return (\r)
And Windows/DOS use both (\n\r)

To prevent the ^M from showing up in files, be sure to use ASCII (text) mode when transfering text files.

Upgrading ClamAV from Source RPM

Prior to rebuilding SRPMs create a seperate account for building RPMs and set up the environment for it:

# su -
# useradd rpmbuild
# su - rpmbuild
# mkdir -p rpm/{BUILD,RPMS/$ARCH,RPMS/noarch,SOURCES,SRPMS,SPECS,tmp}

Replace "$ARCH" with the architecture(s) you plan to build packages.

Then create the minimal "~/.rpmmacros" file with the below contents:

%_topdir               /home/rpmbuild/rpm
%_tmppath              /home/rpmbuild/rpm/tmp

Now we are ready to build RPMs from SRPMs.

  1. Download the latest source rpm from dag.wieers.com to the "~/rpm/SRPMS" directory.

Verifying which ports are listening...

There are two basic approaches for listing the ports that are listening on the network. The less reliable approach is to query the network stack by typing commands such as `netstat -an` or `lsof -i`. This method is less reliable since these programs do not connect to the machine from the network but rather check to see what is running on the system. For this reason, these applications are frequent targets for replacement by attackers in an attempt to cover their tracks if they open unauthorized network ports.

A more reliable way to check which ports are listening on the network is to use a port scanner such as nmap.

Wow...dunno what I started.

Today is the first day that I begin using Fedora..dunno what version even. Any help will be appreciated. I've been trying to make my sound work for the last several hours. Frustration is upon me.

Default installation & software upgrades not enough!

Default installation & software upgrades not enough!

Firstly, I'm writing my first tutorial... so I'd love to be DoSssed with suggestions. The article is purely aimed to scare you &push you towards better security practices. The article is aimed for those ppl. who have a fair knowledge about the technology. This article just aims to scratch the surface of everything.............

==================================================
Lets start with the obvious... basics:
""""""""
# Obviously, Default Installation doesn't come with a virus/spy ware / Trojan scanner. If your PC isn't a single user OS, there is even a likelihood of mail ware, Trojan, spy wares running with user privileges... or worst a root kit.

Intel Corp. PRO/Wireless 2200BG on Fedora Core 3

On a Dell Latitude D800 with an Intel Corp. PRO/Wireless 2200BG card, intel has a project to support the miniPCI adapter on Linux at ipw2200.sourceforge.net.

In order to use the IPW2200 driver you will need the following:

  1. Linux with a 2.6.4+ kernel. See the INSTALL document for information on specific options required to be enabled in the kernel.
  2. Wireless Extensions (v16) and Tools (v27-pre23).

Fedora Core 3 upgrade issue with grub.conf and udev using NVIDIA driver

I had no trouble while upgrading from FC1 to FC3. However, on reboot the system seemed to hang on "configuring kernel parameters" during the boot process and fail to remount filesystems as read-write, with consequent hang while trying to start system logger. The boot process would be fine as long as the system is not booting to runlevel 5.

The fix was to remove "rhgb" from "/etc/grub.conf" kernel parameters, since this attempts graphical install before nvidia is ready. On reboot without "rhgb" in grub, it makes it to all the way to the text login screen, but X cant start and comes up with an error message saying it cant initialise the nvidia kernel module.

Winik - a new kind of distro

What is Winik

Winik is a cygwin distro that users can install in Windows like other applications program. Winik is unix like and users can select program from Start button and menus. Users can select other wm such as KDE, Gnome, Icewm, Wmaker, Xfce etc.

Winik give a taste of *nix to windows users. Winik are based on x/cygwin. Users can install Winik modules just likes other Windows application. Winik are modular and users can choose modules that suite their needs.

Winik is free of charge

Winik is an attempt to do something that shows free software doesn't have to be bad.

Winik installs easily on Windows

Crond Demystified !!

In Linux Fedora Core 1, "crond" is started from the script "/etc/rc.d/init.d/crond". The manual `man cron` says that cron searches "/var/spool/cron" for crontab files which are named after accounts in "/etc/passwd"; crontabs found are loaded into memory. Cron also searches for "/etc/crontab" and the files in the "/etc/cron.d/" directory.

The "/etc/crontab" file contains the following.

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly

Server Security with Advanced Policy Firewall and Antidos

APF is a policy based iptables firewall system designed for ease of use and configuration. It employs a subset of features to satisfy the veteran Linux user and the novice alike. APF is ideal for deployment in many server environments based on Linux.

Below are notes on installing, configuring and running APF.

  1. Download the latest tarball via rfxnetworks.com
  2. Extract and install it:
    # tar -xvzf apf-current.tar.gz
    # cd apf*
    # ./install.sh
    
Comment