Ubuntu / Linux news and application reviews.

How to Customize the New Blogger Tabbed Search [blogspot.com]

Not so long ago, Blogger introduced the custom search box which was only available for blogger in draft, to all.

This is how a search performed on your blog will look like:

blogger new search


And here is how the search box looks like:

blogger search box

Quite ugly if you ask me... but it can be styled to fit you blog's CSS and also remove the image (i'm talking about the search box, not the tabbed results). Here is how:

1. Don't add the Search box from the "add a gadget" in the Layout options. If you did this, remove it.

2. Go to your Layout > Edit HTML and check the "Expand Widget Templates" option.

3. In the place where you want the search box to be displayed, paste this:

<div class='searchf'><b:section class='sidebar' id='searcheee' preferred='yes' showaddelement='yes'>
<b:widget id='CustomSearch12' locked='false' title='Search This Blog' type='CustomSearch'>
<b:includable id='main'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title == ""'>
<h2 class='title'><data:title/></h2>
</b:if>

<div class='widget-content' style='width:100%'>
<div expr:id='data:widget.instanceId + "_form"'>
<span class='cse-status'><data:loadingMsg/></span>
</div>
</div>

<!-- override gsearch.css -->
<style type='text/css'>
#uds-searchControl .gs-result .gs-title,
#uds-searchControl .gs-result .gs-title *,
#uds-searchControl .gsc-results .gsc-trailing-more-results,
#uds-searchControl .gsc-results .gsc-trailing-more-results * {
color:<data:linkColor/>;
}

#uds-searchControl .gs-result .gs-title a:visited,
#uds-searchControl .gs-result .gs-title a:visited * {
color:<data:visitedLinkColor/>;
}

#uds-searchControl .gs-relativePublishedDate,
#uds-searchControl .gs-publishedDate {
color: <data:dateColor/>;
}

#uds-searchControl .gs-result a.gs-visibleUrl,
#uds-searchControl .gs-result .gs-visibleUrl {
color: <data:urlColor/>;
}

#uds-searchControl .gsc-results {
border-color: <data:borderColor/>;
background-color: <data:backgroundColor/>;
}

#uds-searchControl .gsc-tabhActive {
border-color: <data:borderColor/>;
border-top-color: <data:activeBorderColor/>;
background-color: <data:backgroundColor/>;
color: <data:textColor/>;
}

#uds-searchControl .gsc-tabhInactive {
border-color: <data:borderColor/>;
background-color: transparent;
color: <data:linkColor/>;
}

#uds-searchClearResults {
border-color: <data:borderColor/>;
}

#uds-searchClearResults:hover {
border-color: <data:activeBorderColor/>;
}

#uds-searchControl .gsc-cursor-page {
color: <data:linkColor/>;
}

#uds-searchControl .gsc-cursor-current-page {
color: <data:textColor/>;
}
.gsc-branding-img-noclear, .gsc-branding-text, .gsc-search-button {
display:none!important; visibility: hidden!important;
}

</style>

<b:include name='quickedit'/>
</b:includable>
</b:widget>
</b:section></div><div class='ssss'>Search:</div>

And this is the style for the div that contains the search:
.searchf {
margin-right:3px;
float:right;
margin-top:5px;
}

Which makes the searhc box float to the right with the margins you see. Obviously you can change all this.


Also, I deleted the title "Search this blog" and added only "Search" which you can edit the way you want. Then I deleted the image and made both the search box and text appear on the same line.

You can see this new search in action on my test blog.

Automatically Import Launchpad PPA Keys on Update

Some time ago we wrote about a script to automatically install launchpad PPA GPG keys for all your repositories but you needed to run that script each time you would add a new PPA repository. But now thanks to a SourceGuru tip, you can have this script run automatically each time you do an update (apt-get update).

1. Save the script which adds the keys for all your PPA repos:

Download it, extract and put it in /usr/local/bin (or any other place, it's just an example but if you don't place it there, be sure to also modify the path in the next steps).

2. Chmod the script to 775. To do this, navigate to where the script was extracted and paste this in a terminal:
chmod 775 launchpad-update


3. Create a new file, "/etc/apt/apt.conf.d/05ppa" (file 05ppa which should be located in /etc/apt/apt.conf.d) and put this in it:

APT::Update::Pre-Invoke { "if [ -x /usr/local/bin/launchpad-update ]; then /usr/local/bin/launchpad-update; fi"; };


This will help you get rid of errors such as:
W: GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A9BF3BB4E5E17B5
W: GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B22AB97AF1CDFA9
W: You may want to run apt-get update to correct these problems

How to Install Skype in Ubuntu 9.04 Jaunty - 64bit

Some applications do not have a version for 64bit architecture, one of them being Skype. Still, Skype can be installed in Ubuntu Jaunty 64bit following 3 simple steps:


1. Download Skype

2. You need to install the following packages:
sudo apt-get install ia32-libs libqt4-core libqt4-gui

3. Now do a force install of the downloaded Skype package for Ubuntu:
sudo dpkg -i --force-architecture skype-debian_2.0.0.72-1_i386.deb 

The result: Skype now works on Ubuntu Jaunty 64bit.

[via paraiso linux]

How to Use Bing.com

Bing.com just went live. Here are a few pointers to get you started.

1. Use the full version of Bing

If you don't live in the US (or probably North America), you will see a localized version of Bing.com with some features missing. To get all the features, go to this page and set your location to United States.

2. See videos preview

If you used the trick above, you now have a "Videos" section on the left. Search for everything you want and hold your mouse over a video: the video will start playing.

3. Save and Email search results

You can save your search history on to a local folder inside Bing or to your Windows Skydrive account. Alternatively, you may send your search queries to a friend via email or publish them on your Facebook wall via Bing. You’ll need Silverlight to share queries in Bing.

[via labnol]

Google Chrome Tips: Use Multiple Profiles and Change the User Agent

You can use multiple profiles in Google Chrome at the same time, each of them characterized by its own list of favorites, cache and preferences.

How to create multiple profiles for Google Chrome:

1. Create a new folder for your profile information (eg: "C:\Chrome Profile");
2. Create a new shortcut to Google Chrome (eg: your desktop or Quick Launch bar);
3. Right click on the shortcut you created and select Properties from the context menu;
4. Insert:
-user-data-dir = "path to the profile created earlier" 
at the end of the "Target" field, leaving a space between the path of the program and the code you just entered (ie: "C:\Users\yourname\App Data\Local\Google\Chrome\chrome.exe -user-data-dir="C:\Chrome Profile");
5. Apply the changes and start the browser via this shortcut;
6. Repeat entire procedure for each profile you want to create.

You can change you user agent easly too, using the same steps.

How to Change Google Chrome's User Agent:

1. Create a new shortcut to Google Chrome (eg: your desktop or Quick Launch bar);
2. Right click on the shortcut you created and select Properties from the context menu;
3. Insert
-user-agent = "user agent you want to use"
at the end of the "Target" field, leaving a space between the path to the .exe file and the code just entered (eg: "C:\Users\yourname\App Data\Local\Google\Chrome\chrome.exe -user-agent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)");
4. Apply the changes and start the browser via this shortcut;

[via geekissimo]

How to Restore Last Session in Google Chrome

Chrome lacks a basic feature to alert users when they are closing multiple tabs at once, in the past I have been a cruel victim of this so called lack of feature when I have closed a Chrome window with 20 tabs and painfully sifted through the history to open each of them back again, however looking at this post on their Code threads, I do believe that they are not going to add this option in the near future.

How To Restore sessions in Google Chrome

Step 1: Create a new shortcut to Google Chrome executable and place it on your desktop or any other place, you can directly create a new shortcut by navigating to the directory Chrome installs itself in, right clicking on the Chrome executable and selecting Send To –> Desktop (create shortcut) option.

Step 2: Edit the shortcut you just added to the desktop, by right clicking on it and selecting properties, go to General and rename the shortcut to something sensible, preferably Restore Google Chrome, so that you can easily recognize it. Do not close the properties window yet.

Step 3: Click on the shortcut tab and add this parameter to the end of the text in the Target text box

–restore-last-session

(preceded by a space). Once you have done this, click on the Ok button to save your changes.

The next time you accidentally close Chrome or it crashes on you and does not give you an option to restore your session, click on this shortcut you just created and it should open up all the tabs that were open in the last session.

This is really a annoyance and there is no reason why Chrome should not be adding this feature to the user interface in the first place, however like always there are things which can be used to get out of situations.

Just a note here, the restore sessions will only work if there are no instances of chrome running, if you open the shortcut you just created, it will result in a new chrome window opening with a blank tab or the homepage you have set up to open.

[via techie-buzz.com]

Bash History Tips (Commands) [Linux]

The Bourne Again Shell, better known as bash, is the default for most Linux distributions. It’s extremely powerful as far as command shells go, and holds all kinds of nifty tricks for those willing to learn. One of the best features is, in my opinion, the command history system.

There are many options to use with the bash history, some of them I use nearly every time I open a command shell. Today I’ll be covering some of the most useful aspects of the history, but I certainly won’t be able to cover them all.

Up/Down Arrows

Many of you probably know this one, but for anyone who doesn’t, it’ll make your life a lot easier. Any time you’re in the command shell, simply use the up and down arrows on your keyboard to move through the list of previously entered commands. Next time you enter a long command that turns out to have a typo, you don’t have to retype the whole thing just hit the up arrow and make whatever edits are needed.

!!

A similar feature to the one listed above is the double bang (!!). Those characters entered in the shell represent the last typed command. Let’s say you’re trying to run a command only to find out that you need root privileges to do it. Instead of retyping the whole command, you can simply enter

sudo !!

Bash will substitute the !! for the previous command, as in the example below.

bash-history-bangbang

This also works further backward, you can do something like

!-5

to recall the command 5 entries back in the history.

!(word)

Perhaps a few days ago you typed a long, complex command into your shell, for example a series of options for “wterm”. You can find and re-enter than command by using the history’s built in search. You simply add the first few letters of the command after the ! and bash will find it.

Example of !(word)

Be careful with this one. You may end up running something other than what you expected. Don’t use this for potentially dangerous commands like “rm” or “fdisk”.

!?(word)

This is similar to the last feature in that it searches the history for the word entered, but unlike !(word) this will find the word anywhere in the command, not just the beginning.

bash-history-bangquestion

Be careful with this one. You may end up running something other than what you expected. Don’t use this for potentially dangerous commands like “rm” or “fdisk”.

Ctrl-R

This one may be my personal favorite history tool. It’s a bit like the !? item above, but interactive. In your command shell, hit Ctrl-R, and it will begin a search. As you type, bash will search the history and show you the results as you type. When it shows the command you want, simply hit enter and it will run that command. This can be safer than things like !? because you can see what the command will be before you run it, so you don’t have to guess or rely on memory.

Example of Ctrl-R in the shell

Manual Search

Perhaps you don’t like the way Ctrl-R works, or you want to see ALL the commands you typed, or just the ones that contain a particular word. The history command will show you your full command history, along with the history number of each command (hold that thought, we’ll cover those numbers in a moment).

You can also specify the number of items the history command will show. To see the last 10 entries in the history, you could type

history 10

To see all history entries that contain a particular word, you can use grep to filter the results, like below.

Example of using grep to filter history list

!(number)

When you use the history command to view your command history list, you’ll notice each item in the list has a number associated with it. You can use that to recall that particular command. For example, item 87 could be run again by entering

!87

into your shell.

Word replacement

This one’s pretty great. How many times have you written out some big long command only to realize you put, say, hdd when you wanted hdc? Well bash has you covered. You can replace a word in the previous command with another using “^”, as in the example below

Example of word replacement with "^"

Managing Your History

By default, the history is saved in ~/.bash_history. You can deal with this file however you see fit, but there are some useful things you could try to manage it automatically. Namely, setting the environment variables HISTSIZE and HISTFILESIZE. To set the number of entries that can be saved in the history file to 1000, enter

export HISTFILESIZE=1000

into your shell. This will limit the file to 1000 entries. If you want to make this change permanent, put that export command into your .bashrc or .bash_profile file.

[via maketecheasier]

Quick Tip: Make VirtualBox OS Window Non-Transparent in Linux (when Compiz is Running)

I noticed a while back that the VirtualBox OS window is set to transparent in some cases when Compiz is also running (a lot of users have reported this, though it's not happening for everyone).

To remove the transparency from the VirtualBox window all you have to do is:

1. Close VirtualBox
2. Add a new shortcut to your Panel, name it "Sun VirtualBox" and under the "Command" field, paste this:
env XLIB_SKIP_ARGB_VISUALS=1 VirtualBox
3. It didn't work right away for me, just after I have restarted my computer, so you may need to do that too.

The next time you want to start VirtualBox, use that shortcut and the window will not be transparent anymore.

The above command works for every application obviously, so if you are having issues with the transparency on some apps, simply put env XLIB_SKIP_ARGB_VISUALS=1 in front of the command that runs that application.