Wednesday, March 19, 2014

First 24 Hours With Fedora 20

Happy Happy Happy ! Fedora 20 rocks !
First 24 hours with Fedora 20 and everythings all good ! The install went great using fedup, and really couldn't of been any easier. I have to admit I was more than a bit concerned, and was relieved that the upgrade went so smoothly.

For the most part I didn't notice any major changes,  some new log viewers that I didn't notice before. Something I'll have to play with down the road. Fedora 20 also seems to use a little more of my system resources. Nothing major, and nothing to bothersome. I'm going to have to go through the log files soon and look for errors. I had one freeze up, but it's a problem I had with Fedora 18 as well that I was able to replicate in Fedora 20. It just hasn't been a big enough nuisance to have to fix. I'll save that fix for a boring rainy day when I need something to post.

Anyway, enough with this techno babble ! For the tweeted version : Fedora 20 good, fedup rocks, and I'm as happy as a fat kid with cake !

Tuesday, March 18, 2014

fedup Fedora 18 to Fedora 20

So, I really didn't get fed up with Fedora 18, but I used fedup to upgrade to Fedora 20 and was pretty happy with the results. I was considering trying another distro, but was really happy with Fedora 18, then today I came across some software that I wanted to try but it was only available for Fedora 2O. I looked into updating my system and fedup was the suggested solution to upgrade. I had access to a really fast internet connection today, so I decided if I was going to try this , today would have to be the day. This saved me a ton of time on the downloading packages part of this post. All in all the entire process took about two hours. Here's what I did and what happened.

NOTE: You must use su or sudo for all commands ! If you don't have a really fast internet connection add some time to your install for package downloads. This could take some time.

So I decided to try the fedup upgrade from Fedora 18 to Fedora 20 . The first thing I did was read the wiki on fedup here.

As per the instructions I did a full system update to insure everything was compatible with fedup.

yum update

I'm glad I did this because I did make a few changes to Grub that I forgot about and that may have affected the upgrade. The update reset grub back to it original configuration. 

Once Fedora 18 was fully updated I installed fedup

yum install fedup

You want to make sure you download fedup-0.8.0-3  as per my research earlier versions can be buggy. Once fedup was installed I rebooted the computer to make sure all the changes and updates took effect.

Once the computer rebooted I typed

fedup --network 20 --nogpgcheck

Unfortunately I didn't notate my notes as to why, but the --nogpgcheck is necessary when updating from 18 to 20 but not when updating from 19 to 20 . 

At this point if you don't have Chrome browser installed everything should go easy peazy. Skip the Chrome steps.  If you do have Chrome installed continued reading.


Chrome

So here's where I ran into my first problem.

Downloading failed: failure: repodata/filelists.xml.gz from google-chrome: [Errno 256] No more mirrors to try.

Google-chrome and google-repositories really goofed me up good for about 15 minutes.  If you run google-chrome uninstall it.

yum remove google-chrome

yum clean all

yum clean metadata

Then disable the google repositories

yum-config-manager --disable google-chrome

Once I did this I ran the

fedup --network 20 --nogpgcheck

And everything went fairly smoothly from there. fedup took care of just about everything. At the end of it, where it asks to reboot, I ended up with a couple warnings but at that point I think its almost to late to make any changes. I did some research before I did the reboot and it looked like the warnings were bugs, and o.k. to ignore. This was kind of scary, but all went well. If you get any warnings USE A SEARCH ENGINE AND MAKE SURE ITS BUG AND NOT AN ACTUAL PROBLEM. I think it should go without saying as well that you may want to backup any important data before you upgrade.

Once I rebooted , the entire install took a little over an hour on my computer. No problems at all, all data, and most of my configurations remained unchanged.  For a little clean up I simply did :

rpm --rebuilddb

I want to research doing additional clean up, because I know there are a lot of unused files left behind. After I do some research, that may be a post for another day.

And that's it, your done ! Hope this goes as smoothly for you as it did for me and enjoy your update Fedora 20 install. Good luck !


Friday, March 14, 2014

Appending Sequential Numbers To A Word Or File Using Linux

I needed to append some sequential numbering to a word to use in a list. For example :

word01
word02
word03
word04

The sequence of numbers had to go from 1 - 4999. Now I could of wrote this out 4999 times but that would of been painfully boring and probably would of given me a terrible case of carpal tunnel by the end of it all. Plus I use Linux, there must be an easier way to do this and there is ! It's called seq

If  you open up the terminal of your choice and type man seq it pulls up a small man page with a few options you can use. The option were interested in is the -f option. This is the printf style floating-point FORMAT. If your interested in getting a better understanding of this click here. Here's a basic command using this format with output:

seq -f "%04g" 6

output:

0001
0002
0003
0004
0005
0006


 The "%04g" gives us 4 digits starting with 0001 and continues on to 0006. This is pretty basic. We need to append these numbers to a word now, and start with 01 and go up to 4999. Heres what we do :

seq -f "yourword%02g" 4999

output:

yourword01
yourword02
yourword03


And this goes on till it reaches yourword4999. That would of been a lot of typing.

So now we need to put all this into a text file for another program to reference. Here's what you do.

seq -f "yourword%02g" 4999 > reference_file.txt

By adding the greater than symbol it pipes the output to a text file.

You can name the text file whatever you want. For my purposes it was a list file for another program I was running. Each word pointed the program to a numbered dir on a computer. You could also use this to create sequential file names.  For example:

touch $(seq -f "yourfilename%02g.txt" 10)
 
This would create yourfilename01.txt to yourfilename10.txt.  

 This is a great little program and with a little imagination you could really put this program to great use.   

Sunday, February 23, 2014

KDE Desktop Shortcuts

Heres another duh, don't I feel stupid moment. I run KDE Plasma and the last time I tried to make shortcuts on my desktop I just couldn't do it. I figured o.k. drag and drop the icon from the application launcher onto the desktop and done. That's what I tried and it just didn't work. No matter how many times I dragged the icons to the desktop they just disappeared.  I figured well it's Linux so I probably have to do some weird configuration and link the icons or something.

Today I planned on spending the afternoon getting some shortcuts in order. Well guess what ? It is that simple. Drag and drop the icons onto your desktop from either application launcher, or Dolphin and your done. The only trick you need to know is this , make sure you right click on the desktop and select unlock widgets if its set to lock. Once you click unlock widgets, drag and drop the icons of the programs you want from your application launcher or Dolpin to your desktop and your done ! Easy peazy baby.

Now I've got all the programs that I use on a regular basis grouped together. For my webdesign and surfing the net I have Firefox and Chrome for social networking and checking design work, FileZilla for FTPing , and Dolphin to manage my files.

I made a second group, with Gimp, and Inkscape for my graphic design stuff, and through Gedit in the mix for coding out websites. This configuration is a real time saver for me.




Sunday, February 9, 2014

Three Ways To Get Help From The Command Line

Most people that use Linux know about and use the man pages. If you're not familiar with man pages there pretty simple to use. Open up the terminal program of your choice, at the command prompt simply type man followed by the subject you want to learn about. For example:

man finger

By typing this at the command prompt man will pull up all the information on using finger. What it does, how it works, and how to use it. To close the particular man page just press the q key and the terminal will quit man and return you to the command prompt.

There's a man page for just about everything in Linux. Want to learn more about the unzip program in my last post. Type man unzip. When your done press the q key and it will return you to the command prompt.

O.K. most people know about man pages and if you didn't, well now you know. There is also a help command that does , you guessed it... helps.If you type help help at the command prompt it will bring up some info on using help. Use help when your not sure about what a command does. For example try this.

help pwd

This will pull up a little info on the pwd command. Help isn't as in depth or massive as the man pages, but from time to time when your stuck, sometimes help can really help.

Finally we have the info command. Want to learn more about using man pages, type info man. This will bring up, you guessed it ... info on man pages. Again just hit the q key to return to the command prompt.Here's some fun things to info

info vi
info bash

You get the point. These are three easy things you can do to get help directly from the command line. This can really save your life when your in a pinch. It can make for some dry reading but you'll be surprised at what you can learn from some of these man, info, and help pages.

Saturday, February 8, 2014

Using unzip in the command line for multiple zip files

One reason for using Linux and the command line in a terminal program is the amount of time you can save doing redundant tasks. One of my resolutions for 2014 was to start using the command line more, to save time and of course learn a few tricks.

Today I tried two new things I never did with the command line. The first one was a total fail, and I'll shamefully explain what I tried to accomplish. The other thing I did was a success and saved me about a half hour of work.

The first thing I tried was downloading a bunch of zip files from a website at the same time, or with one command. There were roughly 30 zip files I needed to download, and I was planning on using wget to download all the files while I worked on other things. I have no clue what went wrong, but no matter what I tried, I just couldn't get wget to get the zip files I needed. I think it had something to do with the websites php server and some security features set on the server end. I'll be trying this again because I know it can be done, I'm fairly sure I was doing it correct, I just had to tweak something. I'll try it on an easier project in the future. So that was the fail.

Now for the success. I downloaded the 30 zip files manually, and placed them all in a temp directory. Normally I use Ark in KDE and it works great but unzipping 30 files with Ark would of taken at least 20 to 30 minutes. Instead I used "unzip" from the command line and it took about 30 seconds!!! The files I'm unzipping are jpg image files, so the filename really isn't that important, as long as I don't overwrite the duplicates and lose them.

Not knowing what I was doing I made a dir called temp-test and copied all the files to the temp-test directory I created. Then for the sake of simplicity and not making this post overly complicated and confusing for anyone newer to this like me, I used unzip -B "*.zip" and unzip did the entire job in about 30 seconds. I now had every file unzipped and ready to use.

A couple things worth mentioning. You need the quotes around the "*.zip" so that the shell won't recognize it as a wild card. Without the quotes I got

caution: filename not matched:  filename.zip

I also needed to ad the -B modifier to add a ~ to the end of any duplicate filenames. This left me with 300 files with duplicate names, but I unzipped over 1000 files. So I got a little more than a third of my files in 30 seconds.

This is the command I used.

unzip -B "*.zip"

unzip is the command to unzip the file, -B is the modifier to make a backup of duplicate named files. So if you have multiple files named 03.jpg it will create a backup of 03.jpg~ 03.jpg~1 etc. etc. Finally the "*.zip" is the wild card to unzip every file with the .zip extension.

If you have no duplicate file names in your multiple zips that's great. I had some duplicate names, which left me with close to 300 backup files that I needed. I couldn't figure out how to fix this using the command line, but a quick fix using the Dolphin file manager, (I think this will work with any file manager though) was to move all the backup files into its own folder and then highlight them all, right click and select rename, this will pop up a window that will allow you to add a filename#. The hashtag will add a sequential number. So I named it dupe#.jpg which created dupe1.jpg dupe2.jpg up to 300. Luckily they were all jpg's, any name would work as long as I had the jpg extension, and this technique worked great.

I do a lot of image work so this worked perfectly for me. All in all, what took a few minutes with unzip and renaming the dupes in Dolphin would of took about 20 to 30 minutes using Ark. I'll be using this a lot for different work projects.