Web Application Developers Toolbox
Tuesday, January 27, 2026
What are the weaknesses of developing a web application in react instead of using jQuery with html5 and a python backend ?
Sunday, May 15, 2022
Windows recovery drive
That means you can’t roll back or reinstall Windows the normal way either.
As a safety net should something go seriously wrong with your PC, youmust create a Windows recovery drive on a spare USB stick.
How?
Open the Start menu, and search for “create a recovery drive”. This will bring up the right utility.
Follow the instructions on screen to copy over the necessary files to your chosen USB drive, but note that these files won’t include your personal files and data.
If disaster strikes, you’ll need to boot up from your recovery drive.
This is usually done by holding down the Delete or F8 keys while your PC starts.
Opt to boot from your USB drive, then pick Troubleshoot > Advanced Options > Recover from a drive to get Windows reinstalled.
Sunday, March 9, 2014
Rename an Android project in Eclipse
Right click the project, and press F2.
You will get a Dialog box which will let you rename the project alongwith the option to update references
Alternatively,
Right click on your project
In the menu that menu that appears, Select "Refactor"
In the menu that appears, Select "Rename"
You will get a Dialog box which will let you rename the project alongwith the option to update references
Saturday, August 24, 2013
Setting Up Name Based Virtual Hosting in Apache on Ubuntu
Virtual Hosts are used to run more than one site off of a single IP address. If you want to be able to handle more than one domain with one web server, you'll need to set up a virtual host for each. Here I will show you how to work with Virtual Hosts by setting up 2 different sites on a single apache installation using virtual hosts.
As an example, let us assume we are setting up 2 sites www.testwadt.com and www.testwadt.net
Create 2 separate folders where we will place the files which will serve the 2 sites. Let do this in the /var/www folder
mkdir /var/www/testwadt_com
mkdir /var/www/testwadt_net
Now for each of the 2 domains, put the files in the respective folders created for the same
Also create a log folder in each of the 2 folder created above
mkdir /var/www/testwadt_com/log
mkdir /var/www/testwadt_net/log
Now we need to define to Apache that we’re using name based virtual hosting instead of IP based. You can append the following line to your /etc/apache2/apache2.conf to define this:
NameVirtualHost ip.address:port
typically this would be
NameVirtualHost :80
The next step is to set up Virtual Hosts. Each virtual host needs its own file in the /etc/apache2/sites-available/ directory.
This allows for a clear and specific per-site configuration.
So lets create files for the two sites we wish to host: testwadt.com and testwadt.net
First lets create a file testwadt.com in /etc/apache2/sites-available
vi /etc/apache2/sites-available/testwadt.com
In the file place the following:
# domain: testwadt.com
# public: /var/www/testwadt_com
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin youremail@youremailprovider
ServerName www.testwadt.com
ServerAlias testwadt.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/testwadt_com
# Log file locations
LogLevel warn
ErrorLog /var/www/testwadt_com/log/error.log
CustomLog /var/www/testwadt_com/log/access.log combined
</VirtualHost>
Now lets create the 2nd file testwadt.net in /etc/apache2/sites-available
vi /etc/apache2/sites-available/testwadt.net
In the file place the following:
# domain: testwadt.net
# public: /var/www/testwadt_net
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin youremail@youremailprovider
ServerName www.testwadt.net
ServerAlias testwadt.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/testwadt_net
# Log file locations
LogLevel warn
ErrorLog /var/www/testwadt_net/log/error.log
CustomLog /var/www/testwadt_net/log/access.log combined
</VirtualHost>
What these settings do is as follows:
ServerName listens for requests asking for a certain domain
ServerAlias defines any additional domains that should match
ServerAdmin is the contact for the site
DocumentRoot is the path to the content for that site
Now that this file is created in the /etc/apache2/sites-available/ folder we’re just about ready to start, but we need to enable it. We can do that by creating a symbolic link in /etc/apache2/sites-enabled/
This is done by calling the a2ensite command
a2ensite testwadt.com
a2ensite testwadt.net
Finally, restart the Apache server to initialize all the changes
/etc/init.d/apache2 restart
Files that configure virtual hosts should be located in the /etc/apache2/sites-available/ directory.
The files should be symbolically linked to sites-enabled/ with the a2ensite tool.
Tuesday, May 14, 2013
Create a Git Repository from an existing non-empty directory and Push Files to a Remote Repository
Run the following commands
git init
git add .
git commit -m 'Initialized my Git Repo'
Get the url of your remote repository.
For E.g in case the url is https://xyz@bitbucket.org/xyz/sample_repo.git
Run the following commands
git remote add origin https://xyz@bitbucket.org/xyz/sample_repo.git
git push -u origin master
Tuesday, February 12, 2013
Bookmarklets
Technically, a bookmarklet is unobtrusive script written in JavaScript and stored as the URL of a bookmark in a web browser or as a hyperlink on a web page.
Bookmarklets are saved and used as normal bookmarks. As such, they are simple "one-click" tools which add functionality to the browser.
For example, they can:
Modify the appearance of a web page within the browser (e.g., change font size, background color, etc.)
Extract data from a web page (e.g., hyperlinks, images, text, etc.)
Submit the current page to a curation service such as minus, scoop.it, link-shortening service such as bit.ly, or bookmarking service such as Delicious
Query a search engine or online encyclopedia with highlighted text or by a dialog box
Submit the current page to a link validation service or translation service
Set commonly chosen configuration options when the page itself provides no way to do this
"Installation" of a bookmarklet is performed by creating a new bookmark, and pasting the code into the URL destination field. Alternatively, if the bookmarklet is presented as a link, under some browsers it can be dragged and dropped onto the bookmark bar. The bookmarklet can then be run by loading the bookmark normally.
When clicking a bookmarklet, imagine the page author wrote <script>bookmarklet code here</script> — it can do almost anything. There are a few restrictions:
- Restricted length: Most URLs have a limit around 2000 characters, which limits the amount of code you can run.
- No spaces allowed: Some browsers choke on spaces in a URL, so yourcodelookslikethis.
