Monday, June 22, 2009

Hp laserjet 1000 series Hp laserjet 1000 series howto

Tested environment:
OS: Ubuntu (Centos 8.10 HARDY)

Click the link, or cut and paste the whole command line below to download the driver.

$ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz

Make sure you have gcc already installed. If not them yum it.
Now unpack it:
Unpack:

$ tar zxf foo2zjs.tar.gz
$ cd foo2zjs
Now compile and install it. The INSTALL file contains more detailed instructions; please read it now.
Compile:
$ make

Get the firmware. Select the model number for your printer:

$ ./getweb 1000 # Get HP LaserJet 1000 firmware file


Comment: If it complains about "getweb: no such file" or something, you'll need to do a
Code:

$ sudo apt-get install build-essential
$ make

Install driver, foomatic XML files, and extra files:

$ su - OR $ sudo make install

# make install


just copy paste
Code:

$ sudo cp sihp1000.img /dev/usb/lp0

We need cups to find your printer, that is find the new node. So change the DeviceURI in /etc/cups/printers.conf to file:///dev/usb/lp0.
For example:
Code:

$ sudo nano -w /etc/cups/printers.conf

[Comment out the existing DeviceURI line (by adding a # infront of it) and add]

DeviceURI file:///dev/usb/lp0



(Optional) Configure hotplug (USB; HP LJ 1000/1005/1018/1020):
# make install-hotplug OR $ sudo make install-hotplug

(Optional) If you use CUPS, restart the spooler:
# make cups OR $ sudo make cups

Restart cups

# /etc/init.d/cups restart

Use system-config-printer to configure the printer.

# system-config-printer

Chose the the model. Make sure to choose the foo2zjs version of it. Or you could use cups

Trouble shooting:
Problem: If you get the following error
Error: Quota limit reached
Solution:

sudo lpadmin -p -u allow:all

Note: It could be a friendly printer name (in this case it was ispprinter)

Problem: I cannot manage print jobs
Solution: Head over to http://localhost:631 & manage the jobs from the selected printer.

Reference:
http://foo2zjs.rkkda.com/
http://swiss.ubuntuforums.org/showthread.php?t=1079211

Friday, June 5, 2009

Distribution: CENTOS5.2
Rkhunter Version: rkhunter-1.2.9-2.el5.rf
Prerequisites:
• Cent OS 5.2
• Dag-RPMforge-Repo
• Intermediate knowledge of Linux
Purpose:
A rootkit is malware which consists of a program (or combination of several programs) designed to hide or obscure the fact that a system has been compromised. Contrary to what its name may imply, a rootkit does not grant a user administrator access as it requires such access to execute and tamper with system files and processes. An attacker may use a rootkit to replace vital system executables which may then be used to hide processes and files the attacker has installed along with the presence of the rootkit itself. Access to the hardware (e.g.the reset switch) is rarely required as a rootkit is intended to seize control of the operating system running on the hardware. Typically, rootkits act to obscure their presence on the system through subversion or evasion of standard operating system security mechanisms. Often, they are Trojans as well, thus fooling users into believing they are safe to run on their systems. Techniques used to accomplish this can include concealing running processes from monitoring programs, or hiding files or system data from the operating system.[1] Rootkits may also install a 'backdoor' in a system by replacing the login mechanism (such as /bin/login) with an executable that accepts a secret login combination which in turn allows an attacker to access the system regardless of changes to the actual accounts on the system.

Installing & Rkhunter
wget http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-
1.el5.rf.i386.rpm

rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm

yum install rkhunter
After completing run the following command

rkhunter -c
it will scan you entire system and if its find any valuenrability in your system the it will
report you immediately .
There are other parameters which are useful & you can check there details at your
need by typing

man rkhunter

Setup a daily scan report

cd /etc/cron.daily
touch rkhuntercron
vi rkhuntercron

#Add the following lines

#!/bin/bash
/usr/bin/rkhunter -c --cronjob 2>&1 | mail -s "Daily Rkhunter Scan Report"
email@domain.com
#save&exit

#now run

chmod 755 /etc/cron.daily/rkhuntercron

Reference
http://www.centos.org/modules/newbb/viewtopic.php?topic_id=12401
http://en.wikipedia.org/wiki/Rootkit
http://www.ipinfinity.com/index.php/Detect_linux_rootkits_using_Rootkit_Hunter
http://hacktux.com/passwordless/ssh
http://www.aczoom.com/cms/blockhosts/details

Tuesday, May 26, 2009

How to Add New HD in Centos

Prerequisites:

Cent OS 5.3
Intermediate knowledge of Linux

Purpose:
Some time you may ran out of space in linux & it is necessary to add new HD in existing system it doesn't matter what kind of service you are running on that server the important is how you can add new HD in existing partitions and you may also be keen to mount this HD at boot time and you all want to do this without creating LVM
Attach HD to your system
I assume that you have successfully attach your hard disk in system without any problem there must be new HD when you run this command

fdisk -l

output must be like this

Disk /dev/hdc: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 1 155061 78150712+ 83 Linux
Disk /dev/sda: 36.7 GB, 36703934464 bytes
255 heads, 63 sectors/track, 4462 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 12 96358+ 83 Linux
/dev/sda2 13 273 2096482+ 82 Linux swap / Solaris
/dev/sda3 274 4462 33648142+ 83 Linux


Note: I uses fdisk utility because it comes by default with centos you can use other utilities
Now My New HD is at top “/dev/hdc” & we have to play with this, in your case it can something else

fdisk /dev/hdc1
Command (m for help):

for help type

m

write “n” to create partition

n

I have created only 1 as primary
after that press “w to write

w

After that you will be quit from fdisk menu automatically

Now review the output of “/proc/partitions” and remember the minor number of the new partition so that you can label it.

cat /proc/partitions

you can see your hard drive is listed

Format the partition

/sbin/mkfs -t ext3 /dev/hdc1

Labeling the Partition

/sbin/e2label /dev/hdc1 /var

Creating the Mount Point

mkdir /var

Add to /etc/fstab

LABEL=/var /var ext3 defaults 1 2

The first column should contain LABEL= followed by the label you gave the partition. The second column should contain the mount point for the new partition, and the next column should be the file system type (for example, ext3 or swap). If you need more information about the format, read the man page with the command man fstab.
If the fourth column is the word defaults, the partition is mounted at boot time.
To mount the partition without rebooting, as root, type the command:

mount /var

Note: After copying existing data if any double check for path

Reboot the server and use "df -h" to see whether the new partition has been mounted. If not, you have some work to do, poking around, and check if you made any mistake or any correction for this how to


References
http://www.imminentweb.com/technologies/add-new-partition-running-centos-server

Saturday, May 2, 2009

How to Allow MSN/IRC in Squid

By:Rizwan Shah
How to Allow MSN/IRC in Squid
Distribution: CENTOS5.2
Squid: 2.6
Prerequisites:
• Cent OS 5.2
• Squid 2.6(Configured and running)
• Intermediate knowledge of Linux
Purpose:
Yes I know that what you are thinking but remember whenever you configure squid proxy by default your users can not go through MSN/IRC but yahoo and you may use iptables for this purpose but in my case I will accomplish this via squid proxy there is no huge science is involved, you only have to allow CONNECT method on IRC/MSN port thats it.
What is CONNECT Method
This specification reserves the method name CONNECT for use with a proxy that
can dynamically switch to being a tunnel (e.g. SSL tunneling
vi /etc/squid/squid.conf
Go SSL_Ports section & add MSN/IRC Ports (IRC=667,MSN=1863)
acl SSL_ports port 1863 6667
Now we define ACL For CONNECT Method
acl CONNECT method CONNECT
Now Allow these Acl into appropriate location
http_access deny CONNECT !SSL_ports
Allowing IRC access on certain irc server
acl irc_port port 6667
acl irc dstdomain irc.freenode.net
Now allow to this acl appropriate location in my case it is just above my_network acl
http_access allow irc irc_port
Note: it is most likely that you have already define SSL_ports & CONNECT
Acl in you squid.conf file if yes then you only have to add MSN/IRC ports
in SSL_ports section.
References
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
http://wasjournal.blogspot.com/2007/06/ssl-tunneling-using-connect-method-and.html

How to Yum local repo in Centos using ISO file

By:Rizwan Shah
Prerequisites:

CentOS 5.2
• Intermediate knowledge of Linux
• nfs

Purpose:
it is very important to save your precious bandwidth during update process because it is not ideal to update every individual system from web and same kind of packages will be downloaded again & again we can do this by downloading latest centos dvd iso & using this dvd as local repo. Download latest Centos dvd(in my case it is 5.3)

login to your server open terminal & type the following command( I have already downloaded this

iso if you don't have you can download it from centos website)
wget http://downloads.ciit.net.pk/CIITdownloads/Operating%20Systems/Linux
%20Distributions/CentosDVD5.3/CentOS­5.3­i386­bin­DVD.iso
This iso is saved “/main” folder
Note: after “wget” you have to enter complete path if you are downloading from centos website
Now mount it your desire folder in my case it is “/mnt”
mount ­r ­t iso9660 ­o loop /main/CentOS­5.3­i386­bin­DVD.iso /mnt
Configure yum to use your new repository
vi /etc/yum.repos.d/CentOS­Media.repo
In following section add your “mounted” iso path

[c5­media]
name=CentOS­$releasever ­ Media
baseurl=
#file:///media/CentOS/
# file:///media/cdrom/
# file:///media/cdrecorder/
# here is your repo path
file:///mnt/
enable=1

Note: you can add comment for other media repo that are not available to avoid error messages
How to use This repo For Your Internal Server
Create NFS share by adding mounted folder in “/etc/exports” file
vi /etc/exports
/mnt/ 192.168.0.0/24(rw,sync)
save & exit
/mnt It is path your mounted centos iso
192.168.0.0/24 This is your internal network you can change according to your need
(rw,sync) Here you can set readonly. readwrite etc
Note:tune your iptables if needed
Note:Now login to your client whom you want to update just mount this nfs share &prior to this
create appropriate folder.
in my case
cd /
mkdir repo
mount 192.168.1.1:/mnt /repo
192.168.1.1 NFS Server IP
/mnt Your nfs share (check /etc/exports file)
/repo Locate at clint where this nfs share will be mounted

Verification
Now you have to check, is your local repo is in use or it is getting update from other repos if you
notice that it is not getting update from your local repo to troubleshoot this problem just disable
your all existing repos.
Hint: your repo directory is: /etc/yum.repos.d/

References
http://www.centos.org/modules/newbb/viewtopic.php?topic_id=17852

Video Bar

Loading...

Google Hot Trends