How To Install Picasa on Ubuntu or Debian

Google makes the really neat program Picasa 3 for managing and editing photo/image collections. Since Microsoft Windows it a travesty and I therefore use Linux as much as possible, I was in need of a better and more stable photo management software to replace the buggy unstable F-Spot program. To my glee I found that Google releases a Debian version suitable for using under Ubuntu’s flavor of Debian Linux. I love you Google. Anyway, it was still a 2-step process, which would frighten most Windows users, but this bit of work in the beginning assures that I am using reputable sources for software that can be installed without visiting a website or downloading anything from a web server, as I would have to do if using Windows. Not to mention that by being forced to the wild web in order to download all applications and software just opens up a computer to problems because the user must decide which software makers to trust, not a good situation for casual users who aren’t in touch enough with the current “scene” to be able to make an educated decision about which company’s software is trustworthy and which are not. Alas, I digress…

To install Picasa on Ubuntu:

  1. Create a backup copy of your file: /etc/apt/sources.list
  2. Edit /etc/apt/sources.list using “sudo” and the editor of your choice e.g. vi, vim, gedit.
  3. Add the following line:
    deb http://dl.google.com/linux/deb/ testing non-free
  4. Save the file.
  5. Update apt-get’s repository list using: sudo apt-get update
  6. Try to install Picasa now: sudo apt-get install picasa
  7. If it installs, then Hooray! You’re done! However, if you get an error like the following, then proceed to the next steps:
    W: GPG error: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 1234567890123456
    W: There is no public key available for the following key IDs:  1234567890123456
  8. The long number will be different for you, and you’ll need it for the next step.
  9. Run the following commands, substituting 1234567890123456 with the number from your error messages:
    gpg –keyserver pgpkeys.mit.edu –recv-key  1234567890123456
    gpg -a –export 1234567890123456 | sudo apt-key add –
  10. Assuming that you get success, and you should as long as there’s no typos, try again to install Picasa directly with Ubuntu apt-get:
    sudo apt-get install picasa
  11. Picasa will download and install, you may be required to verify that process before it proceeds, though.

Check put these for a bit more info, and the source of the steps needed for this process:
[Debian] Apt-get : NO_PUBKEY / GPG error
Howto Install Picasa 3.5 in ubuntu

Google makes the really neat program Picasa 3 for managing and editing photo/image collections. Since Microsoft Windows it a travesty and I therefore use Linux as much as possible, I was in need of a better and more stable photo management software to replace the buggy unstable F-Spot program. To by glee I found that Google releases a Debian version suitable for using under Ubuntu’s flavor of Debian *nix. I love you Google. Anyway, it was still a 2-step process, which would frighten most Windows users, but this bit of work in the beginning assures that I am using reputable sources for software that can be installed without visiting a website or downloading anything from a web server, as I would have to do if using Windows. Not to mention that by being forced to the wild web in order to download all applications and software just opens up a computer to problems because the user must decide which software makers to trust, not a good situation for casual users who aren’t in touch enough with the current “scene” to be able to make an educated decision about which company’s software is trustworthy and which are not. Alas, I digress…  To install Picasa on Ubuntu:     1. Create a backup copy of your file: /etc/apt/sources.list    2. Edit /etc/apt/sources.list using “sudo” and the editor of your choice e.g. vi, vim, gedit.    3. Add the following line:       deb http://dl.google.com/linux/deb/ testing non-free    4. Save the file.    5. Update apt-get’s repository list using: sudo apt-get update    6. Try to install Picasa now: sudo apt-get install picasa    7.        If it installs, then Hooray! You’re done! However, if you get an error like the following, then proceed to the next steps:   The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 010908312D230C5F

Posted under Freeware, Graphic, Linux, Software

How to Make a Backup Script for Shell in Linux

For those who hack a lot of Linux at the command line interface, backing up files such as config files before editing is a good habit to have. IMHO anyway. So to save time, a little script can be written, chmod +x, and placed into /usr/local/bin or some other that users have in their executable shell PATH. I name mine “bu” to make it easy, and it takes one command line argument which is the filename of the file you want to make a backup copy of. It is called by running something like $ bu myfile

Here’s the code. Comments welcome ;) The code creates a timecode based on today’s date and the current time to the second, and appends that to the original filename. The a copy is saved with this new “timestamped” backup filename, right in the same directory. Easy-peasy! 

#!/bin/bash
OLDFILENAME=$1
DATECODE=$(date +%Y%m%d)
TIMECODE=$(date +%H%M%S)
NEWFILENAME="${OLDFILENAME}_backup${DATECODE}-$TIMECODE"
cp $OLDFILENAME $NEWFILENAME
SUCCESS=$?
if [ $SUCCESS -eq 0 ];then
 echo "OK! Copied \"$OLDFILENAME\" to \"$NEWFILENAME\""
else
 echo "FAIL! You'll need to try again!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
fi

Posted under Linux

WordPress Template Start

Start the PHP file with this:

<?php
/*
Template Name: Snarfer
*/
?>

Posted under WebDev, WordPress

This post was written by Content Curator on December 8, 2009

Tags: , , , , , , , , , ,

Use puTTY to automatically login a SSH session

Many thanks to Jon Lee at jonlee.ca for this excellent procedure allowing for the automtic login of a session using SSH and puTTY.exe terminal emulator. You da man!

——————————-

From his site:

As many web developers can attest to, logging into your server through SSH (Secure Shell) is one of the more common day-to-day tasks (you can even use it as a secure tunnel for your traffic). It only makes sense to automate this process which in turn can save many many keystrokes.

This how-to is written with PuTTY and Windows in mind and requires several other tools that are available from PuTTY’s website. So from their download page, make sure you have these files:

  • PuTTY (putty.exe)
  • PuTTYgen (puttygen.exe)

Then to automate SSH login, do the following:

  1. Run PuTTYgen.
  2. Select SSH-2 DSA as the Type of Key to generate.
  3. Click generate and move your mouse around to generate randomness.
  4. Click “Save Private Key” and save it somewhere on your computer.
  5. Copy the entire content inside the box to your clipboard (this is your generated public key).
  6. Login to your SSH server.
  7. Create the file ~/.ssh/authorized_keys containing the generated public key (from step 3) on a single line.
  8. Make this file readable (chmod 755).
  9. Then open up PuTTY and navigate to Connection->Data and fill in the auto-login username.
  10. Navigate to Connection->SSH->Auth and under Private-key, browse to the file you had saved earlier on your computer.

That’s it! Now you can try logging in to your SSH server and it should login automatically. If it works, make sure you save your session so you don’t have to repeat these steps every time!

Hopefully these steps work for everyone! Let me know if there are any problems.

——————————-

Had some problems with a CentOS5 server not accepting keys… found that this server was being finicky for some reason, and used this article on how to generate the keys on the Linux server, and then import the public key to the client Windows box. To make it automatically login simply do not enter any passphrase. This is probably a huge security risk or something like that, but if you’re using it on a secured LAN then perhaps it’s ok.

Posted under Linux, Network

This post was written by Content Curator on November 27, 2009

Tags: , , , , , , , , , , , , , , , , , ,

How to Fix an Windows XP System that Won’t Boot into Safe Mode

The following is totally copied from myfixes.com excellent article.

This article applies to the following type of errors:

Unmountable Boot Volume

Can’t run System Restore in normal mode or safe mode, can’t open programs

Windows XP could not start because the following file is missing or corrupt: \WINDOWS\SYSTEM32\CONFIG\…

Stop: … {Registry File Failure} The registry cannot load the hive.

System error: Lsass.exe
When trying to update a password the return status indicates that the value provided as the current password is not correct.


Resolution:

A. Boot the system into the Recovery Console and CHKDSK

1. Insert the Windows XP cd into the top cd drive
2. Turn the computer off
3. Setup the computer to boot from cd: either by pressing F2, F9 or Delete to go in BIOS or by pressing F12 on Dell computers to launch the Boot Device Menu
4. As soon as you get the message Press any key to boot from the cd hit enter.
5. Wait ~3 minutes for the Windows Setup to initialize
6. At the Welcome to Setup screen press R to repair windows using recovery console.
7. Wait a couple of minutes while setup examines the hard drive.
8. You will be prompted to choose a Windows installation. Press 1 on the top of the keyboard and then
9. You will be prompted to enter the Administrator password. Press Enter if no password was set.
10. Perform a disk check:

chkdsk /p
fixboot

11. Type exit to restart the computer.
12. As soon as the computer starts hit F8 every second to bring up the Advanced Options Menu.
13. Choose the Last Known Good Configuration.
14. If these steps didn’t resolve the issue go back in Recovery Console.



B. Perform the System Restore
Inside the Recovery Console type the following commands to change the directory to the system restore directory:

cd \
cd system~1


If you get an Access Denied error:click here
If you don’t get an Access Denied error :

cd _resto~1



If there is no _resto~1 folder or if there are no restore points inside it:click here

If the _resto~1 folder exists, inside it there are several folders named RP1, RP2. These are restore points. RP1 is the oldest restore point. You can use

dir


to view what RP folders are available. If no restore points are available click here. Otherwise choose the most convenient RP folder. Supposing we have RP3 available let’s type in:

cd rp3



Change the directory to snapshot:

cd snapshot


Restore the main registry branches. If you are being asked if you want to overwrite type in y to agree.

copy _registry_machine_system c:\windows\system32\config\system
copy _registry_machine_software c:\windows\system32\config\software

The following commands are most of the time optional however the process might not work if they are not executed

copy _registry_machine_security c:\windows\system32\config\security
copy _registry_machine_sam c:\windows\system32\config\sam
copy _registry_user_.default c:\windows\system32\config\default



Type exit to reboot the system. Start the computer normally

Based on:
The support.microsoft.com article:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q307545&ID=KB;EN-US;Q307545

The icompute.info article:
http://www.icompute.info/System_restore_from_xp_cd.htm

Posted under Microsoft

How to Add Thumbnails in WordPress

When a website user makes a search with WordPress,  the search results typically are shown using the search.php template file. If one chooses to do so, these results can incluse an automatically “grabbed” image thumbnail generated by the images contained in the image. Posts with no images can show a default generic image instead. And this can all be done using the Get-The-Image plugin and perhaps a bit of code tweaking.

<div style="clear: both; margin-bottom: 20px;">
<div style="float: left; width: 150px; height: 150px; margin: 0 10px 10px 0;"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php if ( function_exists( 'get_the_image' ) ) { get_the_image('width=150&height=150&image_scan=true&default_image=http://yoursite.com/default.jpg' ); } ?></a></div>
<div>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<?php the_time('F jS, Y') ?> by <?php the_author_posts_link(); ?><br />
<p>Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
</div>
</div>

Insert this snippet, written by mercime ar wordpress.org into your loop, typically right after the beginning while-have-posts loop.

Posted under WebDev, WordPress

This post was written by Content Curator on November 16, 2009

Tags: , , , , , , , , , , , , , , , , , ,

How to Import Customer Records Into OTRS from CSV

Thanks to Mike Dent’s efforts and OTRS, we now know how a CSV file can be imported into the MySQL database directly. Here is the sample code:

mysql> load data infile '/tmp/otrs_test.txt' into table customer_user
fields terminated by '\t' lines terminated by '\r' (first_name,
last_name, address, postcode, phone1, email, customer_id, valid_id,
create_time, create_by, change_time, change_by, login);

Make sure to import all the required fields (that is, the ones that the database requires, see the table schema for details, >show table x;)

Posted under Freeware, MySQL, WebDev

This post was written by Content Curator on November 16, 2009

Tags: , , , , , , , , , , , , , , , , , , ,

Fedora 9 connect: Network is unreachable error

Ran across this installing Red Hat’s free Linux distribution Fedora Core 9 code named Suplhur. Installed totally vanilla install with the GUI anaconda front end. The box sees the NIC, and can ping within the local subnet of the LAN network, but can’t ping out. BTW, it holds a static IP on the network interface card (NIC). Gets the error:

connect: Network is unreachable error

We need to set a default route. Here’s how:

Looked in /etc/sysconfig/network-scripts for the file route-eth0 but it wasn’t there.

Using vi (you can use whichever text editor you prefer) I created that file route-eth0, and put in this one line:

defult via 192.168.0.1

(note: 192.168.0.1 is the LAN IP address of my router. Your router IP address may differ. So you should put in whatever the IP addres of your router is, instead. Most Netgear routers and Qwest DSL boradband modems use 192.168.0.1 and Linksys uses 192.168.1.1 and Belkin uses 192.168.2.1 just to name some common ones.)

Then a simple task of restarting the network and testing:

# service network restart
# ping yahoo.com

Success!

Also, I found that the ethernet adapters weren’t starting automatically. Using the GUI taskbar/ Start Menu, I went into System Administration, then into Services, and enabled the “network” service. Then change runlevel to 3. Ping works so eth0 is up, and that happened at the runlevel change. Change to runlevel 5, test, and… yeppers, it works.

Posted under Freeware, Linux, Network