Search blog

Wednesday, December 31, 2014

Installing LastPass in Chromium in Ubuntu/Linux

To install LastPass in Chromium & Linux enter the commands below:

First download LastPass from here: https://lastpass.com/lplinux.php

Then open terminal using CTRL+ALT+T and go to the directory you've downloaded the LastPass tar and untar it and enter the command below:
 sudo tar -xvzf lplinux.tar.bz2  

 sudo ./install_lastpass.sh  

Sunday, December 28, 2014

Unable To Import Or Upload SQL Dump, Database in phpMyAdmin

If you are unable to import or upload your database dump into your phpMyAdmin and have been getting the following error:
No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration.
You can try the following code to resolve the issue:

 chmod -R 777 /var/lib/phpmyadmin/tmp  

Restart Apache:

 sudo service apache2 restart  

Thursday, December 18, 2014

How To Resize Virtual Hard Disk Size In Ubuntu

If you are running out of Virtual Hard Disk space in your VirtualBox environment and looking to increase space - follow the instructions below:

Syntax:
 sudo VBoxManage modifyhd "vdi location" --resize "new size in MB"  
Example:
 sudo VBoxManage modifyhd '/home/evagabond/VirtualBox VMs/Windows/Windows 7 (x64)/Windows 7 (x64).vdi' --resize "61440"  
Please note that if your location address contains spaces it's better you insert it within single quotes as I've done in the above example to avoid error in the terminal.

Finally if successful you should get result as below:

Click on image to enlarge

Now you will need to resize/expand your VHD partition using a Partition Software or Windows Default Partition Manager. I have used a free software called MiniTool Partition Wizard which you can download here: http://www.partitionwizard.com/download.html

Follow the instructions in the image below to finally expand your partition:

Step 1:


 Click image to enlarge
Step 2:

Click image to enlarge 
Step 3:

Click image to enlarge

Wednesday, December 17, 2014

Download all the Ubuntu Community Wallpapers from Karmic Koala (9.10) to Trusty Tahr (14.04)

Open your terminal (CTRL+ALT+T) and COPY/PASTE the commands below:

 sudo apt-get install ubuntu-wallpapers-karmic ubuntu-wallpapers-lucid ubuntu-wallpapers-maverick ubuntu-wallpapers-natty ubuntu-wallpapers-oneiric ubuntu-wallpapers-precise ubuntu-wallpapers-quantal ubuntu-wallpapers-raring ubuntu-wallpapers-saucy ubuntu-wallpapers-trusty  

If you get ERRORS as below just remove those download commands of the wallpapers giving the error from the above command. In my case it was quantal, raring and trust and try again. 

 E: Unable to locate package ubuntu-wallpapers-quantal  
 E: Unable to locate package ubuntu-wallpapers-raring  
 E: Unable to locate package ubuntu-wallpapers-trusty  

Here's how you can download the wallpapers from Ubuntu 14.04 Trusty Tahr.

1. Open a terminal window.

2. Type in the following commands then hit Enter after each:

 wget https://launchpad.net/~atareao/+archive/atareao/+files/trusty-tahr-wallpaper-contest_0.0.1-0extras14.04.0_all.deb  

You might get an error as below related to 'Secure Certificate.'

 ERROR: cannot verify launchpad.net's certificate, issued by `/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure Certificate Authority - G2':  
  Unable to locally verify the issuer's authority.  
 To connect to launchpad.net insecurely, use `--no-check-certificate'.  

If so COPY/PASTE the command below and hit Enter:

 wget https://launchpad.net/~atareao/+archive/atareao/+files/trusty-tahr-wallpaper-contest_0.0.1-0extras14.04.0_all.deb --no-check-certificate  

Again COPY/PASTE the command below and hit Enter:

 sudo dpkg -i trusty-tahr-wallpaper-contest_0.0.1-0extras14.04.0_all.deb  

All the wallpapers are under /usr/share/backgrounds/ and they should show up automatically under System Settings & Appearance)


Monday, December 15, 2014

[SOLVED] - The disk drive for /tmp is not ready yet or is not present - Ubutntu 12.04

Just press Ctrl + Alt + T on your keyboard to open Terminal. When it opens, run the command(s) below:

 sudo mv /tmp /tmp_old  
 sudo mkdir /tmp  
 sudo chmod 1777 /tmp  

Reboot, and it should be resolved.

Sunday, December 14, 2014

Connect USB Wireless Adapter to Kali Linux in Virtualbox


[SOLVED] - HOW TO FIX: W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw

While trying to update initramfs I encountered an error which took me quite sometime to fix. After trying various solutions this is what worked for me.

ERROR: 
 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw for module r8169  
 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-1.fw for module r8169  

You can do a (Open your terminal & check):
 sudo update-initramfs -u  

To see if you have this problem.

Next Check which Realtek chipset you have using: 
 lspci  

If you have an r8168 chipset go here:

Find the "r8168-8.039.00" drivers for Ubuntu/Linux in the 'Unix (Linux)' section of the page.

Download the r8168-8.039.00.tar.bz2 file to your linux box.

In the terminal go to the directory where you've downloaded the above file & Unpack the tarball :
 tar vjxf r8168-8.aaa.bb.tar.bz2  

Change to the extracted/unzipped directory:
 cd r8168-8.039.00  

If you are running the target kernel, then you should be able to do :
 sudo ./autorun.sh  

finally do another 
 sudo update-initramfs -u  

to make sure the error goes away

reboot

Friday, December 12, 2014

Update 12.04 (precise) to Java 7 (OpenJDK)

Q: By default, Ubuntu 12.04 comes with OpenJDK 6, which is by now quite old and some applications require at least Java 7. How can I update an Ubuntu 12.04 installation to Java 7?

The Ubuntu 12.04 repositories contain both version 6 and 7 of the JDK, but by default only version 6 is installed.

To update, it is best to use the Synaptic package manager – if you don’t have it, install it with sudo apt-get install synaptic.
  • Note: Ensure that Java 7 packages are selected before deselecting any Java 6 packages – else Synaptic will deselect anything that depends on Java (including any Java applications)!
  • Search for icedtea and select icedtea-7-plugin for installation. This may select some Java 7 dependencies.
  • Now search for openjdk and deselect openjdk-6 as well as openjdk-6-jre. This may deselect some further packages.
  • If you had openjdk-6-jdk installed, make sure it is now selected for removal and openjdk-7-jdk is selected for installation. (You can skip this step if openjdk-6-jdk is not selected, meaning it was never installed.)
  • Click Apply and review your package selections:
    • default-jre packages are metapackages which are safe to remove in this process.
    • icedtea-7-jre-cacao is a dummy package, therefore it it OK to remove icaedtea-6-cacao without installing a replacement.
    • For any other Java/IcedTea 6 package that is removed, you should be installing the Java 7 equivalent.
    • Packets to be selected for removal should include the following:
      • default-jre
      • default-jre-headless
      • icedtea-6-jre-cacao
      • icedtea-6-jre-jamvm
      • openjdk-6-jre openjdk-6-jre-headless
      • openjdk-6-jre-lib
    • Instead, the following should be installed:
      • icedtea-7-jre-jamvm
      • icedtea-7-plugin
      • openjdk-7-jre
      • openjdk-7-headless
      • openjdk-7-lib
    • If any packages are missing, go back and select them manually. When everything is OK, install.
From a console, run java -version. If you have JDK installed, also run javac -version. Both should now report version 1.7.0.

How To Create Swap Partition/Space Using Gparted Partition Editor in Ubuntu



 First make sure you have some unallocated space on the left or right of the main partition where your Ubuntu is installed as the figure above.

Now lets evaluate the formula for creating the appropriate swap file. Below is a good explanation:

"I would say a good rule of thumb is indeed just as was mentioned above. 2 times the physical memory. Something to consider here, while it is possible to use a smaller swap partition, and it will suffice under most normal circumstances, if you want this system to be rock solid stable, I would indeed follow the 8 GB recommendation. In fact I recommend 2 * RAM + 1 MB so that there is absolutely room to swap out 2 entire copies of memory. This avoids the "shell game" scenario which can have negative performance repercussions. What this will do for you is guarantee a level of resiliency should you encounter an extraordinary event with your system.

I've seen scenarios where applications behave badly in unattended environments and before you know it, your system starts slowing down to a crawl.

Depending on what you are doing, you might even be able to dispense with the swap file entirely. The extra space for the OS is handy when running many applications at once. However if you only intend to run a few processes, do not intend to interact with the GUI disabling the swap file might be appropriate.

But if you are going to have a swap file I always use the sizing formula below.

 [(2 x RAM) + 1 MB] = Swap File Size  

I also recommend putting your swap file on a seperate disk whenver possible as this will increase performance as the OS can swap in and out at the same time as read/writes from the data disk.

I hope this is helpful." - Source: http://superuser.com/questions/16280/swap-partition-size-for-4gb-ramhttp://superuser.com/questions/16280/swap-partition-size-for-4gb-ram

Once you have decided on the swap space it's time to create it.

Right click on the unallocated space on your hard drive and click on New. A dialog box as the image below will appear. Make selection as in the image.


Then click on the 'green check icon' - which says 'Apply all operations' and wait.

Once the linux-swap partition is created - once again - Right Click on the 'linux-swap' partition and select Swapon.

But the problem here is this 'swap' turns off after restarting.

So to permanently activate the 'swap partition' follow the steps below:

Activating the swap partition

(If your swap is on your primary hard drive, you don't need to do anything here.) Now you need to find what partition your swap is on and what its UUID is. UUID?! you say? Well that's the Universally Unique IDentifier for the partition so you can reference it even if it's on a different mount point from boot-to-boot due to adding disks, etc.

  1. Pull up a terminal and run
     gksu gparted  
    
    & and enter your root password. The & lets this process run while still giving you access to the command line.
  2. br />
  3. Right-click on your swap partition and choose *Information*. You should see the **Path** and **UUID** listed there. Keep this open for further reference.
  4. Run
     gksu gedit /etc/fstab  
    
    & and look for the line that has *swap* in it. It should be the third column, separated by spaces or tabs. You can either use the path or the UUID to tell Linux where to find your swap partition. I recommend UUID because it'll stay constant even if you move the partition around or the disk somehow becomes sdb instead of sda or something like that. Make the appropriate edits and save the file. Your line should look something like this if you used UUID (with your UUID instead, of course):
    1. UUID=41e86209-3802-424b-9a9d-d7683142dab7 none swap sw 0 0
    2. or this if you used path: /dev/sda2 none swap sw 0 0
  5. Save the file.
  6. Enable the new swap partition with this command.
     sudo swapon --all OR $ sudo swapon --all --verbose  
      swapon on /dev/sda2 
     swapon: /dev/sda2: found swap signature: version 1, page-size 4, same byte order  
      swapon: /dev/sda2: pagesize=4096, swapsize=2147483648, devsize=2147483648  
    
  7. Confirm that the swap partition exists.
     $ cat /proc/swaps   
     Filename                Type      Size  Used  Priority  
     /dev/sda2                partition    2097148 0    -1  
    
  8. Reboot to make sure the new swap gets activated properly at startup.

Wednesday, December 10, 2014

Changing Folder Permission in Ubuntu 12.04

Use chown to change ownership and chmod to change rights.

Use the -R option to apply the rights for all files inside of a directory too.

Note that both these commands just work for directories too. The -R option makes them also change the permissions for all files and directories inside of the directory.

For example

 sudo chown -R username:group directory  

will change ownership (both user and group) of all files and directories inside of directory and directory itself.

 sudo chown username:group directory  

will only change the permission of the folder directory but will leave the files and folders inside the directory alone.

You need to use sudo to change the ownership from root to yourself.

Edit:

Note that if you use
 chown user: file  
(Note the left-out group), it will use the default group for that user.

If you prefer, this can be done with a GUI as well. You will need to open Nautilus as root to do so. Press Alt+F2 to access the "Run Applications" dialog and enter
 gksu nautilus  

Next, browse to and right click on the folder you would like to modify. Then, select "Properties" from the context menu. You can now select the user or group that you would like to be the "Owner" of the folder as well as the permissions you would like to grant them. Finally, press "Apply Permissions to Enclosed Files" to apply the changes recursively.



Though it seems this does not always work for some operations in a deep folder tree. If it does not work use the appropriate terminal command.  

Tuesday, December 9, 2014

Using Gparted Partition Editor in Ubuntu to Resize/Expand Partition


I had a hard time trying to figure out as to how to resize my partitions using Gpart. I am currently using Ubuntu 12.04 LTS aka Precise Pangolin.

First it's better you use Gpart from a Live CD/USB. You can do this by using your Ubuntu Installation CD/USB.

So the main thing you will have to note while resizing your partition is there should be unallocated space either at the immediate left or right of your partition. Only then will you be able to expand your partition.

If you don't have Gparted Partition Editor you can install one from the terminal using the following command:
 sudo apt-get install gparted  


- To Extend just select an inactive partition (active partitions are locked).
- Then right click and select Resize/Move.
- Then you can move the arrows on the left and the right to resize/expand.
- Free Space preceding is the free space/unallocated space to the left of your selected partition.
- Free Space following is the free space/unallocated space to the right of your selected partition.
- Then click on Resize/Move.
- Then finally click Apply (The Green Check Icon).

Depending on the size of your partition the operation might execute shortly or take some time.

Tuesday, November 11, 2014

How to turn your Windows 7/8 Laptop into a WiFi Hotspot 2014 - Best Way Without Any Software

If you are looking to create a WiFi Hotspot through your Windows 7 or Windows 8 laptop without using any software, the solution in the video below seems to be  the ideal one. Just execute some command from the command prompt and some setting in 'Network & Sharing Center' and you are done.

But note that once you restart your computer you will have to run this command in CMD to start the HOTSPOT. I still found this much better than some lame software:

Enter this command in CMD to start your Hotspot: netsh wlan start hostednetwork




Friday, September 5, 2014

Drupal cache_rules error, Error: Tablespace for table abc exists. Please DISCARD the tablespace before IMPORT

I got these queer error today with my site viz:

Error #1. 'cache_rules does not exist in database'
Error #2: 'Error: Tablespace for table abc exists. Please DISCARD the tablespace before IMPORT' in XAMPP using phpMyAdmin & MySQL.

There are various ways to fix these errors. I've listed them below:

Solution 1. Manually create the table using the following SQL query:

DROP TABLE cache_rules ;
CREATE TABLE IF NOT EXISTS `cache_rules` (
  `cid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.',
  `data` longblob COMMENT 'A collection of data to cache.',
  `expire` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
  `created` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry was created.',
  `serialized` smallint(6) NOT NULL DEFAULT '0' COMMENT 'A flag to indicate whether content is serialized (1) or not (0).',
  PRIMARY KEY (`cid`),
  KEY `expire` (`expire`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Cache table for the rules engine to store configured items.';


Solution 2: If the above solution doesn't work for you and you get error relating to 'tablespace' saying 'Error: Tablespace for table abc exists. Please DISCARD the tablespace before IMPORT' in XAMPP using phpMyAdmin & MySQL.'

There might be either one of the two or both the files 'tablename.ibd' or 'tablename.frm' files left in the location 'C:\xampp\mysql\data\database_name\' Delete those files, in our case it will be 'cache_rules.ibd' or 'cache_rules.frm.' Your problem should be resolved now and you should be able to create/import the 'cache_rules' table.

You might also check the following solution for your 'tablespace' issue: http://tinyurl.com/me69h6x

Wednesday, September 3, 2014

How I Drastically Improved My Windows 7 Startup Time/Boot Time

Since quite sometime my computer had begun to boot up quite slowly. It was taking a good three and half minutes for my HP DV6 laptop, which has the following specification to boot up:
  • Core i7 processor
  • 4 GB RAM
  • Windows 7 (64 bit)
Finally today I decided to fix this menace, once and for all:

Here's what worked for me after several rounds of trials and tribulations:

1. Goto Start and type Run.
2. Once in run type 'msconfig'
3. Click on the Services tab and also check the option 'Hide all Microsoft services'; this will help you in filtering and viewing only the services of software you installed.  I tested and found out that usually not the Microsoft services that causes the delay, but you can disabled services you aren't using such as Fax and Parental Controls. (see fig. below)

4. Now, you can enable a list of services,  Click on Apply and restart and test. You can disable some items from the Startup also. Click on the Startup tab to do this.You might have to try this a couple of times to find the main culprit. Once you've identified it disable that buggy service and things should be fine for you.

I used a software called Glary Utilities to check my Boot time and you can see I've made a massive improvement with my Startup Time.





Tuesday, August 19, 2014

How to Fix Helvetica Neue Font Issue in Facebook while using Google Chrome/Windows 7

You might have installed the ever so beautiful and elegant font Helvetica and it's family viz. Helvetica Neue and then seen a queer font-face in Chrome, as in the image below:

  

Searching for a fix I even tried the commonly suggested solution:

Permanent Solution:

The permanent solution is nothing but deleting the font which I guess you don’t want to.

To delete a font, you must restart your PC in safe mode and then delete the font by deleting it from Control Panel.

Temporary Solution:

This solution is also a kind of permanent solution. In this method we are going to alter the Chrome file a little bit.

Open your Windows Explorer and then go to C:\Users\[YourName]\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\custom.css

You can use Notepad to open the .css file. After opening the file, you just need to add two lines which is written below.


@font-face { font-family: ‘helvetica neue’; src: local(‘Arial’); }

@font-face { font-family: ‘helvetica neue’; font-weight:bold; src: local(‘Arial’); }


 But even this solution didn't quite resolve my issue, mainly with Facebook.

And after some more searching I came across this Chrome extension called Facebook Font Changer which eventually resolved my problem. Install this extension and chose the font of your choice.  You can see the issue resolved in the image below.


Note: 
1. Pirated fonts might also be the culprit to this bug.

Monday, August 18, 2014

HP Laptop Battery Check and Cycle Count

If you are using an HP laptop and have run into a battery problem recently then you can know your battery status by conducting the following simple test using HP's diagnostic software called 'HP Support Assistant.'

The main thing to note in this test is the Battery Cycle Count. Battery Cycle Count tells you the maximum number of times you can charge your battery and the remaining number of cycle count.

Steps for testing:

1. Open HP Support Assistant.
2. At the Bottom Click on Diagnostics
3. Then Click on HP Battery Check. You should see an image as below:


4.  Once the test is successfully conducted in the result screen click on Advanced and you should see a detailed result as below:


In the image as you can see my cycle count is 361/300 means the life span of my batter is already over and I am due by once cycle count; which means time for me to replace my battery.


Monday, August 11, 2014

Bootstrap, Colorbox, CSS Issue

If you are using Bootstrap, Lightbox and Colorbox and facing problem in rendering your images appropriately; where in the initial image load the image size might have shrunk and in the subsequent image load the image dimensions are fine, you may try the CSS code below to fix the issue:


img {
     /* height: auto;*/
     max-width: none;
}

Tuesday, August 5, 2014

Microsoft Outlook POP3/IMAP/Email Setting for Mercantile Email Server (Nepal)

Below are the settings you can use to configure your mail server if yo are MOS client in Nepal:


Account Type: Pop3
Incoming Server: mail.youdomainname.com.np
Outgoing Server: smtp.ntc.net.np

or try the settings below:

Secure SSL/TLS Settings
(Recommended)
Username: example@yourdomainname.com.np
Password: Use the email account’s password.
Incoming Server: mos.hosting.com.np
IMAP Port: 993
POP3 Port: 995
Outgoing Server: mos.hosting.com.np
SMTP Port: 465
Authentication is required for IMAP, POP3, and SMTP.

Non-SSL Settings
(This is NOT recommended.)
Username: info@yourdomainname.com.np
Password: Use the email account’s password.
Incoming Server: mail.yourdomainname.com.np
IMAP Port: 143
POP3 Port: 110
Outgoing Server: mail.yourdomainname.com.np
SMTP Port: 25
Authentication is required for IMAP, POP3, and SMTP.

Top 5 Posts (Weekly)