Nothing to see...

A simple blog about all things in the world that is ridikulouse.

Technological steps, are man kinds greatest achievements

Not a Fighter, but a lover of Tech.

Love of the internet

The Internet is the final frontier for open connected networks, it promotes speech and advances knowledge for any mere person. The internet is fast becoming a need rather a want, and it is recognised by the UN as a necessity for the modern person.

Photography

Photography is more than just Art and expression, it is the manipulation of the light and provokes emotion and memories.

Have a look around

The articles on this blog represent my thoughts and views at the time of writing, I can always change my views through further education...please don't hold me against my views. Some of the articles have been written to assist anyone else with similar issues - it also helps me to remember. Hope you get something out of this.

Friday, October 19, 2012

Checking freespace from a terminal

If you ever need to check your disk's usage, free space etc... you can execute a terminal command df. This gives you information in a very raw format. Often this is adequate to check the capacity and what's left by using the % information.

However, a better way to look a disk capacity and free space is using discuss. Discuss isn't normally included in your standard build of Ubuntu, so in order to install it fire up the following command:

sudo apt-get install discuss

Once you have done that type in discuss in a terminal window and voila!


Using Screen in Ubuntu

This morning I was advised that in order to execute extensive shell scripts, and especially via telnet, I should look into using screen.

When I first tried the command screen in Ubuntu I found that it didn't work, I was notified by bash that I should sudo apt-get install screen. So, after I installed it as bash suggested, I re-executed the command screen and a GNU lic agreement was displayed. Then I was placed back on to a command prompt, almost exactly the same command prompt as what I was on before... so what next ?

I decided to do a bit of research into screen, from what I was advised that it is a essential tool that should be used my most people but in reality it is overlooked. So if it is so important why is there a lack of understanding of screen?

Well here is what I found out: When you are using a terminal window or if you are using telnet, you are assigned a session. Within the session you can execute all the commands that you need as long as the session is still active. If the session is terminated then your commands exit. So how does your session terminate ? well if you close down your terminal (accidently or not) or if you close your telnet session (accidently, forced, or via another method).

So, if you are working on a complex build and it is taking a long time you are forced to keep the session open until the build completes. A complex build is problematic with a temperamental telnet session. Here is where screen comes in to the rescue.

Screen detaches your session, and hence allowing your program to continue to execute even when the terminal has been closed or your telnet has been closed. You can regain the session easily by re-establishing a terminal window or telnet session and re-executing screen.

Sounds handy huh?

Starting Screen
To start screen you can:

  1. Enter the command screen
  2. Enter the command screen -S <sessionname> where the <session name> is any name to describe the session. For example screen -S 1 and screen -S mySession are valid ways of describing the sessions. This comes in handy if you want to open multiple sessions, having a meaningful name means you can open the right session when you want it. 
Getting Back to Your Prompt
To exit the session you need to a key combination :

CTRL + A and then CTRL + D

To try this first execute screen, then execute a command that you would notice that you have only executed in screen such ls -a or pwd  etc... then try CTRL + A and then CTRL + D or CTRL + A +D
Did you notice how you were returned back to your original command prompt ? 

Getting Back to Your Screen Session
To restart your previous screen session you can:
  1. Enter the command screen -r if you started screen without a session name then just use this command. 
  2. Enter the command with a session name screen -r <session name> where <session name> is the name of the session that you started previously. For example screen -r 1 or screen -s mySession.

Starting Another Screen Session Within A Session
If you want to start another screen session within a session, you don't need to CTRL + A CTRL + D and start another session with screen -S myNewSession. You can simply execute the following key combination:

CTRL + A and then CTRL + C

How To Navigate Between the Sessions
When you are working with multiple sessions you will want to navigate between the sessions. To do this you can do the following:
  1. Next window : CTRL + A and then CTRL + N
  2. Previous window : CTRL + A and then CTRL + P
  3. Selecting from a list of windows : CTRL + A and then CTRL + "
  4. The last session that was viewed : CTRL + A and then CTRL + A

That's all the basics of Screen, there are plenty of other great commands. Let me know if you want a guide on the other commands. 

Wednesday, October 17, 2012

Partitioning and Formatting a 3TB Harddrive as NTFS within Ubuntu

I bought a new harddrive since the old one was running out of space, its a Western Digital 3TB Green Harddrive. All my previous harddrives were 2TB or less, this is the first time I've tried a 2TB and I had to do a bit of research to make sure that the harddrive would work under linux and it can support a 3TB harddrive.

The first and important step is the consideration of partition and file system. Since this is a large harddrive, and since I have a number of computers with all different flavors of OSs - most importantly the Windows machines. I've decided to apply a single ntfs partition.

first steps first, I need partition tool such as gparted and some ntfs tools. To get these apt-get them and get them installed:

sudo apt-get install gparted
sudo apt-get install ntfsprogs

Now that these are installed, open up Gparted from the application launcher.


Once you open Gparted it will automatically show you /dev/sda, since this is most likely not your prefered device to format select the correct device from the top right hand corner, in my case it's /dev/sde


Since this is an empty new harddrive the entire block is in the shade of grey and it states that it is unallocated. Before you get stuck into creating partitions, you first need a partition table. To create a partition table click on Device > Create Partition Table.

You will be prompted to select a partition table type, it states that the default is MS-DOS partition, however, this has a limitation of 2TB partitions - since a 32bit field length is being used and with 512 byte sectors this equates to 2TB. In order to get to the something higher than 2TB we need to select GPT as our partition table type, to do this click on the arrow next to Advanced this will reveal a drop down, from there select GPT. To learn more about GPT click here. Click Apply to continue.


After you click apply you might start to hear your harddrive spin up, the partition table should take less than a second to create. After which your devices are rescanned and you will be left back on /dev/sde or your selected device, except the the red icon will no longer be there under Partition.


Now you would need to create one or more partitions, to do this right click on the grey block (where it sez unallocated) and click on New within the context menu.

You'll be presented with a box where you can select :
  • Free space preceeding (MiB): This is the start, since I'm creating it from scratch the lowest I can go is 1 
  • New size (MiB): The size of the partition, since I'm creating one big partition this will be the maximum for my 3TB which is 2861587
  • Free space following (MiB): This is the end of the partition, since I'm taking up all the space it will be 0 for me
  • Align to: You can slect MiB which is easier to comprehend, or Cylinder, or none
  • Create as: You can create the partition as a Primary Partition, Logical Partition or an Extended Partition
  • File system: Here is where you can set it to NTFS, there are a number of options and since this post is about NTFS I'll only cover that option
  • Label: Here you can enter a label for your new partition like "myNewPart" or what ever will describe the partition for you. 

Once you have entered everything the way you want click on Add to continue. The following options are what I had selected:



Once you have clicked on Add, you'll be dropped back on to the main screen of Gparted.


At this stage it's not too late to back out, if you want to back out click on the orangy-red back button just under the Parition menu. Otherwise if you are comfortable to continue click on the green tick that's under the Help menu.

Since this is a risky operation, make sure that you have any data backed up when you are playing around with partitions and formatting. Once you have completed all the tasks its very difficult to back out. You'll be presented with a final confirmation asking whether to proceed or not.


If you are uncomfortable to proceed click on cancel and back out now! Otherwise, click on Apply to continue.

This will then cycle through for a little while:


Once it is done you'll be given a success message, click on Close to continue:


All done.

Now since I'm a skeptic  at times I normally test it to make sure that it works. So mount up the drive via Nautilus and create a text file to see if it works.
Now it's done.






Tuesday, October 16, 2012

New Layout - Experiment

I'm completely new to the world of Blogger, and I thought that it was about time to ditch the standard template for something that is a little more appealing. I first thought that I could create my own template, but for the time being I'm trialling out some pre-made templates (why re-create the wheel if you don't have to, right?).

So in the mean time you will see changes on the site, sometimes it might work and sometimes it wont. But for most part I hope it works.


Movie-Renamer Installation

I've been hunting around for a method to get my movies working with XBMC. On Windows I was using a program called Movie Companion, and it was a good little program that did what I wanted it do. Specfically:

  1. It downloaded the movie information 
  2. Downloaded Posters
  3. Downloaded Fan Art
  4. Created the required .nfo files for XBMC
What it didn't do was create update movie filenames etc... but I could live with that. 

Since moving across to linux, I've been in desperate need to be able to do what I could do with Movie Companion. I've looked on forums and various other areas and most of the information pointed to Ember, however, Ember seems to have gone down some time ago and hasn't come back up yet. 

I thought that I may have need to create my own program to do what Movie Companion did on Windows, however, my background is Microsoft Frameworks and I didn't have a clue on how to get started in linux. 

Somehow I managed to stumble upon Movie-Renamer, and unlike what the name states it does more than just rename the movie. 

Installation
To install Movie Renamer you will need to download the java file from their website at http://movie-renamer.fr/. You will need Java installed on your ubuntu installation before you can execute this, check out my post on how to install java for some instructions. 

Once you have downloaded the jar file, in my case it was Movie Renamer_Installer-1.3.0_Alpha.jar follow these instructions:

1. Open up a file explorer, usually Nautilus and locate the file. Often, unless you have changed this, it would be in ~/Downloads

2. Right click on the file, and you will notice that  there is an option "Open with Oracle Java 7 Runtime", if you don't have this option then it means that you don't have Java installed on your machine - see my previous post on instructions on how to do this. If you do see it then click on this option to launch the installer. 

3. Select your language, the program supports English and French, and click OK


4. Click Next on the home screen/splash screen or what ever you like to call this screen, then go through the GNU License information and click Next
 


5. Select the installation path, leave it as it is if you want the default to apply

If the path does not exist, in my case it didn't, then you will prompted to create the directory. Click OK if you wish to do so. 

6. Select the packages that you require, at this stage you get the Sources if you wish otherwise the default option of Movie Renamer is the only one that is required. Click Next to continue.

8. Then it will go through the process of installing the files, this should be really quick - it was less than a second on my machine. Click Next to continue. 

9. Next screen is quite wierd, and it is obvious that this was initially intended for Windows since it refers to the Start Menu and creating shortcuts. I've just continued (Next) to see what will eventuate. 


And then that's it, click Done:


To open the program, go to the top right if you are using gnome and search for "Movie" and it will bring up Movie Renamer. 



Now that it's installed, I'll have a play with it and post a separate post on using the program. 




Installing Java 7 on Ubuntu

I found myself wanting to run a Java applet on Ubuntu, within Windows this was pre-installed and I didn't have to worry about anything.

However, since my install of Java did not exist I had to hunt around on how to install Java, the following steps are what I used:

1. Add a PPA to your repository list

sudo apt-get-repository ppa:webupd8team/java

2. Check that your system is updated

sudo apt-get update

3. Execute the installation

sudo apt-get install oracle-java7-installer

When the installation starts you will be prompted, within the terminal, to accept the license agreement. Once you have accepted the license agreement, the installation will continue and it will take less than a minute to download everything and install Java on your machine.




Saturday, October 13, 2012

Cloud Storage for the Consumers

Much of yesterday was used up trying to look for a set of files, due to a recent hard drive malfunction I no longer know what I have and what has been lost.

After searching through my stack of hard drives  low and behold the files were located in the second last hard drive  That was lucky because the last hard drive was a IDE harddrive, and I don't think I have a suitable enclosure for it. 

But, this event got me thinking about the types of medium that is suitable for storage. One of the consequences of going digital is that we will be more prone to loosing information if it is stored incorrectly. Take for example, prior to digital cameras most people had their photos developed in a studio and they had a hard copy of the picture. These formats generally degraded over time, however, the benefit was that some of the information would still be legible - in the case of a picture you may still be able to make out what is being represented in the picture. 

Now, with the digital age and with digitising everything - some of the key benefits of course are that you have less clutter, and the quality wouldn't be expected to degrade over time. However, the key aspect is really time. 

Over time, with technology, everything tends to become outdated. I remember having tape drives holding vast amounts of information. For the general consumers were CDs, and then DVDs, then blue ray disks. The life expectancy of a DVD or CD's are 30 years, and Blueray discs are expected to be much greater of up to 150 years. Both of these haven't been tested in the wild yet to confirm whether or not this is the case. However, if you take blueRays as an exmaple - if you have stored media on a blueray disc there is no guarantee that in another 150 years you will have anything that will be capable of reading the media. In a consumers' sense, they wont have these types of machines available as they keep upgrading their technology. 

Now, in my case, I was thinking that I need a mechanism to :
  1. store my information safely for a long time (maybe not for 150 years) but long enough based on the information
  2. Be able to search for the information easily and efficiently
  3. Be able to be accessed anywhere and any time 
After considering these as my requirements, physical media wouldn't be capable of meeting requirements 2 and 3. So the only item that I can think of that can meet these requirements was going to be personal cloud storage. 

There are so many companies offering free and paid services, they normally provide some sort of web interface to manage your files, or even multiple applications for your devices. In my case, they tend to meet each of the requirements very well. 

A couple of considerations to make when you pick a cloud storage provider : 
  1. Check out how long they have been around - assess the risk of them shutting up shop and taking all the information with them. 
  2. Check out whether they will breaking any laws - there were many people who used MegaUpload as  method of cloud storage. However, MegaUpload and MegaVideo were also participating in infringements which at the end brought down the company. All the users to date haven't been able to obtain their files. 
  3. Consider using multiple hosts - have one as your backup to minimise the risk of #1 and #2. 
  4. Make sure you understand the companies interest in providing you with free storage - Remember nothing is free in life. 
So right now, I'm using both drive.google.com and also UbuntuOne. I'll do a review on these soon, however, for the mean time I hope this has helped with your storage needs.