- Go to Start => Control Panel
- Click on Network and Internet
- Click on Network and Sharing Center
- Click on Change adapter settings
- Select the required network, right click on it and select Properties
- Select Internet Protocol Version 4(TCP/IPv4) and click on Properties
- Select Obtain an IP address automatically and click on Ok
- Repeat the same for Internet Protocol Version 6(TCP/IPv6) if required and then click on Close
Sunday, October 5, 2014
Connecting to a new wireless network - settings in windows 7
Labels:
Windows 7
Thursday, August 21, 2014
Saturday, August 9, 2014
Complile and run java programs in command prompt
javac file_name.java
java -cp . class_name
Labels:
Java
Monday, June 9, 2014
Reset admin password in drupal 7
The password reset method described below uses a PHP script that must be uploaded to the web server to reset the administrator password. The ability to upload a PHP file to the server where the site is hosted is required for successful execution of this method.
Under the hood, the PHP script executes a full Drupal bootstrap in order to obtain access to the necessary functions that generate the administrative password and then update the database with the new password that you specify via the URL when you execute the script through the web browser.
Note: leaving this password reset script on your server after resetting the password constitutes a highly critical security hole that enables anyone to reset your administrator password. Use this script carefully, and always delete the script after you're finished using it.
Finally, delete the file from the Drupal installation root directory.
Ref: https://drupal.org/node/1556488
Under the hood, the PHP script executes a full Drupal bootstrap in order to obtain access to the necessary functions that generate the administrative password and then update the database with the new password that you specify via the URL when you execute the script through the web browser.
Note: leaving this password reset script on your server after resetting the password constitutes a highly critical security hole that enables anyone to reset your administrator password. Use this script carefully, and always delete the script after you're finished using it.
- First, create a file with a random name (gh34tu9.php for example)
- Copy and paste the following contents into the file, and save the file
- Upload the file to the root of the Drupal installation directory (i.e., where index.php, update.php, robots.txt and other files and directories exist)
- Execute the script, by requesting the file in a web browser using the following URL pattern:
- In the above URL,
- replace example.com with your actual domain name,
- replace gh34tu9.php with the actual file name that you specified in step one above,
- replace mypassword with the desired new password.
fields(array(
'pass' => $newhash,
// Uncomment the following lines to reset the administrative username and/or email address, if necessary.
// 'name' => 'admin',
// 'mail' => 'yourmail@example.com'
))
->condition('uid', '1', '=')
->execute();
print "Done. Please delete this file immediately!";
drupal_exit();
?>
http://example.com/gh34tu9.php?pass=mypassword
Finally, delete the file from the Drupal installation root directory.
Ref: https://drupal.org/node/1556488
Labels:
Drupal
Tuesday, May 6, 2014
Fix Windows 7 not genuine error
- Open command prompt as Administrator
- Type the below command and press Enter to execute
- Turn off the computer and boot. The error message will be vanished now.
SLMGR – REARM
Labels:
Windows 7
Tuesday, March 25, 2014
Kill a process on a port in ubuntu
sudo kill `sudo lsof -t -i:8080`If the above does not work, trysudo kill $(sudo lsof -t -i:8080)
Labels:
Ubuntu
Monday, March 24, 2014
Install tomcat 7 manually in ubuntu and integrate with eclipse
- Download Tomcat 7 tar.gz
- Run the following commands
- Add following two lines after the first line and close gedit after saving the changes
- To integrate with eclipse
- Start the Tomcat server using following command to check if it is working
- Stop the server by pressing ctrl+c
- To change the port number, open server.xml in gedit
- Change all the occurrences of
to - Verify installation at: http://localhost:8081/
cd /path/to/downloaded/file
tar xvzf apache-tomcat-7.0.52.tar.gz
sudo mv apache-tomcat-7.0.52/ /usr/share/tomcat7
sudo gedit /usr/share/tomcat7/bin/catalina.sh
JAVA_HOME="/usr/lib/jvm/java-6-openjdk-i386"
JRE_HOME="/usr/lib/jvm/java-6-openjdk-i386/jre"
cd /usr/share/tomcat7
sudo ln -s /var/lib/tomcat7/conf conf
sudo ln -s /etc/tomcat7/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat7 log
sudo chmod -R 777 /usr/share/tomcat7/conf
sudo /usr/share/tomcat7/bin/catalina.sh run
sudo gedit /usr/share/tomcat7/conf/server.xml
Sunday, March 23, 2014
Configure tomcat 6 for eclipse in ubuntu
- Install tomcat 6 in ubuntu by running the below commands
- In the eclipse main menu go to Help ->Install New Software...
- Make the settings as below by selecting the highlighted plugins under Web, XML, Java EE and OSGi Enterprise Development select option
- Select Windows -> Preferences -> Server -> Runtime Environments
- Click on Add…
- Select "Apache Tomcat v6.0" and click on Next
- Enter “/usr/share/tomcat6″ into the “Tomcat installation directory” field
- Click Ok
- Now Right click on your project and Run As -> Run on Server
sudo apt-get update
sudo apt-get install tomcat6
sudo service tomcat6 stop
cd /usr/share/tomcat6
sudo ln -s /var/lib/tomcat6/conf conf
sudo ln -s /etc/tomcat6/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat6 log
sudo chmod -R 777 /usr/share/tomcat6/conf
Create dynamic web project in eclipse for ubuntu platform
- Install eclipse from Ubuntu Software Center
- Open eclipse and select the required workspace
- In the main menu go to Help->Install New Software...
- Make the settings as below by selecting the highlighted plugins under Web, XML, Java EE and OSGi Enterprise Development select option
- Make sure to select 'All Available Sites' in the dropdown
- Now on click of File->New->Project.. a select wizard shows up
- Scroll down to find Web option. Click on the arrow to find 'Dynamic Web Project' option. Click on it to create a new Dynamic Web Project
Labels:
Eclipse
Wifi not working in ubuntu
- Connect to a wired internet connection to first install the additional drivers.
- Check if all the hardware drivers are installed. Go to System Settings -> Additional Drivers (Under Hardware Group). It will automatically check for missing drivers and ask to activate.
- If the above method does not work, go to Ubuntu Software Center and type 'additional drivers' in the search box. There will be results like Additional Drivers (jockey-kde) and Additional Drivers (jockey-gtk). Make sure both are installed.
- Go to Network Connections either from Dash Home or by clicking the network icon at the top right menu of the desktop.
- Under Wireless tab click on 'Edit...' if the connection details has already been added else click on 'Add'.
- Under Wireless tab enter SSID as given by your internet provider. Leave all the other settings as is. Make sure 'Connect automatically' is checked.
- Then under Wireless Security tab, select WEP for Security dropdown and enter the key as given by your internet provider. Leave all the other settings as is.
- After the changes click on Save.
- Wifi connections must now be detected automatically.
Labels:
Ubuntu
Thursday, March 6, 2014
Resize an existing virtualbox hard drive in guest windows xp using host windows 7
- Create a new hard disk
- Click on Settings in virtualbox
- Select Storage tab
- Click on Add Hard Disk icon
- Set a sufficient amount of dynamically expanding disk space
- Clone your old hard disk
- Check the location of VBoxManage and your old hard disk .vdi file [ex: in my computer i have VBoxManage at G: and old_hard_disk.vdi at C:\Users\acer\VirtualBox VMs\old_hard_disk_dir\old_hard_disk.vdi]
- Open up cmd in windows 7, go to the location of VBoxManage and type as below:
- You see something like this:
- Replace the old guest hard disk with your new hard disk (i.e. new_hard_disk.vdi)
- Go to the settings for the guest VM and choose the “Storage” options
- Select the new disk created and make it IDE Primary Slave under the Attributes column
- Select the old disk and remove it by clicking on - icon at the bottom
- Start the guest os i.e windows xp
- Resize the Guest File System
- Install partition manager tool in windows xp
- Select the newly created drive. Right click on it and select Resize Partition
- Follow on screen instructions to finish the partitioning
- Restart the guest os if required
C:\Users\acer>G:
G:\>VBoxManage clonehd "C:\Users\acer\VirtualBox VMs\old_hard_disk_dir\old_hard_disk.vdi" "C:\Users\acer\VirtualBox VMs\old_hard_disk_dir\new_hard_disk.vdi" --existing
Oracle VM VirtualBox Command Line Management Interface Version 3.2.12
(C) 2005-2010 Oracle Corporation All rights reserved.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: ee28ab8b-8232-4c76-8c1b-184afdd1dd27
Labels:
Virtualbox,
Windows,
Windows 7
Tuesday, March 4, 2014
Eclipse menus are cut off in ubuntu 13.10
- Open your eclipse.desktop file
- Replace the Exec= line with this
- Save the file
sudo -H gedit /usr/share/applications/eclipse.desktop
Exec=env UBUNTU_MENUPROXY= eclipse
(If you can't find it in this path, try in ~/.local/share/applications/eclipse.desktop. Otherwise, you could have to find yours using locate command).
NOTE: If you can't find your eclipse.desktop file, you can simply create one from scratch in the above path, and fill it with these lines:
[Desktop Entry]
Type=Application
Name=Eclipse
Icon=eclipse
Exec=env UBUNTU_MENUPROXY= eclipse
Terminal=false
Categories=Development;IDE;Java;
Friday, February 28, 2014
Install ubuntu in external hard drive using windows 7
- Create a bootable usb[ex: pendrive] or disc[ex: cd/dvd] which contains the iso
- Insert the external hard drive into usb slot and start windows 7 and immediately get to the boot menu by pressing F12 and select the bootable pendrive/cd/dvd
- Follow the on screen instructions when ubuntu loads
- Choose 'Something else' option when asked while installing
- Carefully choose the external hard drive. The naming could be something like sdb/sdc.. etc.
- After that under the selected drive, make the below partitions by clicking + button:
- swap - select type as 'Swap Area' from the dropdown and size as 4000 MB(4GB)
- home - select type as 'ext4' [probably this is the default option], mount point as '/home' and size as required [ex: 4000 MB(4GB)]
- root - select type as 'ext4' [probably this is the default option], mount point as '/' and size as required [ex: 8000 MB(8GB)]
- Select 'Device for boot loader installation' as the external hard drive [ex: /dev/sdb HD(16GB)]
- Then click on 'Install Now'
- Follow the onscreen instructions during the setup
- Finally when it asks for 'Restart' do a restart by removing the pendrive/cd/dvd and get into the boot menu and select the external hard disk
- It should now boot from Ubuntu
Monday, February 10, 2014
Banner slider not showing up in homepage in magento
Set the start date for the banners 1 day earlier than the day you created the slider.
Labels:
Magento
Friday, February 7, 2014
Ubuntu desktop console
To work in ubuntu desktop console press
ctrl + alt + F1
To revert back to gui mode press
ctrl + alt + F7
or
alt + F7
or
ctrl + alt + F8
Labels:
Ubuntu
Wednesday, January 22, 2014
Method overloading in codeigniter / php
Correct way to overload a method in codeigniter/php:
function mymethod($id = null)
{
if (isset($id))
{
echo "My method with one parameter";
}
else
{
echo "My method with no parameters";
}
}
The above method can be invoked by:
mymethod();
mymethod(true);
Labels:
Codeigniter,
PHP
Subscribe to:
Posts (Atom)


















