Pages

Use Web Browser As Text Editor





Hello Friends,

In this post I will describe about How to use Web Browser as a text editor. This trick works on any modern browser like Chrome, Firefox.


Steps to do this-

1. copy the below text on your browser addressbar

data:text/html, <html contenteditable>

   2. Now Press Enter.
   3. Now you can type anything as would do on any other text editor like Notepad.
   4. To save your text file Press Ctrl + S and save it as anything.txt (.txt Is Must) - See more at: http://www.coolhackingtrick.com/2013/03/simple-trick-to-use-web-browsers-as.html#sthash.1Fmndm4z.dpuf
.
2. Press the Enter button.

3. Enter the text which you want to write.

4. To save this press Ctrl+S

5. Save the file with extenstion .txt (.txt is must)

   2. Now Press Enter.
   3. Now you can type anything as would do on any other text editor like Notepad.
   4. To save your text file Press Ctrl + S and save it as anything.txt (.txt Is Must) - See more at: http://www.coolhackingtrick.com/2013/03/simple-trick-to-use-web-browsers-as.html#sthash.1Fmndm4z.dp
 data:text/html, <html contenteditab
 data:text/html, <html contenteditable>


  

Install linux on usb drive

Hello Friends,

In this tutorial I will tell you about How to install Ubuntu on pen-drive using Windows.



Steps to install Linux onto your pen-drive


Step1-> Firstly download the .iso file of  linux distribution which you want to install.

Step2->  Download the "Universal USB Installer" on your system.

Step3-> Run the  exe of  Universal USB Installer.

Step4-> Select your linux distribution from the drop down list.


Step5-> GO to browse button and browse the .iso files from your hard disk.



Step6->Select your usb device onto which you want to install Linux.



Step7-> In the last step click on create button  it will open a black window(command prompt) and it will take some time to install the Linux OS onto your pen drive.

Setup eclipse ide for Java application


Setup Eclipse IDE for Java on Ubuntu

In this tutorial I will tell you about How to setup eclipse IDE for developing Java application.

prerequisites:

1. Install Java on your Ubuntu machine.

To install and configure  the Java  follow the given link -
After installing java, check for Java by using following command
$ java -version

Steps to install and configure eclipse for java on ubuntu/linux


1. Download the eclipse IDE for Java using the following link-
2. extract the downloaded tar ball using the following command to  /usr/local

$ sudo tar  -xvzf  eclipse-jee-kepler-R-linux-gtk.tar.gz  -C  /usr/local
3. To execute the eclipse from any directory type the following command on terminal prompt.

4. To run the eclipse type eclipse on terminal prompt and a Workspace Launcher dialog will appear. Select "Use this as the default and do not ask again" and click OK.

5. Eclipse will start up. Either explore the Overview, Tutorials, etc. or close the
    Welcome page by clicking on the white X to reveal the Java perspective, where you will do your programming.


Set up Eclipse to use the latest version of Java for compiling and running your Java programs

1. Set the default installed JRE to java 1.7.0_25  To do this follow the steps-
  • Run the eclipse using eclipse command on terminal.
  • Open the preference pane by going Window->Preferences-->Java-->InstalledJREs
  • Select the java 1.7.0_25 as the default
  • Click OK to save the setting.
2. Set the Java compiler to java1.7.0_25, To do this follow the steps-
  • open eclipse preference pane by going to Window-->Preferences-->Java-->Compiler
  • select the compilation level to 1.7
  • click OK to save the setting
Now the platform is ready to create Java application using Eclipse IDE. Now you can create Java project using eclipse.

Installing Java on Ubuntu


This post will tell you about  How to install the Java on Ubuntu system. Many new user feel difficulty to install Java on Ubuntu system.In this post I will tell you some easy steps to install Java on Ubuntu. 




Note: The following command is tested on bash shell.

1. First step is to check the bit version of your Ubuntu operating system
    by typing the following command on your terminal -

$ uname -a

If the output of commnad is like-

Linux pointer 3.2.0-51-generic-pae #77-Ubuntu SMP Wed Jul 24 20:40:32 UTC 2013 i686 i686 i386 GNU/Linux

Then you have 32bit version of Ubuntu.

And if the output of command something like-

Linux pointer 3.2.0-51-generic-pae #77-Ubuntu SMP Wed Jul 24 20:40:32 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Then you have 64-bit version of Ubuntu.

2. Download the tar ball of your Java version according to your bit version (32 bit vesion 0r 64 bit version of Java) of Ubuntu.

from the given URL -



3. Extract the Java using the command
$ tar -xvzf/Download/jdk1.7.0_25.tar.gz -C /usr/local
//change the location of ~/Download/jdk1.7.0_25.tar.gz from your downloaded location of Java.
4. Set the location of bin directory of Java to PATH environment variable. This step is necessary to make command like java, javac, javadoc executables from any directory without having to type the full path of command,otherwise you will have to write full path to access these command like -
$ /usr/local/jdk1.7.0_25/bin/java
To set the path type the following command on terminal-
sudo gedit /etc/environment
And add the the path of bin directory like
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/local/jdk1.7.0_25/bin"

5.Set JAVA_HOME variable in /etc/profile file.
$ sudo gedit /etc/profile
Add the following line at the and of the file,
JAVA_HOME=/usr/local/jdk1.7.0_25


6. Source the file /etc/profile and /etc/environment to make change effective

source /etc/profile $ source /etc/environment


7. Now type java and javac command from any directory to check weather Java is successfully install or not.

Installing the Tomcat 7 on linux/ubuntu 12.04


Hello friends,

In this post I will tell you about How to setup Tomcat7 in Ubuntu. The version of  Ubuntu which I used to setup tomcat7 is  12.04.



a) Installing tomcat7 server on ubuntu 12.04 using "apt-get"

 1. To install the Tomcat server on your machine, just type the following command in Terminal prompt -

sudo apt-get install tomcat7          

This will install a Tomcat server on your machine.

2. To install Tomcat documentation : The tomcat7-docs package contains Tomcat documentation, packaged as a webapp that you can access by default at http://yourserver:8080/docs. You can install it by entering the following command in the terminal prompt:

sudo apt-get install tomcat7-docs
3. To install Tomcat examples webapps : The tomcat7-examples package  webapps that can be used to test or demonstrate Servlets and JSP features, which you can access them by default at http://yourserver:8080/examples. You can install them by entering the following command in the terminal prompt:

sudo apt-get install tomcat7-examples
4.Tomcat administration webapps : The tomcat7-admin package contains two webapps that can be used to administer the Tomcat server using a web interface. You can install them by entering the following command in the terminal prompt:

sudo apt-get install tomcat7-admin

The first one is the manager webapp, which you can access by default at http://yourserver:8080/manager/html. It is primarily used to get server status and restart webapps.

Access to the manager application is protected by default: you need to define a user with the role "manager-gui" in /etc/tomcat7/tomcat-users.xml before you can access it.

The second one is the host-manager webapp, which you can access by default at http://yourserver:8080/host-manager/html. It can be used to create virtual hosts dynamically.

Access to the host-manager application is also protected by default: you need to define a user with the role "admin-gui" in /etc/tomcat7/tomcat-users.xml before you can access it.


b) Configuration settings of Tomcat server:

Configuration:

Tomcat configuration files can be found in /etc/tomcat7. Only a few common configuration tweaks will be described here, please see Tomcat 7.0 documentation for more.
Changing default ports

1. Port Configuration : By default Tomcat runs a HTTP connector on port 8080 and an AJP connector on port 8009. You might want to change those default ports to avoid conflict with another application on the system. This is done by changing the following lines in /etc/tomcat7/server.xml:


<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
...
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

2. JAVA Configuration : By default Tomcat will run preferably with OpenJDK JVMs, But we can change this default JVM and can set it with SUN JAVA or Oracle JAVA. WE can force Tomcat to use a specific JVM by setting JAVA_HOME in /etc/default/tomcat7:

JAVA_HOME=/usr/lib/jvm/java-6-sun
 or
JAVA_HOME=/usr/local/jdk1.7.0_25/jre

3. Configuring users role : User names, passwords and roles (groups) can be defined centrally in a Servlet container. This is done in the /etc/tomcat7/tomcat-users.xml file:

<role rolename="admin"/>
<user username="tomcat" password="passwd" roles="admin"/>


After installing the tomcat7 using "apt-get" tomcat create following directory on Ubuntu:

1. /etc/tomcat7/  /contains configuration files., tomcat-users.xml ,server.xml catalina.policy */

2. /usr/share/tomcat7 /* Main Tomcat folder containing scripts and links to other directories* /

3. /usr/share/tomcat7-root/

4. /usr/share/doc/tomcat7

5. /usr/share/tomcat7-examples /* contains some built in exaple for testing            purpose */

6. /var/cache/tomcat7  /* contains catalina and catalina.policy. */

7. /var/lib/tomcat7/webapps /* where we deploy our web app. */

8. /var/log/tomcat7  /* contains log file related to tomcat server */

9. /usr/share/tomcat7/bin contains many binary like startup.sh, shutdown.sh ,version.sh

The tomcat comes with alredy deployed 5 app:
    The default home page: http://localhost:8080/
    Tomcat 7's local documentation: http://localhost:8080/docs/
    Examples of Servlets and JSP: http://localhost:8080/examples/
    The host-manager to handle virtual hosts: http://localhost:8080/host-manager/
    The manager to administer web applications: http://localhost:8080/manager/html



Deploy and handle web applications :

 The GUI way:

 The easiest way is to use the manager webapp http://localhost:8080/manager/html. Use the username/password you defined as manager in tomcat-users.xml. Once logged in you can see five already deployed web applications. Add yours through the "Deploy" area and then stop/start/undeploy it with the "Applications" area.


Directory Structure in linux system

This article will teach you about  directory structure on Linux OS. Because user comes from Windows environment have problem to understand what the different directory stands for in Linux.  since every standard directory in the Linux have special meaning and it store data according to its meaning. 

There is a list of different standard Linux directory with it's meaning.
  1. /- The Root directory
  2. /bin Directory
  3. /usr/bin
  4. /boot
  5. /dev
  6. /etc
  7. /lib
  8. /mnt
  9. /root
  10. /sbin
  11. /tmp
  12. /usr
  13. /usr/local 
Linux File System



/ – The Root Directory : Everything on your Linux system is located under the "/" directory, known as the root directory. This is where the Linux system begins. Every other file and directory on your system is under the root directory.

/bin – Essential Binaries : The /bin directory contains the essential user binaries (programs) that must be present when the system is mounted in single-user mode. The /bin directory contains the most important programs that the system needs to operate, such as the shells, kill,mv,rmdir,ls,grep  and other essential things.
/usr/bin : The /usr/bin contains applications for the system's users. like installed application java, eclipse,
  
/boot : The /boot directory contains the files needed to boot the system – for example, the GRUB boot loader’s files and your Linux kernels are stored here
This is the place where linux kernel loaded. when you try to list /boot partion in 
ubuntu you see vmlinuz, which is kernel image.

/dev – Device Files : Since in linux everything is file. so in linux device is also file and the /dev directory contains a number of special files that represent devices. These are not actual files as we know them, but they appear as files – for example, /dev/sda represents the first SATA drive in the system. If you wanted to partition it, you could start a partition editor and tell it to edit /dev/sda.

/etc – Configuration Files : The /etc directory contains configuration files. Note that the /etc/ directory contains system-wide configuration files.
for example
 /etc/passwd file : A file that contains various pieces of information for each user account. This is where the users are defined.

/etc/environment file:The /etc/environment file contains variables specifying the basic environment for all processes.  

/lib : The shared libraries for programs that are dynamically linked. The shared libraries are similar to DLL's on Winblows.The /lib directory contains libraries needed by the essential binaries in the /bin and /sbin folder. Libraries needed by the binaries in the /usr/bin folder are located in /usr/lib.

/mnt : The /mnt directory and its subdirectories are intended for use as the temporary mount points for mounting storage devices, such as CDROMs, floppy disks and USB (universal serial bus) key drives.

/root – Root Home Directory : The /root directory is the home directory of the root user or super user. Instead of being located at /home/root, it’s located at /root.

/sbin : The /sbin directory is similar to the /bin directory. It contains essential binaries that are generally intended to be run by the root user for system administration.

/tmp : This partition store temporary files in the /tmp directory. These files are generally deleted whenever the system is restarted.

/usr : The /usr directory contains applications and files used by users.

/usr/local : This is where we install apps and other files for use on the local machine

some commonly used regular expression every one should know

1. Regular Expression for matching Email
^([a-z0-9_-\.]+)@([a-z0-9-_\.]+)\.([a-z\.]{2,6})$

2. Regular Expression matching User Name

^[a-z0-9-_]{3,16}$

3. Regular Expression for matching URL

^(https?:\ /\ /)([\da-z\._/]+)\??[a-zA-z-0-9\._=&/]*$




4. Regular Expression matching IPv4

^([0-1][0-9]?[0-9]?|2[0-5]?[0-4]?|([3-9])[0-9]?)\.([0-1][0-9]?[0-9]?|2[0-5]?[0-5]?|([3-9])[0-9]?)\.([0-1][0-9]?[0-9]?|2[0-5]?[0-5]?|([3-9])[0-9]?)\.([0-1][0-9]?[0-9]?|2[0-5]?[0-5]?|([3-9])[0-9]?)$

                                     or

^([0-1][0-9]?[0-9]?|2[0-5]?[0-4]?|([3-9])[0-9]?)\.(([0-1][0-9]?[0-9]?|2[0-5]?[0-5]?|([3-9])[0-9]?)\.){2}([0-1][0-9]?[0-9]?|2[0-5]?[0-5]?|([3-9])[0-9]?)$

Matching HTML/XHTML/XML Tag using RegularExpression

Punctuation Character in ASCII Encoding

The punctuation characters in the ASCII table are:
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~.
Some character have special meaning in regular expression. These character are given below-
$()*+.?[\^{|  /*These 12 punctuation character known as "metacharacter " in regular expression */

special meaning of these character in regular expression are given in Tabular form-
Regular Expression Basic Syntax Reference
Characters
CharacterDescriptionExample
Any character except [\^$.|?*+()All characters except the listed special characters match a single instance of themselves. { and } are literal characters, unless they're part of a valid regular expression token (e.g. the {n} quantifier).a matches a
\ (backslash) followed by any of [\^$.|?*+(){}A backslash escapes special characters to suppress their special meaning.\+ matches +
\Q...\EMatches the characters between \Q and \E literally, suppressing the meaning of special characters.\Q+-*/\E matches +-*/
\xFF where FF are 2 hexadecimal digitsMatches the character with the specified ASCII/ANSI value, which depends on the code page used. Can be used in character classes.\xA9 matches © when using the Latin-1 code page.
\n, \r and \tMatch an LF character, CR character and a tab character respectively. Can be used in character classes.\r\n matches a DOS/Windows CRLF line break.
\a, \e, \f and \vMatch a bell character (\x07), escape character (\x1B), form feed (\x0C) and vertical tab (\x0B) respectively. Can be used in character classes.
\cA through \cZMatch an ASCII character Control+A through Control+Z, equivalent to \x01 through \x1A. Can be used in character classes.\cM\cJ matches a DOS/Windows CRLF line break.
Character Classes or Character Sets [abc]
CharacterDescriptionExample
[ (opening square bracket)Starts a character class. A character class matches a single character out of all the possibilities offered by the character class. Inside a character class, different rules apply. The rules in this section are only valid inside character classes. The rules outside this section are not valid in character classes, except for a few character escapes that are indicated with "can be used inside character classes".
Any character except ^-]\ add that character to the possible matches for the character class.All characters except the listed special characters.[abc] matches a, b or c
\ (backslash) followed by any of ^-]\A backslash escapes special characters to suppress their special meaning.[\^\]] matches ^ or ]
- (hyphen) except immediately after the opening [Specifies a range of characters. (Specifies a hyphen if placed immediately after the opening [)[a-zA-Z0-9] matches any letter or digit
^ (caret) immediately after the opening [Negates the character class, causing it to match a single character not listed in the character class. (Specifies a caret if placed anywhere except after the opening [)[^a-d] matches x (any character except a, b, c or d)
\d, \w and \sShorthand character classes matching digits, word characters (letters, digits, and underscores), and whitespace (spaces, tabs, and line breaks). Can be used inside and outside character classes.[\d\s] matches a character that is a digit or whitespace
\D, \W and \SNegated versions of the above. Should be used only outside character classes. (Can be used inside, but that is confusing.)\D matches a character that is not a digit
[\b]Inside a character class, \b is a backspace character.[\b\t] matches a backspace or tab character
Dot
CharacterDescriptionExample
. (dot)Matches any single character except line break characters \r and \n. Most regex flavors have an option to make the dot match line break characters too.. matches x or (almost) any other character
Anchors
CharacterDescriptionExample
^ (caret)Matches at the start of the string the regex pattern is applied to. Matches a position rather than a character. Most regex flavors have an option to make the caret match after line breaks (i.e. at the start of a line in a file) as well.^. matches a in abc\ndef. Also matches d in "multi-line" mode.
$ (dollar)Matches at the end of the string the regex pattern is applied to. Matches a position rather than a character. Most regex flavors have an option to make the dollar match before line breaks (i.e. at the end of a line in a file) as well. Also matches before the very last line break if the string ends with a line break..$ matches f in abc\ndef. Also matches c in "multi-line" mode.
\AMatches at the start of the string the regex pattern is applied to. Matches a position rather than a character. Never matches after line breaks.\A. matches a in abc
\ZMatches at the end of the string the regex pattern is applied to. Matches a position rather than a character. Never matches before line breaks, except for the very last line break if the string ends with a line break..\Z matches f in abc\ndef
\zMatches at the end of the string the regex pattern is applied to. Matches a position rather than a character. Never matches before line breaks..\z matches f in abc\ndef
Word Boundaries
CharacterDescriptionExample
\bMatches at the position between a word character (anything matched by \w) and a non-word character (anything matched by [^\w] or \W) as well as at the start and/or end of the string if the first and/or last characters in the string are word characters..\b matches c in abc
\BMatches at the position between two word characters (i.e the position between \w\w) as well as at the position between two non-word characters (i.e. \W\W).\B.\B matches b in abc
Alternation
CharacterDescriptionExample
| (pipe)Causes the regex engine to match either the part on the left side, or the part on the right side. Can be strung together into a series of options.abc|def|xyz matches abc, def or xyz
| (pipe)The pipe has the lowest precedence of all operators. Use grouping to alternate only part of the regular expression.abc(def|xyz) matches abcdef or abcxyz
Quantifiers
CharacterDescriptionExample
? (question mark)Makes the preceding item optional. Greedy, so the optional item is included in the match if possible.abc? matches ab or abc
??Makes the preceding item optional. Lazy, so the optional item is excluded in the match if possible. This construct is often excluded from documentation because of its limited use.abc?? matches ab or abc
* (star)Repeats the previous item zero or more times. Greedy, so as many items as possible will be matched before trying permutations with less matches of the preceding item, up to the point where the preceding item is not matched at all.".*" matches "def" "ghi" in abc "def" "ghi" jkl
*? (lazy star)Repeats the previous item zero or more times. Lazy, so the engine first attempts to skip the previous item, before trying permutations with ever increasing matches of the preceding item.".*?" matches "def" in abc "def" "ghi" jkl
+ (plus)Repeats the previous item once or more. Greedy, so as many items as possible will be matched before trying permutations with less matches of the preceding item, up to the point where the preceding item is matched only once.".+" matches "def" "ghi" in abc "def" "ghi" jkl
+? (lazy plus)Repeats the previous item once or more. Lazy, so the engine first matches the previous item only once, before trying permutations with ever increasing matches of the preceding item.".+?" matches "def" in abc "def" "ghi" jkl
{n} where n is an integer >= 1Repeats the previous item exactly n times.a{3} matches aaa
{n,m} where n >= 0 and m >= nRepeats the previous item between n and m times. Greedy, so repeating m times is tried before reducing the repetition to n times.a{2,4} matches aaaa, aaa or aa
{n,m}? where n >= 0 and m >= nRepeats the previous item between n and m times. Lazy, so repeating n times is tried before increasing the repetition to m times.a{2,4}? matches aa, aaa or aaaa
{n,} where n >= 0Repeats the previous item at least n times. Greedy, so as many items as possible will be matched before trying permutations with less matches of the preceding item, up to the point where the preceding item is matched only n times.a{2,} matches aaaaa in aaaaa
{n,}? where n >= 0Repeats the previous item n or more times. Lazy, so the engine first matches the previous item n times, before trying permutations with ever increasing matches of the preceding item.
Regular Expression related to html/xml/xhtml Document.
a) Quick and Dirty: This is the most comman , simple and widely used regular expression to match (x)html and xml tags
          <[^>]*>
b) Allows '>'  in attributes value :It’s advantage over the previous regex is that it correctly passes over > charactersthat appear within attribute values:
<(?:[^>"']|"[^"]*"|'[^']*')*>
It’s time for a few examples. The “Quick and dirty” regex matches each of the following
lines in full:
• <div>
• </div>
• <div>
• <div id="pandoras-box" />
• <!-- comment -->
• <!DOCTYPE html>
• << < w00t! >
• <>
But what about the  the lines which are given below:
<input type="button" value=">>">
OR
<input type="button" onclick="alert(2>1)">.
This type of  problem can solved by (b)Allow > in attributes value

How to create a Dynamic Javascript Bookmarklet

Hello Friends,

In The previous post I was tell you about How to create Bookmarklet. In This post I will tell you how to create a Bookmarklet using Dynamic  JavaScript.

Inline JavaScript had some limitation like we can only use 2000 character in inline JavaScript or direct  JavaScript. Direct JavaScript works fine for small action like redirecting the user to another web page, or searching the selected text using any search engine, changing the background of web page etc.

But when we want to perform any big task against the current web page using Bookmarklet, The limitation of direct JavaScript really hurts.

So today I am going to tell you How to deal such type of situation.

Follow the Insturction
In the Dynamic  JavaScript Bookmarklet we put our JavaScript code in Remote machine.

Our Bookmarklet  just load that remote  JavaScript code into our current web page.
Here's the code
javascript:(function(){
    _my_script=document.createElement('SCRIPT');
  _my_script.type='text/JavaScript';
 _my_script.src='http://192.168.1.100/samparkWithpost_source-tgt-lang.js?x='+(Math.random());
 document.getElementsByTagName('HEAD')[0].appendChild(_my_script);
})
();
this Bookmarklet code just pull down the our remote JavaScript file and add it to our current web page, so now we can add more code on our JavaScript file.

How To Make a Bookmarklet

Hello friends,
Today I am going to tell you about bookmarklet.

What Is bookmarklet ?

Before knowing about bookmarklet let's see What is bookmark/favourite?

As we know that  bookmarks are the saved linked of a web page that has been added to a list of saved link. we can save the link of a web page as a bookmark/favourite just click on the Bookmarks/favourite menu of the browser and say bookmark this page/add to Favourites.

we can give it a name. so next time when we clicked on it, it will  redirect to original web page. its just like to shortcut in Windows and soft link on Linux for retrieving the document.

Regular Bookamrks are the just  location to visit like http://www.facebook.com.

Bookmarklet are the javascript code that runs on the current web page to extend the functionality of browser and they marked by javascript:  instead of http://.  For instance, A bookmarklet can allow user to select the text (ex Punjabi text) from current web page and click on bookmarklet and get a translated text(Hindi text) .
Bookmarklet are the browser independent we can use same Bookmarklet in different Browser.
To add bookmarklet in different Browser--------

Firefox user just drag and drop Bookmarklet link into bookmarks toolbar .

IE user right click on the Bookmarklet link and add favourite.

chrome user just drag and drop Bookmarklet into bookmark bar.

How to create a Bookmarklet ?

There are some easy steps to create bookmarklet --

1. Create an HTML file and inside "<body >" tag place <a> tag and write your JavaScript code

sample example:

A simple Bookmarklet looks like this:

<a href="javascript:alert('hi');">sampark</a>

2. Open your page in the browser  and just drag and drop this Bookmarklet link on Bookmarks toolbar.

Now your Bookmarklet is the part of your browser and script behind it run on current web page.

A template for creating bookmarklets

Below are two basic outlines for creating your own bookmarklet. The main choice you will have to make is whether to disable caching for your JavaScript file.

Template 1: caching

Template one does not prevent caching. This means your script will be saved to the user’s computer for some period of time. It will eventually be reloaded, but you have no way of knowing how soon. Here is the template:
javascript:(function(){
 new_script=document.createElement('SCRIPT');
 new_script.type='text/javascript';
 new_script.src='http://www.your-site.com/script.js?';
 document.getElementsByTagName('head')[0].appendChild(new_script);
})();

Template 2: caching disabled

This alternative includes a handy parameter to prevent caching of your script. This is ideal for development because every time you use the link, it will run the latest version on the server.

javascript:(function(){ new_script=document.createElement('SCRIPT'); new_script.type='text/javascript'; new_script.src='http://www.your-site.com/script.js?x=' +(Math.random()); document.getElementsByTagName('head')[0].appendChild(new_script); })(); The cache is disabled simply by adding a random query string to the end of the script tag.

This makes the browser load the script each time it is used.
The post will continue.

Dynamic JavaScript Bookmarklet

Hide your personal data behind the image both in Windows AND Linux

Sometimes we want to hide our data due to security reason or some personal reason from other persons in our computer/Laptop so no one can access this data. for this we generally uses hidden property of files in Windows or create a file or folder using dot (.) in Unix or Linux operating system, but this isn't a safest way to hide your data.





Today I am going to tell you, How hide your data behind image. In this trick we hide  our data behind an image. So next time when other user will use your Laptop, He can not access your data, because you hide your data behind image.

Steps:

1. Compress your data in .rar ball using winrar or any other  utility.

2. Copy both  .rar ball and Image (the image behind which you want to hide your  data) on desktop(for example, you can put anywhere)

3. Open the command prompt and type the following command
    "copy /b my.jpg+mydata.rar  hidden.jpg"

where

my.jpg ->The image behind which you want to hide your data.

mydata.rar-> files or folder converted into .rar ball, which you want to hide.

hidden.jpg ->output which hides your data.

For unix users try this

cat  my.jpg  mydata.zip >  hidden.jpg

Accessing hidden data.

To access hidden data just unzip or unrar your file and you get your original data file.