Wednesday, April 24, 2013

Format USB Pen Drive With Gparted Linux GUI

I've had a pen drive for a couple years that I use regularly. It always comes in handy, and gets used often. Last night I decided it was time to remove all the data and wipe the drive. I started fumbling around in the command line looking for my USB pen drive and realized that there had to be an easier way to accomplish this task. Then I thought about Gparted. Gparted is a great program to use when you have to re-partition your hard drive or any partitioned device. It's a GUI and works great.

I did a yum search gparted, and found the program in the repositories. I installed the program using yum install gparted. Yum did all the work and gparted was installed. I opened my system folder, found the link for gparted, and opened up the program.

Before you open Gparted you have to plug in your USB pen drive. Once you open Gparted it will ask for your password, and then it will search for any partitions on the system. In the upper right hand corner of the program you want to click on the /dev/sda drop down menu and find your USB pen drive. On my system it was found on /dev/sdb select it by clicking on it. In the main part of the program you will see the partitions listed for your USB pen drive. On mine I had a 3.81 Gib partition, and a 14.23 Mib partition. I'm pretty sure you want to leave the smaller partition alone as this loads the device or makes it recognizable in any system you plug it into. I clicked on the larger 3.81 Gib partition listed as /dev/sdb1 on my system and then clicked on Partition , Format to, Fat 32. And Gparted formated the drive quickly.

If you want the drive to be interchangeable with windows machines I strongly suggest the fat32 format option. That's it, all done, I now have a wiped USB pen drive, all the old data is gone, and I now have a clean USB stick to use again hopefully for many more years to come.

I always use Gparted for any partition work I do on my drive. The program is a really easy to use GUI and once loaded it's almost self explanatory. I'm going to be making some changes to my system soon, and will be using this program for some future projects. I'll be posting more on this fantastic tool in future posts.

Tuesday, April 23, 2013

CLI List All USB Devices From The Command Line

lsusb is a great command to list all the USB devices on your computer in Linux. If you have Linux-kernel-2.3.15 or newer just open up your favorite terminal program and type lsusb

lsusb -v is verbose
man lsusb man page

Sunday, April 21, 2013

Cispa Blackout !

Convert flv clips to mpg and Combine To Make One Long Video.

I had a ton of flv files on my computer and I decided I wanted to convert them to mpg files and then combine them to make a large compilation video. Each video was approximately 5 to 15 minutes in length and I wanted one complete video that ran a little over an hour. Here's what I did.

I found two programs that run from the command line that were perfect for the task at hand. The first program I found was FFmpeg, this program is capable of taking the flv file and converting it to mpg or avi, and I think a couple other formats as well. The other useful program I found was mpgtx, this program is capable of taking multiple mpg files and then combines them to make one giant video file.

It's important to note both these programs have other uses, and I'm barely scraping the surface of what these programs are capable of with this post. However, if your looking to accomplish the same type of project this short post should at least get you headed in the right direction.

Using Fedora I downloaded both programs using yum.

su
yum install ffmpeg


and then

yum install mpgtx.

Yum found the programs, found the dependencies, and installed with no problem. I believe both these programs are also available at sourceforge.net

I then created a directory in my Videos folder and named it project, I copied my flv files that I wanted to work with to that directory. Then using Konsole I went to that directory.

cd username/Videos/project

I then attempted to convert the files with ffmpeg. The first attempt I made was using the basic commands and settings. The program worked great but the video was a bit grainy. FFmpeg is very verbose while it converts the files so I looked at the files pixel size, and then decided to do an exact copy of the video and sound which fixed the image quality but made the video choppy. I then did a bit of research and settled on :

ffmpeg -i filename1.flv -target ntsc-dvd -b 2000k -acodec mp2 -ar 22050 -ab 64k -aspect 4:3 filename1.mpg

For the sake of not writing a dissertation on this program I'll add some links at the bottom as to the different commands and attributes and you can do your own research. The above command however really took care of my problem. The video was converted to about the same quality as the original, no more skipping in frames, and the sound quality seemed perfect. After this I took about nine flv files and simply repeated the above process with each one.

Now that I had the flv files all converted I then used mpgtx to combine them into one video. This couldn't of been easier. I simply used the following command and mpgtx did the rest.

mpgtx -j filename1.mpg filename2.mpg filename3.mpg filename4.mpg filename5.mpg filename6.mpg -o yourOutputFilnameHere.mpg

This combined all the 5 to 15 minute clips into a 1 hour and 7 minute video. There was no reduction in quality that I noticed and overall I was very pleased with the end result of this project.

As I stated earlier I could write a dissertation on the use of these two programs. This post was not meant to be a tutorial but simply a review of the programs, the basics of how they work, and a review of the basic research I did to make the programs do what I wanted for this particular project. For more information on these programs and all they have to offer you can check out the following links.

mpgtx http://mpgtx.sourceforge.net/#Examples

ffmpeg http://howto-pages.org/ffmpeg/

The above links were the two that I found most useful. There is a ton of information all over the web about these two programs so feel free to do your own research. I plan on learning a lot more about these two programs and will probably be adding some more information and tutorials about these programs to the blog.

Tuesday, April 9, 2013

Cooking With KDE - Krecipes software review.

Like to cook ? Use KDE ? This a great application and way to keep all your recipes organized and in one place.

Taken from Productivity Monday, daily package Fedora book.

Krecipes is a KDE recipe manager. It will store, search for, and re-size recipes, rate their nutritional content, and manage shopping lists. Recipes can be stored in plan files for personal access, or in MySQL or PostgreSQL databases for shared access (or very large recipe collections). You can select recipes based on nutritional requirements or ingredients-on-hand, and you can also generate a shopping list from a group of recipes with items added or removed to suit your needs.

This is a really great GUI program to store all your recipes in one place. The program sorts everything for you, placing recipes in different categories like pasta, desserts, meat, main course, etc, etc. and even has a little thumbnail picture of what you will be cooking. If you download the U.S.D.A. nutritional database, it even breaks down all the nutritional facts of the dish your cooking, how much fat, amount of sodium, calories, and more. I thought this program was great, and here's my review.

So I downloaded the program using yum install krecipes. At the time of this writing the program was krecipes-1.0-0.2.beta2. I was a bit hesitant with it being beta but went ahead with the install anyway. Yum, found all the dependencies, downloaded the program, and installed everything with no problems. I went to application launcher and found the program in the utilities menu, click the icon and the program asked if I wanted to install the U.S.D.A. nutritional database. Why not, I clicked yes, a small progress window popped up and it took about 20 - 25 minutes for krecipes to download and configure everything. I was at work, and my work connection is pretty fast, so if you have a slow connection, this part of the install might take some time. Just a heads up on that. I have to say though, it was really worth the wait. When you get done entering the recipe, and view it in the program, Krecipes shows you the nutritional value of what you will be consuming. I thought this was a really great feature, and perfect if you're cooking for a diabetic, or someone who has to keep track of their salt and fat intake, or a calorie counter.

Entering the recipe couldn't of been easier. Everything's point and click and very easy to follow. Simply click on File, New Recipe, and a window pops up with some tabs for each category like, title, ingredients, instructions, and there's even a tab to rate it. There's even a place to add a thumbnail image of the dish you're cooking.

All the information is stored in a sqlite3 database, and if you're like me and backup everything, just click, Settings, Configure Krecipes, and there's a link to the database file. I uploaded mine to my cloud backup, and also added it to my backup files on my portable drive. Everything about this program was very easy to use. The only thing I configured myself was adding another folder in the program directory to store the thumbnail images, and that really isn't necessary but I'm a bit anal and like to keep things all in one place. You could just make a folder in your pictures directory and name it food thumbs or whatever.

All in all I thought this was a really great program. I cook for someone who has some health issues and the nutritional database is really helpful. I just can't say enough good things about this program. It was easy to install, easy to use, and if you cook and keep recipes on your computer, I strongly suggest downloading this program and giving it a try. I give this program five out of five penguins !

Find out more here, and the program is also available at sourceforge.com here.

Sunday, April 7, 2013

The Linux Experience: My Current Setup: Distros

The Linux Experience: My Current Setup: Distros: I mentioned recently that I am no longer confortable with switching distros day in and day out. I have settled with a few things I love and...

Linux Beginers Tip, Back Up Your Files !

So I've been using my Linux partition on an almost full time basis. I've only discovered a couple things I can't do just as easy or easier in Linux and KDE than in Windows 7. One realization that I came to, and mentioned in an earlier post is that I just need to start using it. Stop screwing around with Windows unless it's an absolute emergency, and focus completely on Linux and KDE.

So far I haven't been able to find a program that batch converts images to thumbnails. I used thumbsplus in Windows, and this should be remedied by creating a script. Something I'll have to work on when I get a chance. I do a lot of stuff with images and web design and a script to work like thumbsplus will be wonderful. The other problem I've had is finding a decent program to convert .docx files. I don't have a lot of those files, mainly recipes for cooking, so I may just start rewriting them for now. I have them on my Google drive and just convert them online using Google drive as I need them not a major pain.

Enough about me, lets talk tips. I haven't had many system problems and everything seems to be running great. There are a ton of things I want to configure differently and I'll be working on that down the road. Now that I have my drive somewhat comparable to what my Windows drive looks like as far as music, graphics work, and various docs and images, I started backing everything up regularly on a terabyte hard drive. Being new to this, I know it's just a matter of time before I really screw something up in a config file, so backing up the drive is probably a good idea.

Just like in Windows, I have a Documents folder, Pictures folder, Music Folder, and Video folder, I also added a couple additional folders. I just copy them to the terabyte portable drive, and if I screw anything up, I should have about 95% of my work backed up. No problem, then format, reinstall and all the important work files should be saved.

On that note, while I was trying to configure a simple program the other night, I had memories of Windows 3.11 back in 1992 or 1993. Although it was easier to use than Linux back then, there was no such thing as plug and play and although software was always easy to install, hardware like scanners, fax machines (lol, not many people use those anymore), and printers could at times prove difficult to install. Yet, learning to install hardware, was one of the things that really helped me become Zen with the Windows environment. If I screwed up, I'd grab my box of floppy disks, format the machine and spend the afternoon inserting disk after disk into the floppy drive, and try not to make the same mistake twice. I also did a lot of tweaking back then.

Many people poo poo OS tweaking but I think it's a great way to learn your system. By doing this you have to learn how to play with config files, and learn basic directory structure, and where everything is on your machine. Yes, there are a lot more important things to configure than that cool picture that loads in grub when you dual boot your system. But by starting out with these simpler tasks, when you decide to bust into iptables, or your boot configs, you will have a general idea of how things work and will be less likely to make mistakes.

So to end this long winded post, I guess what I'm trying to say is don't be afraid to use your Linux partition if your just learning. Start hacking around in there, learn your directory structure, make some subtle tweaks to the machine, and above all else BACK UP YOUR DATA, so if you screw up it's only a mild inconvenience and not a major loss of work. The more you install stuff, tweak, and configure the sooner you will be blasting around your system confidently with few set backs.

Monday, April 1, 2013

tcsd.service loaded failed - LSB: Init script for TCSD

When going through system logs, or maybe checking on your services you may have come across this error. tcsd.service loaded failed I found it checking on my services when my P.C. was acting a little funny. I looked for a little information on the problem, and most people said disable the service or remove the associated package. I wanted to know why, what it does, and why it was failing and here's what I found out.

What it is . Taken from an IBM site. TrouSerS is an open source Trusted Computing Group Software Stack (TSS) that is released under the Common Public License. TrouSerS aims to be compliant with 1.1b and 1.2 TSS specifications, which are available from the Trusted Computing Group (TCG) website at http://www.trustedcomputinggroup.org.

Now TrouSerS works with a TPM chip. TPM stands for Trusted Platform Module. Here's a wiki on TPM. If you don't have a Trusted Platform Module chip, my understanding is that the TCSD service will look for the chip, not find it and fail. Using systemd-analyze and a tutorial found here for optimizing Fedora boot time we get an error like this:

tcsd.service - LSB: Init script for TCSD
Loaded: loaded (/etc/rc.d/init.d/tcsd)
Active: failed (Result: exit-code) since Mon, 01 Apr 2013 19:38:48 -0400; 11min ago
Process: 1406 ExecStart=/etc/rc.d/init.d/tcsd start (code=exited, status=137)
CGroup: name=systemd:/system/tcsd.service

I typed this command as root:
/usr/sbin/tcsd -f
and received this output :
TCSD TDDL ERROR: Could not find a device to open!

I then did some research on Google to see if my laptop came with this TPM chip. I discovered my model didn't come with a TPM chip and decided to remove the Trousers package. In Fedora using KDE konsole I typed "yum erase trousers" , yum removed the package, I then rebooted the computer and no more problem. Another alternative would be to type as root "systemctl disable tcsd.service". This will disable the service and prevent it from showing up in your logs.

The TPM concept seems like a great idea, if I had the chip I think I would of opted to fix the problem. Unfortunately my research only went as far as fixing my machine. I may do some further research on this chip and get this option on my next computer build or laptop order.