Archive

Archive for July, 2007

Firefox – Extensions to Disable Flash Content

July 31st, 2007 jesse No comments


prodotto macromedia flashb

I really do not like Adobe Flash. It’s annoying. I do not understand how animation and sound effects imply create and enhancement to the efficiency with which one locates, filters and uses information on the Internet.

It’s also a resource hog. Similar to Java, Adobe Flash runs in its own virtual machine, which piggybacks on the browser, and consumes large CPU and memory resources when rendering content. If you look carefully, before and after versions of Firefox, Safari and IE nearly double memory consumption after installing Flash.

Flash is eye candy, little more, and adds no discernable value over AJAX or Java. I find Flash especially annoying when used for advertisements, because you cannot turn them off.

There are, however, two very nice Firefox extensions available to solve this vexing problem.

Flashblock

This is, in my opinion, the best Firefox extension available. It’s very handy for when you want to use certain Flash components but not others. Flashblock works by disabling automatic start of all Flash content on a page, giving each Flash object a Run button instead. If you wish to view or activate certain widgets simply press run and your normal viewing experience returns.

Screenshot-Flashblock-Firefox Add-ons - Iceweasel

Remove It Permanently

This is a great too for disabling advertisements. Load the page you want and right click in the area of offending content. Select “Remove this permanently” from the context menu and you’ll never be annoyed again by dancing aliens trying to refinance your mortgage.

Screenshot-Remove It Permanently-Firefox Add-ons - Iceweasel

References

Categories: Nonsense Tags:

WordPress – Convert a Post to Page

July 27th, 2007 jesse No comments

WordPress is an excellent web content management system. I’m a big fan of the separation of business logic and data, and WordPress implements this strategy beautifully. In WordPress, the actual files are very simple PHP-based templates and programs, and all the content is stored in a database. When a page is requested, the page template is combined with the database content. To make changes, you can either edit the content or the page – it keeps things simple and very flexible.

One complaint I have is WordPress’ concept of Pages versus Posts. A Page is a considered to be permanent, static and carrying more substance or import, whereas a Post would then be considered ephemeral and light – like a blog entry.

But what if you wrote something substantial and wanted to feature it as a page?

Well, it turns out that in WordPress the difference between Pages and Posts is minimal, and they can be easily interchanged.

Note – there are one or two WordPress plug-ins that do this for you, but I’ve found they do not work properly. This method is 100% sure. Also note that my installation is MySQL, but the same should apply with Postgres.

All Pages and Posts are stored in the database wordpress (typically) and then in the table wp_posts. This table has many fields, only one of which, the post_type, determines an entry’s Page/Post status.

mysql> describe wp_posts;
| ID
| post_author
| post_date
| post_date_gmt
| post_content
| post_title
| post_category
| post_excerpt
| post_status
| comment_status
| ping_status
| post_password
| post_name
| to_ping
| pinged
| post_modified
| post_modified_gmt
| post_content_filtered
| post_parent
| guid
| menu_order
| post_type varchar(20) not null, DEFAULT = post
| post_mime_type
| comment_count

In my blog I’ve accumulated only three types of posts.

mysql> select distinct post_type from wp_posts;
+------------+
| post_type |
+------------+
| attachment |
| page |
| post |
+------------+

As a point of curiosity, the post_status field is an enumerated type and can be set into the future if you want to delay the publication of a post.

post_status enum('publish', 'draft', 'private', 'static', 'object', 'attachment', 'inherit', 'future')

To change any given post to a page, you simply change the post_type field from “post” to “page”.

First, identify the post identification number. This can be done by looking at the URL in your browser when viewing the page. For example, in the URL

http://localhost/?p=5

the post ID is 5.

Then log into mysql and make the update.

mysql> update wp_posts set post_type="page" where ID=5;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

You’re done. Post is now a Page. Check it out.

Categories: Linux Misc Tags:

Using the Windows START Button in Gnome

July 26th, 2007 jesse No comments

gnome smNote: This is a Gnome gconf hack and applies to any Gnome desktop that uses the Metacityt plus the Gnome Panel, including Fedora, Debian, Ubuntu, Suse, etc.

startmenuThe Problem: If you’re a windows user, the START and LEFT-CLICK button on your keyboard often come in handy, especially if you find navigation via the keyboard to be more efficient than grabbing the mouse.

Unfortunately, the START key is not mapped by default in Gnome – rather, Gnome uses the <ALT> + F2 combination to show the Gnome Menu.

keyboard4

A Solution: Create a gconf file instructing gnome to behave nicely. Here’s how to bring consistency to your desktop menu.

Via the GUI

  • Launch the Gnome Control Center
  • Select Keyboard Shortcuts
  • Click “Show the panel menu” – the existing shortcut is typically <Alt>F2, which will change to “New accellerator …” when you click it
  • Press the Windows Start key on your keyboard. The shortcut will change to “Super_L”
  • Click Close – you’re done.


Screenshot-Desktop PreferencesScreenshot-Keyboard Shortcuts

Via the Command Line

Create the following file inside your ~/.gconf directory

% vi ~/.gconf/apps/metacity/global_keybindings/%gconf.xml

<?xml version="1.0"?>
<gconf>
<entry name="panel_main_menu" mtime="1185455947" type="string">
<stringvalue>Super_L</stringvalue>
</entry>
</gconf>

Save the file and you’re done. Your START button should now work.

Categories: Linux Desktop Tags:

Linux – Setting the Date and Time

July 26th, 2007 jesse No comments

ClockPenguinI have a linux system with a sloppy clock – it runs a little slow and after several months is off by a few minutes.

Also – I’m too lazy to install NTP.

So every once in a while I’ll notice that the time is wrong and need to adjust it. date is the program to use, and here is how:

The date command sets the system kernel time and date. To set the time manually, do this:

% date -s “16:15:00″
Fri Mar 28 16:15:00 CST 2007

If you also need to adjust the date, and not just the time, you can do it like this:

% date -s “16:55:30 July 7, 2007″
Mon July 7 16:55:30 PDT 2007

Without the -s option you can use a string field arranged like this:

MMDDhhmmCCYY.ss

where MM = month
DD = day
hh = hour
mm = minute
CCYY = 4 digit year, and
ss = seconds.

Note that setting the clock with the date command must be done as root.

Also note that the kernel clock is not the hardware (CMOS) clock.

You can look at the current hardware clock time with:

% hwclock –show

To set the hardware clock you can either reboot and edit it in the CMOS directly, or use hwclock as follows:

% hwclock –set –date 13:21

Note that this must also be done as root.


References:

Categories: Linux Misc Tags:

Enable/Disable the Windows Logo Key

July 26th, 2007 jesse No comments

I often run Windows XP within OSX Parallels. One annoyance is that the oft used and benign in OSX function key (open-apple) is mapped to the windows start key in Parallels.

So, for example, the key binding to type a URL in firefox on OSX (Apple + L) in Windows is Logout. It’s an annoyance.

Here’s how to disable the Windows start key and bring some consistency between the two.

(Ideally, I’d remap it to the <CMD> key – Does anyone know the key binay value for that?)

In Windows:

[Start] [Run] [Regedit]

registry listing

Within Regedit:

  1. Navigate to the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout
  2. Modify/Create the Value Name [Scancode Map] according to the Value Data listed below.
  3. Data Type: REG_BINARY [Binary Value]
    Value Name: Scancode Map
  4. Value Data: [Enter Exactly as Shown Below]
    00 00 00 00 00 00 00 00 03 00 00 00 00 00 5B E0 00 00 5C E0 00 00 00 00

scancode map

To re-enable, just delete the HKEY.


References:

Categories: Uncategorized Tags: