Category Archives: Linux

Installing classifier- A file sorter for Linux

Linux Format LXF244 contains a short review of Classifier, a useful piece of software for sorting files into their different types. The program can be installed through the Python pip repository via the Terminal (CTRL+ALT+T): The instructions in the magazine are simply:
sudo pip install classifier


However, there are a couple of pre-requisites required in order to make this work 'out of the box' (I'm using Mint 18).

I had already installed Python, but if you need to do this:

sudo apt-get install Python

Pip is installed with Python, but may need to be upgraded. NB the code suggested here did not work.

pip install --upgrade pip

Then you can install Classifier:

sudo pip install classifier

Help can be obtained via:

classifier --help

Or

classifier -h

This brings up the following text in the Terminal:
All commands start with classifier:

-h, --help show this help message and exit
-st SPECIFIC_TYPES [SPECIFIC_TYPES ...], --specific-types SPECIFIC_TYPES [SPECIFIC_TYPES ...]
Move all file extensions, given in the args list, in
the current directory into the Specific Folder
-sf SPECIFIC_FOLDER, --specific-folder SPECIFIC_FOLDER
Folder to move Specific File Type
-o OUTPUT, --output OUTPUT
Main directory to put organized folders
-d DIRECTORY, --directory DIRECTORY
The directory whose files to classify
-dt, --date Organize files by creation date

I have used the basic function to sort out my downloads folder which contains a enormous variety of files: In my case:

classifier -d Downloads

Apparently, there is no undo here so be careful.

This sorted my Downloads into various subfolders according to their type.

  • Twitter
  • del.icio.us
  • Digg
  • Facebook
  • Technorati
  • Reddit
  • Yahoo Buzz
  • StumbleUpon

Recover an accidentally wiped hard drive

About 48 hours ago I would have been mystified how anyone could wipe their entire harddrive. On Saturday I attempted to upgrade my installation of Linux Mint from 17.3 to 18. The upgrade path failed so I opted for the recommended path of doing a clean install.

This need not be a big deal. My set up was quite simple:

1. A Solid State Drive (100GB) on which I keep Mint and the software running on Mint.
2. A 2TB hard disk where I keep everything else. (I set up Mint to write Documents, Pictures, Videos etc. to this drive.
(3. I also have a 3TB My Clould to which I save pictures, so I didn’t loose everything)
t2t2
For some reason when installing Mint I chose the option to wipe the 2TB hard drive clean instead of the 100GD SSD.

Fortunately, I had recently read Linux Format’s Round up of rescue distros (Issue 209, April 2016) so I was mildly aware there might be an opportunity to get my data back. I opted to install testdisk.

I’ll cut out some of the things I tried to do, but this is the short version

Open the Linux Terminal (CTRL+ ALT+ T)

sudo apt install testdisk

I then ran a utility inside testdisk called photorec typing into the terminal

photorec

See instructions at: http://www.cgsecurity.org/wiki/PhotoRec_Step_By_Step

After selecting to recover the 2TB disk and choosing a location to save the recovered files then following is in process:

Terminal view (I’m hoping it will not take 24 hours to complete. It said 72 hours about an hour ago!)t5

The program saved the recovered files into these folders.

t7

The obvious issue here is that the recovered files don’t appear with their original file names and the folder structure is not maintained. However, there are some more important issues here:

  1. This has been surprising easy to do. On one hand that is a good thing as it means I’ve got my files back. On the other hand, the ease with which I recovered files demonstrates how insecure the process of wiping a hard drive is. Once anyone gets hold of the hard drive it is amazingly easy to recover anything that was on there.
  2. This process retrieves everything including files I had already deleted and pictures from websites I had visited. For example some of the folders contain pictures of the people I follow on twitter, I did not download these.
  3. When I say retrieves everything I mean everything. Most of the files retrieved are things like web buttons.

t6Anyway the main lessons here are as follows.

  1. Check very carefully before you delete.
  2. It is easierto recover files than I thought:
    a) This is a good thing if you made a mistake.
    b) This is a bad thing it you actually wanted to securely wipe a drive. If you want to wipe a drive so no one else can read it, some research is needed . Deleting your files and reformatting is not enough.

Photorec: Step by step (also works with Windows)

Using python coding to sort out the files afterwards (not tried yet!)

  • Twitter
  • del.icio.us
  • Digg
  • Facebook
  • Technorati
  • Reddit
  • Yahoo Buzz
  • StumbleUpon

Linux Mint 17.2 booting problem seemingly solved by installing gdm.

I installed R and R-studio onto my Linux Mint 17.2 installation last night – I have no idea if this related to my present problem. All seemed to go fine with the installation of the packages, but when I turned the computer on this morning it would not boot up. Stubborn as I am I have sought a solution high and low. Whenever I turned on the computer the boot-up sequence would freeze at the Mint logo.

I initially thought I had some sort of graphics driver problem but the solutions mentioned did not work for me. I inadvertently found a solution on an Ubuntu forum (Mint is actually a fork of Ubuntu), by installing gdm (Gnome desktop manager) on Mint.

While the computer was booting I got into the command line. Exact procedures for reaching the command line on boot-up may vary by in my case.

1. Pressed Esc repeatedly on start up
2. Selected Mint recovery mode.
3. Selected reboot to get into the command line:
4. Hold down CTRL+F1

Probably a good idea to make sure everything is up to date

	sudo apt-get update
	sudo apt-get upgrade

 

To install and configure Gnome Desktop: In the terminal type

	sudo agt-get install gdm
	sudo dpkg-reconfigure gdm

Then reboot

E.g.

sudo reboot

The Computer then booted up the Gnome rather than the Mint desktop. You should see a list of the users for the Mint installation.

If you login with the default the desktop appears for a micro-second then goes back to the login screen. Instead you need to click the settings icon (it looks like a cog) and select 'Mate'. (I'm using Mate rather than Cinnamon).

Go make to the command terminal to install mdm (Mate Desktop Manager).

Probably a good idea to make sure everything is up to date

sudo apt-get update
sudo apt-get upgrade

To install mdm

	
sudo agt-get install mdm
sudo dpkg-reconfigure mdm

At this point mdm was installed and there was no complaint from the computer that it was not installed.
I'm starting to suspect that mdm got installed for some reason I don't understand. (If this is the case I suspect I could have installed and configure mdm directly in the boot-up command line stage without having to install gdm!)

At this point a message comes up to say that you cannot have two desktop managers. Selected the mdm rather than gdm.

I've rebooted a few times and everything seems fine (so far). Disclaimer: I'm not a Linux expert and my job is not in software or IT! don't know why it worked or if it will continue to work.

Just thought I'd share it here anyway.

  • Twitter
  • del.icio.us
  • Digg
  • Facebook
  • Technorati
  • Reddit
  • Yahoo Buzz
  • StumbleUpon

First experiences of a Linux (Ubuntu) virgin

Introduction

I'd be meaning to give Linux a try for the past couple of years. I recently bought a new PC installed with Windows 8.1, so decided to give Linux a try on the old PC.

This post documents my experience for the Linux-curious than giving actual instructions on how to get started. It is also based on my current understanding and two weeks experience. It is not an expert view!

What is Linux?

Linux is an Operating System (OS), like Windows used by most PCs and OS X used by Apple computers. In lay speak it is the thing that holds everything else together.

How much is Linux and where do I buy it?

This is probably the wrong question for a variety of reasons. You don't go into PC World or computer store and pick a copy of Linux up off the shelf. Linux can be downloaded for free (and legally). It is open source so people can develop their own versions of Linux and give it away or sell it as they see fit.

This is leads to a second point about Linux. You don't just go to the Linux website and download a copy of 'Linux'. Lots of different versions of Linux are available – these are known as 'distributions' or 'distros.' These can be downloaded and installed for various internet sites. I chose to use Ubuntu  as that seemed to be the distribution of choice for the Linux virgin. Other distros include Debian and Mint. Magazines such as Linux Format often come with a disk with a particular distribution on.

How do I install it?

I'll tell you how it did it as I'm sure that there are other, possibly better or more expert ways. I had my two PCs next to each other. I got on my new PC (pretty high spec) running Windows 8.1 and I went to the ubuntu website and burned a copy of Ubuntu 14.04 onto a blank DVD (it has to be a DVD, it won't fit on a CD). I made sure everything that was on my old PC has been transferred to the new PC (a process beyond the scope of this blog post). I put the Ubuntu DVD into the DVD drive of the old PC and followed the instructions. I opted to allow the installation to delete my Windows 7 installation though it appears you can run Ubuntu alongside Windows 7 without major problems (but alongside Windows 8 is another matter apparently).

I won't go through the installation process in detail, but it was pretty straightforward.

Is it basically free Windows?

Screenshot from Ubuntu 14.02.2 running Gnome desktop
It's an operating system and it looks a bit like Windows at first glance, but that's where most of the similarity ends. The biggest initial difference is that Linux makes extensive use of the command-line (CTRL+ALT+T) to install software and perform other functions. Some of these commands are similar to MS-DOS, familiar to those who remember pre-Windows PCs from the 80s and 90s. In reality though knowledge of MS-DOS probably isn’t that useful. It is useful to buy a book about Linux commands. I purchased the Kier Thomas' Working the Ubuntu Command-line prompt, just £1.15 for the Kindle version.

The Linux command window
The Linux command window
 

What about software?

The Ubuntu distro comes with some software pre-installed. This includes the Office suite LibreOffice (which can also run on Windows as a free alternative to MS Office) and the familiar browser Mozilla Firefox. It also comes with software to play CDs and DVDs.

Not all software is available for Linux, at least not officially. My eldest son is something of a Minecraft enthusiast, and although apparently possible to run Minecraft on Linux I have yet to get it working. Most familiar Windows software has its Linux 'equivalents' though they may not look exactly the same. Programs like Skype have Linux versions.

Installing software (including updates) is the thing that is most different and I'll save the details for another post (though there's plenty of information online).

 

Where their any teething problems?

Apart from the learning curve I wish I could say there were not problems. However, I did experience problems with the system crashing. This was solved by installing the GNOME desktop. Basically, from what I understand, some old graphics cards cannot cope with the latest versions of the Ubuntu desktop. I don't know the spec of my old PC graphics card, but it was second hand and only cost me £10. It coped with running Windows 7, but Ubuntu 14.04 was too much for it.

Will I be giving up Windows 8.1?

I don't like Windows 8 at all. It's not as bad as Vista and had it not been for Windows 7 I might have tried Linux a few years back. However, Windows is too familiar to give up and I'm yet to feel confident enough to rely on Linux for everything. I use software such as Minitab and Nvivio which I don't believe work in Linux. There is however WINE (which stands for WINE is not an emulator) which can be used for running Windows software though I've yet to try it.

Downsides to Linux Ubuntu

* Steep learning curve, especially the command line

* Some software difficult (or impossible) to run.

* Above mentioned problem with my graphics card.

Upsides

* Fast. It runs as quickly on my old 4GB of RAM PC as Windows 8.1 on my new 16GB PC.

* Free. Nothing to lose if it I can't get on with it.

* Ubuntu comes with Libre Office, Firefox and some other software pre-installed so you can get going straight away.

* So far I have solved most of my problems by looking online e.g.on the Ubuntu website.

  • Twitter
  • del.icio.us
  • Digg
  • Facebook
  • Technorati
  • Reddit
  • Yahoo Buzz
  • StumbleUpon