How Recover Lost or Corrupted GPT Partition

However from the ddrescue manual :

“Note: you do not need to partition /dev/sdb beforehand, but if the partition table on /dev/sdb is damaged, you’ll need to recreate it somehow on /dev/sdb. ”

Here is the command : sudo fdisk /dev/sdb
i’m using fdisk and format the corrupt partition table and re create a partition table in Dos flag.

This applies to me I guess, not sure what to do about it though. If I created a new partition etc on the new disk and copied the damaged one over would I be back in business? can I even copy the partition off the damaged drive?

Off to find a harddrive to clone onto, output of sgdisk partition table backup follows:

……………………………………………..Try This Command———————————

rix@devil ~ $ sudo sgdisk -b sda-backup.gpt /dev/sdb
[sudo] password for rix:

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************

The operation has completed successfully.

Advertisements

How To Increase import file size in PHPMyAdmin

By default when you want to import sql file size is 2MB in PHPMyAdmin.
That is PHP’s file upload limit.

To change maximum import file size do following step:

     1.Find php.ini file:  Type locate php.ini this command to find php.ini file.

 

     2.Edit php.ini file: Type sudo gedit /etc/php/7.0/apache2/php.in  this command to edit php.ini file.

 

    3. Find following variables and change values as you need: Type this command to change values as you need.

   post_max_size = 200M
   upload_max_filesize = 200M
   max_execution_time = 200
   max_input_time = 200
   memory_limit = 200M

   4. Restart apache to take effect:

Type sudo service apache2 restart this command for restart apache server.

How to create desktop icon for PhpStorm / WebStorm / Intellij IDE on linux mint / ubuntu

To create launcher or Desktop icon

sudo gedit

After open editor copy the given code into your editor [N.B : Make you have Install JDK8 ]

#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Terminal=false
Icon[en_US]=/home/enc/WebStorm/bin/webstorm.png
Name[en_US]=WebStorm
Exec=/home/enc/WebStorm/bin/webstorm.sh
Name=WebStorm
Icon=/home/enc/WebStorm/bin/webstorm.png

Replace the path with your own directoy and name.

1. Icon[en_US]=/home/enc/PhpStorm/bin/phpstorm.png
2. Name[en_US]=PhpStorm
3. Exec=/home/enc/PhpStorm/bin/phpstorm.sh
4. Name=PhpStorm
5. Icon=/home/enc/PhpStorm/bin/phpstorm.png

Like the given ScreenShort and save it on your Desktop with your ide name like “PhpStorm.desktop”.

Then,

Finlay Desktop Icon is Created .

Install Command of NetBeans IDE 8.0 on Ubuntu 13.10, 14.04

NetBeans is a free and open source IDE (Integrated Development Environment) for developers. NetBeans allows users or developers to quickly build mobile and web applications using HTML, PHP, C and C++.

The latest stable release of NetBeans – IDE 8.0, has been released with following features:

  • Java 8 Code Analyzers
  • Java 8 Code Editors
  • Support for Java SE 8, Java SE Embedded 8 and Java ME Embedded 8
  • Enhanced Maven Support
  • Enhanced Java EE 7 Support with PrimeFaces
  • New Tools for HTML5 and AngularJS
  • Improved PHP and C/C++ Support

Step 1: Install Java SE Development Kit (JDK) 8

– NetBeans IDE requires Oracle JDK installed first. Run following commands to install JDK

sudo apt-get purge openjdk*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Note: you will be prompted to accept the EULA. See my earlier post on How to install Orcale JDK for details

– Check Java version to ensure it was installed correctly

java -version

Step 2: Download NetBeans Installer

– There are diferent NetBeans IDE download bundles. You can download specific bundle as desired or download for all bundles and select which to install

For HTML5 & PHP

wget http://download.netbeans.org/netbeans/8.0/final/bundles/netbeans-8.0-php-linux.sh

For Java SE

wget http://download.netbeans.org/netbeans/8.0/final/bundles/netbeans-8.0-javase-linux.sh

For Java EE

wget http://download.netbeans.org/netbeans/8.0/final/bundles/netbeans-8.0-javaee-linux.sh

For C/C++

wget http://download.netbeans.org/netbeans/8.0/final/bundles/netbeans-8.0-cpp-linux.sh

For All

wget http://download.netbeans.org/netbeans/8.0/final/bundles/netbeans-8.0-linux.sh

– For the purpose of this post, I am downloading for ALL

netbeans-01

Step 3: Install NetBeans

$ chmod +x netbeans-8.0-linux.sh
$ ./netbeans-8.0-linux.sh

– On the Welcome screen, you can click ‘Customize‘ to select which package(s) to install or simply click Next to install all packages

netbeans-02

– Accept Licence Agreement

netbeans-03

– Accept default install location

netbeans-04

– Click install on Summary page

netbeans-05

– Click Finish on completion

netbeans-06

Now you can start using NetBeans

netbeans-07

How to change or reconfigure root password for mysql and phpmyadmin on Ubuntu

Follow the instruction below to reconfigure phpmyadmin, and reset MySQL password.

  1. Ctrl + Alt + T to launch terminal
  2. sudo dpkg-reconfigure phpmyadmin
  3. Connection method for MySQL database for phpmyadmin: unix socket
  4. Name of the database’s administrative user: root
  5. Password of the database’s administrative user: mysqlsamplepassword
  6. MySQL username for phpmyadmin: root
  7. MySQL database name for phpmyadmin: phpmyadmin
  8. Web server to reconfigure automatically: apache2
  9. ERROR 1045
  10. ignore
  11. sudo dpkg-reconfigure mysql-server-5.5
  12. New password for the MySQL “root” user: mysqlsamplepassword
  13. Repeat password for the MySQL “root” user: mysqlsamplepassword
  14. After all this run following command on terminal to secure your mysql server. sudo mysql_secure_installation
  15. Enter current password for root (enter for none): mysqlsamplepassword
  16. Change the root password? [Y/n] n
  17. Remove anonymous users? [Y/n] y
  18. Disallow root login remotely? [Y/n] y
  19. Remove test database and access to it? [Y/n] y
  20. Reload privilege tables now? [Y/n] y

Wish it helps!

Have a nice day!

How to Install latest Eclipse IDE in Ubuntu 14.04, 13.10

Eclipse Kepler 4.3.2 SR2 is the most recent release from the Eclipse top-level project. It contains what you need to build applications based on Eclipse technology, including integrated development environments IDE, and rich client applications using the Eclipse Rich Client Platform RCP. The Eclipse Kepler provides superior Java editing with Java Development Tools, Plug-in Development Environment, Git Team provider, and much more.

Step 1: Install Java (JRE/JDK8)

Download Latest JDK8

Step 2: Download Eclipse Kepler IDE

– Next button below to download the latest Eclipse IDE (32bit or 64bit) package. There are different packages depending on what package you want.

Download Latest Eclipse IDE

– Click Save File

eclipse-kelpler-01

– From terminal, run command to move downloaded package to /opt directory

$ sudo mv Downloads/eclipse-*/opt/

Step 3: Extract Package

– Run the following commands. Ensure the file-name is correct on your version

$ cd /opt/
$ sudo tar -xvf eclipse-standard-kepler-SR2-linux-gtk-x86_64.tar.gz

Step 4: Create new Desktop File

– Create a new desktop file called ‘eclipse.desktop’ in /usr/share/applications/

$ sudo gedit /usr/share/applications/eclipse.desktop

– Then add the following lines to the above file and save

[DesktopEntry]Name=EclipseType=ApplicationExec=/opt/eclipse/eclipse
Terminal=falseIcon=/opt/eclipse/icon.xpm
Comment=IntegratedDevelopmentEnvironmentNoDisplay=falseCategories=Development;IDE;Name[en]=eclipse.desktop
Screenshot from 2014-06-22 03:14:04

According to cheour, I changed the exec line in the gedit file from

Exec=/opt/eclipse/eclipse

to

Exec=env UBUNTU_MENUPROXY= /opt/eclipse/eclipse

and it worked right

Step 5: Additional Tasks

– Run the following command to automatically install it in Unity

sudo desktop-file-install /usr/share/applications/eclipse.desktop

– Create a symlink in /usr/local/bin

cd /usr/local/bin/

sudo ln -s /opt/eclipse/eclipse

– For Eclipse icon to be displayed in dash, run following command

sudo cp /opt/eclipse/icon.xpm /usr/share/pixmaps/eclipse.xpm

eclipse-kelpler-03

– Launch Eclipse

Screenshot from 2014-06-22 03:17:24

How to Install JDK8 In Ubuntu & LinuxMint Via PPA

Oracle JAVA 8 stable has been released on Mar,18 2014 and available to download and install on official download page. Oracle Java PPA for Ubuntu and LinuxMint is being maintained by Webupd8 Team. JAVA 8 is released with many of new features and security updates, read more about whats new in Oracle Java 8.

 

This article will help you to Install Oracle JAVA 8 (JDK/JRE 8u5) on Ubuntu 14.04 LTS, 13.10, 12.10, 12.04 LTS and 10.04 and LinuxMint systems using PPA File.

Step 1: Install Java 8 (JDK 8)

Add the webupd8team java PPA repository in our system and install Oracle java8 using following set of commands.

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

Step 2: Verify JAVA Version

After successfully installing oracle java using above step verify installed version using following command.

$ java -version

java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) Client VM (build 25.5-b02, mixed mode)

Step 3: Setup JAVA Environment

Webupd8team is providing a package to set environment variables, Install this package using following command.

$ sudo apt-get install oracle-java8-set-default

References:
https://launchpad.net/~webupd8team/+archive/java

RECOVER / REINSTALL GRUB FROM UBUNTU LIVE CD / USB

RECOVER GRUB FROM UBUNTU LIVE CD / USB
After installing Windows / Fedora your Ubuntu will not boot anymore and its grub may be wiped out. To restore it follow the steps below.

To Reinstall Grub

You need to have Ubuntu Live CD or Live USB. Normal session can be used to repair the grub. Boot using your Ubuntu Live CD or Live USB, while booting choose Try Ubuntu.

Once booted then open a terminal, and run the following command one by one to install the boot repair.

To add boot-repair to the repository,just add below two lines to “/etc/apt/sources.list” according to your Ubuntu version:

Ubuntu 13.04:

deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu raring main
deb-src http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu raring main

Ubuntu 12.10:
deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu quantal main
deb-src http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu quantal main

Ubuntu 12.04:

deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main
deb-src http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main

To Update your repository

$ sudo apt-get update

To install boot-repair

$ sudo apt-get install -y boot-repair

Once Installation complete run boot-repair on terminal by typing the following command or select it by

System->Aministration->Boot Repair.

$ boot-repair

NOTE: Update the Boot Repair if its newer version is available.

It will scan the System for few seconds and will show you the options Recommended repair and Create a BootInfo summary. By clicking the Recommended Repair it will start repair the grub. Check the screen shots below.

Boot-Repair-scan

Boot-Repair1

Once done click ok and restart your system, your grub should work now. If not run the boot-repair again using live cd / usb. Then follow the steps below.

Select the Advanced options, In Main options tab check whether the following options are selected or not. If not select it, the options are Reinstall Grub and unhide boot menu for 10 seconds. Check the screen shot below

Boot-Repair

Then select the GRUB locations tab and check the following options are selected or not. The options are OS to boot by default and place grub into, In “OS to boot by default” option choose the OS which you want to be default on boot. Then select the drive where you need to reinstall the grub in “place grub into” option and click apply. Check the screen shots below

Boot-Repair6

applying-changes

reboot

Click ok and restart your System.