Microsoft Windows, Windows 7

Delete System Service in Windows 7

Before you delete any service you have to know its real name, not the displayed one. 1. Open services by executing: services.msc 2. Locate your desired service for deletion 3. Right click on it and select Properties 4. On Tab General, there is a field called Service Name. That’s the name that you will provide …

Add-ons, Browsers

Security in Firefox with NoScript

One of my favorites addons for firefox that protects me while i am surfing is NoScript! Most of you already know it. NoScript blocks JavaScript, Java and other executable content. It protects from XSS, cross-zone DNS rebinding / CSRF attacks (router hacking), and Clickjacking attempts. It allows executable content to run only from trusted domains …

Cross-Platform, Java

Get URL contents with Java

It is very easy to download url contents using a few lines of java code: The source code below is licensed under GPLv3. GetURLContents.java (GetURLContents) import java.io.*; import java.net.*;   public class GetURLContents {   public static void main (String[] args) { URL url; InputStream input = null; BufferedReader inputs; String str;   try { …

Browsers, Ubuntu

Installing Opera on Ubuntu

If you like Opera, like i do, then you are a few steps away from installing it on Ubuntu! 1. Keep a backup for file /etc/apt/sources.list 2. Append to this file the lines below: #opera deb http://deb.opera.com/opera/ stable non-free 3. Add the Opera PGP Key wget -qO – http://deb.opera.com/archive.key | sudo apt-key add – 4. …

C#, Microsoft Windows

Hashing text with SHA-256 in C#

A simple c# method to produce hashes from plain text using SHA-256 algorithm in visual c#! 1 2 3 4 5 6 public String Hash_SHA256(String plainText) {             byte[] inputBytes = Encoding.UTF8.GetBytes(plainText);             byte[] hashedBytes = (new SHA256CryptoServiceProvider()).ComputeHash(inputBytes);             return BitConverter.ToString(hashedBytes).Replace("-", string.Empty).ToLower(); }public String Hash_SHA256(String plainText) {             byte[] inputBytes = Encoding.UTF8.GetBytes(plainText);             byte[] hashedBytes …

PHP

Preventing MySQL Injection in PHP

Security issues like MySQL injection can only be corrected by using two functions mysql_real_escape_string (php manual) and stripslashes (php manual).   Example: $safe_string = mysql_real_escape_string(stripslashes($tainted_string));$safe_string = mysql_real_escape_string(stripslashes($tainted_string));   To make your life a little easier just create a suitable function for this line of code: function checkString($value) {       return mysql_real_escape_string(stripslashes($value));   }function checkString($value) …