Convert ^M to newline character in text files
Fri, 05/13/2005 - 10:36 — sandipIn 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.
- sandip's blog
- Login or register to post comments
Upgrading ClamAV from Source RPM
Tue, 05/10/2005 - 10:45 — sandipPrior 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.
-
Download the latest source rpm from dag.wieers.com to the "~/rpm/SRPMS" directory.
Verifying which ports are listening...
Sat, 04/30/2005 - 21:03 — sandipThere 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.
- sandip's blog
- Login or register to post comments
- Read more
Wow...dunno what I started.
Tue, 04/19/2005 - 23:54 — CapriciousToday 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!
Sat, 03/26/2005 - 09:16 — hUNT3RDefault 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
Sun, 03/13/2005 - 19:13 — sandipOn 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:
Fedora Core 3 upgrade issue with grub.conf and udev using NVIDIA driver
Sun, 03/06/2005 - 00:27 — sandipI 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.
- sandip's blog
- Login or register to post comments
- Read more
Winik - a new kind of distro
Wed, 03/02/2005 - 11:40 — nikhimWhat 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
- nikhim's blog
- Login or register to post comments
- Read more
Crond Demystified !!
Wed, 02/23/2005 - 15:17 — nepalexpoIn 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=r oot 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
Tue, 02/22/2005 - 22:17 — sandipAPF 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.
-
Download the latest tarball via rfxnetworks.com
Extract and install it:
# tar -xvzf apf-current.tar.gz # cd apf* # ./install.sh