find . -name "*.gz" –print
Quick Notes for easy understanding. Chapters are on C#.Net,Linq,OOPS,Design Patterns,UML,Tools for development, Databases and many others. - Sid
Friday, June 26, 2009
gunzip files in a directory containing sub directory in unix
find . -type f -name "*.gz" -exec gunzip {} \;
Monday, June 15, 2009
ADO.NET : Calling Store procedure
ADO.NET : Calling Store procedure
private void SpTest (id, string name)
{
SqlConnection sqlConn= new SqlConnection(_sqlConnString);
try
{
SqlCommand sqlCmd = new SqlCommand();
sqlCmd.CommandText = "sp_test";
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.Parameters.Add("id", SqlDbType.Int);
sqlCmd.Parameters.Add("name", SqlDbType.VarChar);
sqlCmd.Parameters[0].Value = id;
sqlCmd.Parameters[0].Direction = ParameterDirection.Input;
sqlCmd.Parameters[1].Value = name;
sqlCmd.Parameters[0].Direction = ParameterDirection.Input;
sqlCmd.Connection = sqlConn;
sqlConn.Open();
sqlCmd.ExecuteNonQuery();
}
catch (Exception exSp)
{
throw exSp;
}
finally
{
sqlConn.Close();
}
}
Wednesday, June 10, 2009
ls –lR Unix Command in sFtp C# DotNet
This code functionality facilitates the ls -lR command in C# project and is for the project which is using Tamis.SharpSsh 3rd party dll to Unix data transmission.
ls -lR functionality not provided by them. So I came across the need of it and wrote as below .
public Tamir.SharpSsh.java.util.Vector lsLr(string path)
{
Tamir.SharpSsh.java.util.Vector putLsEntry = new Tamir.SharpSsh.java.util.Vector();
Tamir.SharpSsh.java.util.Vector getLsEntry = new Tamir.SharpSsh.java.util.Vector();
Tamir.SharpSsh.java.util.Vector recLsEntry = new Tamir.SharpSsh.java.util.Vector();
Tamir.SharpSsh.jsch.ChannelSftp.LsEntry lsEntry;
getLsEntry = _sftp.ls(path);
int i = 0;
for (i = 0; i < getLsEntry.Count; i++)
{
lsEntry = (Tamir.SharpSsh.jsch.ChannelSftp.LsEntry)getLsEntry[i];
if (lsEntry.getFilename().ToString().Trim() == "." || lsEntry.getFilename().ToString().Trim() == "..") { continue; };
if (lsEntry.getAttrs().getPermissionsString().StartsWith("d"))
{
recLsEntry = lsLr(path + "/" + lsEntry.getFilename());
int j = 0;
for (j = 0; j < recLsEntry.Count; j++)
{
putLsEntry.add(recLsEntry[j]);
}
}
else
{
putLsEntry.add(lsEntry);
}
}
return putLsEntry;
}
Tuesday, June 9, 2009
Problem in running Iptables from CGI ?
Problem in running Iptables commands from CGI ?
This is because , CGI not having root privileges even though you are login as root or Admin.
To run root privileges commands through CGI .
Step:
If you run sudo it will not support.So alter sudoers file and restarted apache.
Ucase in DataTable.Select(
datatable.CaseSensitive = false;
dtCopy.CaseSensitive = false;
DataRow[] drFilter = dtCopy.Select("Source_Dir=’/LOCAL/HOME’”);
dtCopy.CaseSensitive = true;
Tuesday, June 2, 2009
XAMPP - Make your Computer a Webserver: Apache, PHP, MySQL
XAMPP is a free installer that has Apache / PHP / MYsql / perl and more integrated so you won't have to configure anything yourself. HTML / CSS Tutorial.
Code Formater
Paste Here Your Source Code | ||||||||||||||
Source Code Formatting Options | ||||||||||||||
|
||||||||||||||
Copy Formatted Source Code | ||||||||||||||
Preview Of Formatted Code |