Start -> Accessories -> System -> Disk Clean up -> clean up previous installtions -> ok.
Friday, June 19, 2015
Tuesday, June 9, 2015
How to install unrar and rar facilities in mac
1) Download unrar utility from RARLab
2) extract it through tar -xvf
3) go inside extracted rar folder
4) sudo install -c -o $USER rar /usr/local/bin
5) sudo install -c -o $USER unrar /usr/local/bin
6) hit enter and it will ask you for password .
7) u can use unrar and rar utilities in mac.
Thursday, June 4, 2015
How to Load SSL certificate in trustStore
Here is the code >>
static public void doTrustToCertificates(String certPath, String keyPath) throws Exception {
try{
char[] password = "changeit".toCharArray();
String alias = "isskey";
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
keystore.load(null, password);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
InputStream certstream = fullStream (certPath);
Certificate certs = cf.generateCertificate(certstream);
File keystoreFile = new File(keyPath);
// Add the certificate
keystore.setCertificateEntry(alias, certs);
// Save the new keystore contents
FileOutputStream out = new FileOutputStream(keystoreFile);
keystore.store(out, password);
out.close();
}catch(Exception ex)
{
ex.printStackTrace();
}
}
private static InputStream fullStream ( String fname ) throws IOException {
FileInputStream fis = new FileInputStream(fname);
DataInputStream dis = new DataInputStream(fis);
byte[] bytes = new byte[dis.available()];
dis.readFully(bytes);
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
return bais;
}
}
static public void doTrustToCertificates(String certPath, String keyPath) throws Exception {
try{
char[] password = "changeit".toCharArray();
String alias = "isskey";
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
keystore.load(null, password);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
InputStream certstream = fullStream (certPath);
Certificate certs = cf.generateCertificate(certstream);
File keystoreFile = new File(keyPath);
// Add the certificate
keystore.setCertificateEntry(alias, certs);
// Save the new keystore contents
FileOutputStream out = new FileOutputStream(keystoreFile);
keystore.store(out, password);
out.close();
}catch(Exception ex)
{
ex.printStackTrace();
}
}
private static InputStream fullStream ( String fname ) throws IOException {
FileInputStream fis = new FileInputStream(fname);
DataInputStream dis = new DataInputStream(fis);
byte[] bytes = new byte[dis.available()];
dis.readFully(bytes);
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
return bais;
}
}
Friday, August 15, 2014
Thursday, November 21, 2013
Car Driving - L01
Lesson 1
Pre trip inspection
Exterior inspection
starting from anti clockwise.
How to start car
Key on engine
check parking brake is on and gear should be neutral.
press full clutch by foot
change gear to 1st
make parking brake off
release clutch slowly halfway
How to stop a car from above position
press clutch fully
Bring back gear to neutral
make parking brake on
press foot brake slowly
End of lesson - Confidence level .05 %
Pre trip inspection
Exterior inspection
starting from anti clockwise.
How to start car
Key on engine
check parking brake is on and gear should be neutral.
press full clutch by foot
change gear to 1st
make parking brake off
release clutch slowly halfway
How to stop a car from above position
press clutch fully
Bring back gear to neutral
make parking brake on
press foot brake slowly
End of lesson - Confidence level .05 %
Wednesday, March 6, 2013
Tuesday, March 5, 2013
Query Optimization ...........1
- ----- This post is excerpt of Pinal Dave 's article published on www.sqlauthority.com ----
- ----- Try to get causes of each sentence -----
- Notes prepared for “Good, Better and Best Programming Techniques” meeting
- Do not prefix stored procedure with SP_ prefix. As they are first searched in master database, before it is searched in any other database.
- Always install latest server packs and security packs.
- Make sure your SQL Server runs on optimal hardware. If your operating system supports 64 bit SQL Server, install 64 bit SQL Server on it. Raid 10 Array.
- Reduce Network Traffic by using Stored Procedure. Return only required result set from database. If application needs paging it should have done in SQL Server instead of at application level.
- After running query check Actual Execution Plan for cost of the query. Query can be analyzed in Database Engine Tuning Advisor.
- Use User Defined Functions sparsely, use Stored Procedures instead.
- Stored Procedure can achieve all the tasks UDF can do. SP provides much more features than UDFs.
- Test system with realistic data rather than sample data. Realistic data provides better scenario for testing and reveals problems with real system before it goes to production.
- Do not use SELECT *, use proper column names to decrease network traffic and fewer locks on table.
- Avoid Cursors as it results in performance degradation. Sub Query, derived tables, CTE can perform same operation.
- Reduces the use of nullable columns.
- NULL columns consumes an extra byte on each column used as well as adds overhead in queries. Also NULL is not good for logic development for programmers.
- Reduce deadlocks using query hints and proper logic of order in columns.
- Normalized database always increases scalability and stability of the system. Do not go over 3rd normal form as it will adversely affect performance.
- Use WHERE clauses to compare assertive logic. Use IN rather than NOT IN even though IN will require more value to specify in clause.
- BLOBS must be stored filesystem and database should have path to them only. If path is common stored them in application variable and append with filename from the BLOBColumnName.
- Always perform referential integrity checks and data validations using constraints such as the foreign key and check constraints.
- SQL Server optimizer will use an index scan if the ORDER BY clause is on an indexed column.
- Stored Procedure should return same numbers of resultset and same columns in any input parameters. Result Set of Stored Procedure should be deterministic.
- Index should be created on highly selective columns, which are used in JOINS, WHERE and ORDER BY clause.
- Format SQL Code. Make it readable. Wrap it.
- Use Column name in ORDER BY clause instead of numbers.
- Do not use TEXT or NTEXT if possible. In SQL Server 2005 use VARCHAR(MAX) or NVARCHAR(MAX).
- Join tables in order that they always perform the most restrictive search first to filter out the maximum number of rows in the early phases of a multiple table join.
- Remember to SET NOCOUNT ON at the beginning of your SQL bataches, stored procedures, triggers to avoid network traffic. This will also reduct the chances of error on linked server.
- Do not use temp tables use CTE or Derived tables instead.
- Always take backup of all the data.
- Never ever work on production server.
- Ask someone for help if you need it. We all need to learn.
Subscribe to:
Posts (Atom)
