Posts

Showing posts from September, 2009

How To Block IP Addresses On Linux Server

Take a look at your log file (/var/log/secure for Fedora Core 4) and you will discover numerous automated ssh hacking attempts using dictionary attack. So now you have identified the offending addresses. How do you stop them? Here comes the magic mantra which uses iptables (packet) firewall: iptables -A INPUT -s a.b.c.d -j DROP Replace a.b.c.d with the offending IP address. Repeat this for each of the offending IP addresses.

Festival Special: How to prepare Biryani !!!

Image
INGREDIENTS :       • 500 grams of basmati rice • 1 kg of mutton (diced into small pieces) • 2 tablespoons of garam masala • 6 nos. of red chillies • 3 nos. of green chillies • A handful of cashew nuts • 1 large onion (chopped) • 5 nos. of cloves • 2 nos. of cinnamon sticks • 2 nos. of cardamom • 6 sprigs of fresh coriander (chopped) • 1 small bunch of mint (chopped) • 1 tablespoon of ginger-garlic paste • 3 tablespoons of saffron (dissolved in cup milk) • 1 cup of yoghurt (beaten) • 2 nos. of lime • 4 nos. of boiled eggs • 5 tablespoons of ghee/oil • Salt to taste Procedure: • Mix mutton pieces with ginger-garlic paste and beaten yoghurt and keep aside • Grind the chillies and cashew nuts together • Heat four tablespoons of ghee/oil and fry the chilli-cashew paste. Now add mutton, one-fourth of fried onion, 1 tablespoon garam masala and salt to taste • As ghee separates from the mixture, add on

Read Notepad Contents using Java

import java.io.*; public class ReadNotepad { public static void main(String[] args) { try { FileInputStream fstream = new FileInputStream("C:\\Sample.txt"); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; while ((strLine = br.readLine()) != null) { } System.out.println("Notepad Contents---->>>>"+strLine); in.close(); } catch(Exception e) { e.printStackTrace(); } } }

Read Notepad Contents using Java

import java.io.*; public class ReadNotepad { public static void main(String[] args) { try { FileInputStream fstream = new FileInputStream( "C:\\Sample.txt" ); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader( new InputStreamReader(in)); String strLine; while ((strLine = br.readLine()) != null ) } System. out .println( " Notepad ----->>>>" +strLine); in.close(); } catch (Exception e) { e.printStackTrace(); } } }

Top 20 Tips To Keep Your System Faster

Follow these tips and you will definitely have a much faster and more reliable PC! Most of the below tips works for windows 98   1. Wallpapers : They slow your whole system down, so if you're willing to compromise, have a basic plain one instead!   2. Drivers : Update your hardware drivers as frequently as possible.  New drivers tend to increase system speed especially in the case of graphics cards, their drivers are updated by the manufacturer very frequently!   3. Minimizing : If you want to use several programs at the same time then minimize those you are not using.  This helps reduce the overload on RAM.      4. Boot Faster : The 'starting Windows 95/98' message on startup can delay your booting for a couple of seconds.  To get rid of this message go to c:\ and find the file Msdos.sys.  Remove the Read-Only option.  Next, open it in Notepad or any other text editor.  Finally, go to the text 'Options' within the file and make the following changes: Add BootDela

To Kill a Process in Windows using Java

In Java it is easy to stop or kill a executing process. Using the Runtime and Process class, this can be acheived. Runtime r=Runtime.getRuntime();        String command="taskkill /f /im [application name].exe"; Process p=r.exec(command);

Sending email attachments using Java and SMTP

Using the Secure iNet Factory components adding file attachments to your outbound email messages is a very simple task. The process for adding file attachments to your email message is described in the code example provided below. Example 01 /* 02 * @(#)SmtpAttachmentExample.java 03 * 04 * Copyright (c) 2001-2003 JSCAPE 05 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A. 06 * All rights reserved. 07 * 08 * This software is the confidential and proprietary information of 09 * JSCAPE. ("Confidential Information"). You shall not disclose such 10 * Confidential Information and shall use it only in accordance with 11 * the terms of the license agreement you entered into with JSCAPE. 12 */ 13 14 import com.jscape.inet.smtp.*; 15 import com.jscape.inet.mime.*; 16 import com.jscape.inet.email.*; 17 import java.io.*; 18 19 public class SmtpAttachmentExample extends SmtpAdapter { 20 public void sendMessage ( String hostname, String to, String from, String subject, Str

Life is...

Image

General Knowledge

1. What is the expansion ( Full Form ) of YAHOO ..? Yet Another Hierarchy of Officious Oracle 2. What is the expansion ( Full Form ) of ADIDAS ? ADIDAS- All Day I Dream About Sports 3. Expansion of Star as in Star TV Network ? Satellite Television Asian Region 4. What is expansion of " ICICI ?" Industrial credit and Investments Corporation of India 5. The 1984-85 season. 2nd ODI between India and Pakistan at Sialkot - India 210/3 with Vengsarkar 94*. Match abandoned. Why? That match was abandoned after people heard the news of Indira Gandhi being killed. 6. Who is the only man to have written the National Anthems for two different countries? Rabindranath Tagore who wrote national anthem for two different countries one is our 's National anthem and another one is for Bangladesh - (Amar Sonar* *Bangla ) 7. From what four word expression does the word `goodbye` derive? Goodbye comes from the ex-pression: 'god be with you'. 8. How was Agnes Gonxha Bojaxhi