1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Monday, February 15, 2010

PAC Manager - Perl/GTK Gnome replacement for SecureCRT/Putty/etc

PAC Manager - Perl/GTK Gnome replacement for SecureCRT/Putty/etc | Ubuntu Geek
February 13, 2010 · General
(Not working on Ubuntu 8.10, perl version is too old, HL 20100215)

PAC is a Perl/GTK Gnome replacement for SecureCRT/Putty/etc… It provides a GUI to configure SSH/Telnet connections: users, passwords, EXPECT regular expressions, macros, etc. You like 'SSHMenu'? If so, you must check this tool.
PAC Manager Features

* Unique linux app to implement SecureCRT's functionality (more or less!)
* Remote and local macros
* Remotely send commands with EXPECT regexp
* Quick acces to configured connections via tray menu icon
* Pre/post connections local executions
* TABS OR WINDOWS for connections!!
* FREE (GNU GPLv3)

Install PAC Manager in Ubuntu

first you need to download .deb package from here

Once you have .deb package you need to install using the following command

sudo dpkg -i pac-0.9.2-all.deb

This will complete the installation

Screenshot

Friday, February 12, 2010

How to configure Firefox and Firebug to use External Editors

[other] HELP: How to configure firebig editors. - Ubuntu Forums
(I used geany instead of gedit, HL 20100213 )

This will get Firebug to work with Gedit:

in firefoxes address bar type :
about:config
then search for :
view_source.editor.external
- and set this boolean to TRUE

then search for :
view_source.editor.path
- and set this to ' /usr/bin/gedit '

Then open FireBug and add Gedit as an editor:
View -> Open with Editor -> configure Editors
Name it gedit and then browse for the executable within '/usr/bin' and select gedit.
Now you should see '/usr/bin/gedit' underneath 'executable' column in the configured editors window.

How To install OpenOffice 3.2 in Ubuntu

How To install OpenOffice 3.2 in Ubuntu | Ubuntu Geek

This tutorial will explain how to install latest version of openoffice in ubuntu

You can check what is new in openoffice 3.2 from here

First go to the OpenOffice website and download the Linux .deb file (On your desktop)

1 - Once you have done that, extract the .deb file,

OOo_3.2.0_LinuxIntel_install_en-US_deb.tar.gz

Run the following command from terminal or just right click select extract

tar xzvf OOo_3.2.0_LinuxIntel_install_en-US_deb.tar.gz

Then you'll see a file called OOO320_m12_native_packed-1_en-US.9483

2 - You can remove the existing version of OpenOffice if you wish with this command:

sudo apt-get remove openoffice*.*

3 - Copy and paste OOO320_m12_native_packed-1_en-US.9483 onto the desktop then open Terminal and paste this command:

sudo dpkg -i ~/Desktop/OOO320_m12_native_packed-1_en-US.9483/DEBS/*.deb

4 - Then paste this command:

sudo dpkg -i ~/Desktop/OOO320_m12_native_packed-1_en-US.9483/DEBS/desktop-integration/openoffice.org3.2-debian-menus_3.2-9472_all.deb

Once you've done that you'll find OpenOffice 3.2 in Office.

Credit goes here

Thursday, February 11, 2010

How to Debug PHP Using Firefox with FirePHP

How to Debug PHP Using Firefox with FirePHP
July 11th, 2009 by Nuno Franco da Costa

Typically, there are two main ways of debugging server-side code: you can utilize an Integrated Development Environment (IDE) with a built-in debugger or log and perform your debugging processes in a web browser.

How to Debug PHP Using Firefox with FirePHP

This article shares an elegant, simple, and more maintainable way of debugging Ajax apps via the web browser (more specifically for the Mozilla Firefox browser). You'll learn the basics of leveraging Firefox in conjunction with Firebug and FirePHP to implement FirePHP libraries on web apps and logging messages in the Firebug console.

A Brief Introduction

When Ajax techniques became popular, developers faced a new problem: how can we debug Ajax requests and responses efficiently for complex web applications? If using a debugger was hard enough with the RESTful model, triggering an Ajax-specific request is a pain and a bit more difficult; dumping logs and information pertaining to those Ajax operations had to be done using JSON or XML.

A Brief Introduction

This is where FirePHP helps, allowing you to log your debugging messages to the Firebug console. FirePHP doesn't mess with your code (and it doesn't require you to modify anything to trap errors): the messages you print are sent to the browser in the HTTP response headers, which is great when you're using JSON or XML since it won't break their encoding.

This makes FirePHP ideal not only for debugging your Ajax requests, but also your entire PHP codebase.

So, what is FirePHP?

FirePHP is an add-on for an add-on: it extends the popular in-browser web development tool called Firebug with an API for PHP web application developers. FirePHP is free and easily attainable via the Mozilla Add-Ons section on the official Mozilla site. The official FirePHP site can be found via this web address: www.firephp.org. Christoph Dorn is the person responsible for creating FirePHP.

What Do I Need to Get Started?

As you might have guessed, you need three things to get up and running with FirePHP, they are:

  1. Firefox
  2. Firebug
  3. FirePHP

If you don't have all of the above applications installed on your machine, click on their link to learn about how to download them for your particular system.

Installation of the three things above is a straightforward process. FirePHP can be a little tricky to install if you've just recently started learning about web development, but there's good documentation out there about it.

This article is about using FirePHP, so I'll let you handle the installation part (though feel free to ask in the comments – we'd be happy to help if you encounter issues).

A Couple of Tips

Once you've installed FirePHP, and included it in your web application, you are ready to debug and log data. But first, I'd like to share two helpful tips I've learned:

Tip #1: call ob_start()

Because the information is sent to Firebug in the HTTP Headers, you should activate the output buffering or you might get the "headers already sent error". It may sound complicated, but all you have to do is write ob_start() on the first line of your PHP script that you're debugging.

Tip #2: don't forget to disable FirePHP Logging when you go live

You have to disable FirePHP when the site goes live or you will risk exposing sensitive information to anyone that has Firebug/FirePHP installed (we'll talk about how to do this later down the article).

And then just a general tip for Firebug/FirePHP users: it's also a good idea to disable or suspend Firebug and FirePHP when you're just browsing the web because they can really slow down some websites and web applications (such as Gmail, for example).

Getting Started with FirePHP Logging

This is the fun part where we start logging messages and reviewing the basic logging functions.

One thing to note is that, just like PHP, which (at least for PHP4 and PHP5) is a "pseudo object-oriented" language, you can use FirePHP in a procedural or object-oriented (abbreviated OO from now on) manner.

I prefer the object-oriented techniques and I encourage you to use the same pattern as it is considered the most popular and most modern approach to building apps.

The OO API allows you to instantiate a Firebug object to use it or to call its static methods directly. I'm a lazy guy and because static methods are more terse and require less typing, that's what I use.

Instantiating the OO API Object

In your script, you can use the following code block to create the FirePHP object ($firephp).

require_once('FirePHPCore/FirePHP.class.PHP'); $firephp = FirePHP::getInstance(true); $firephp -> [classmethod]

OO API with Static Methods

This is the format for calling static methods in your scripts.

require_once('FirePHPCore/fb.PHP'); FB::[nameofmethod] 

The Procedural API

Here's how to use FirePHP's Procedural API:

require_once('FirePHPCore/fb.PHP'); fb($var) fb($var, 'Label') fb($var, FirePHP::[nameofmethod])

We will not get into any detail about the benefits and coding style of each API, I've included them here only so you see what options are available for you. In other words, I don't want to start a flame war about which procedure is better – it's up to you to decide and I've noted my preference.

Logging Messages and Information in the Firebug Console

Let's talk about logging messages in the Firebug console (remember, this will only work if you've configured your app for FirePHP).

Examples of Basic Logging Calls

If you are ad-hoc debugging a bug, the following examples are what you'll be interested in utilizing.

Fb::log("log message")

This will print a string that you pass to it onto the Firebug console. Using the above example results in the following message:

Log message.

Fb::log($array, "dumping an array")

Passing an array (no more for loops or print_r() in your scripts) outputs the content of your array. The above example will result in the following message in the Firebug console:

Dump message array

Tip: when you hover your mouse on logged variables in the Firebug console, an info window will appear in the web page containing all of its elements. It's a nifty feature, don't you agree?

Variable Viewer

Logging an Information Message

Here is an example of logging information messages using the info method.

Fb::info("information")

This is the message it logs in your Firebug console:

info message.

Logging a Warning Message

Here is an example of logging a warning message.

Fb::warn("this is a warning")

This is the message it logs in your Firebug console:

Warning message

Logging an Error Message

Here is an example of logging a warning message using the info method.

Fb::error("error message") 

Here's what an error message looks like in the Firebug console:

Error message.

Enabling or Disabling FirePHP Logging

When your site goes live, you can (and should) disable FirePHP logging. Call the following line of code on the first lines of your script.

FB::setEnabled(false);

What's great about this is that you can leave all of your FirePHP code in your scripts for later use – just pass either true or false when you want to turn logging on or off.

If your application uses a "config file" to keep track of global settings, it is advisable to set a configuration option to enable or disable it.

Conclusion

First, here's a screen capture showing all of our messages in Firebug all at once (I ran it sequentially).

Conclusion: all together now

In this article, we covered the very basics of using FirePHP to help you debug and gain information about your PHP/Ajax applications easier and through the web browser. I hope that this results in you becoming convinced that you should explore your debugging options outside of "old-school" techniques such as using echo or print on top of your web page layout to see what a variable or array contains. Using FirePHP is so easy and convenient, and gives you much more options and data for debugging purposes.

In a future article, I'll be covering more complex features of FirePHP and using Firebug to make this simple debugging tool a more robust and fully-featured logging framework.

So stick around, don't forget to subscribe to the Six Revisions RSS feed so you get a note when that article is posted. * Article edits by Jacob Gube

Related content

About the Author

Nuno Franco da Costa is a web developer and sys admin. By day, he works at a design agency coordinating the development and sys admin teams where he developed a PHP MVC framework and a WEB 2 CMS. He loves to code and has a "getting things done" attitude. You can find over at his online presence www.francodacosta.com

Desktop publishing for Linux at its finest

Desktop publishing for Linux at its finest - ZDNet.co.uk
Thursday 11 February 2010, 1:39 PM
Posted by apexwm

Over the years, Linux has lacked a good all-around desktop publishing application. Well, those times are over. Enter: Scribus. Scribus is a great application, that ties in features from proprietary programs like Adobe PageMaker, Adobe InDesign, Quark xPress, Microsoft Publisher, and others. Over the years I've used a few of the proprietary programs, mostly PageMaker and Quark xPress. If you are familiar with these proprietary programs, using Scribus will be like second nature. Its features and functionality are similar enough that you will easily be able to catch on and learn it, and hopefully migrate over to it and save yourself from re-purchasing those pesty proprietary programs over and over.

The first time I used it, I was pleasantly surprised to see how its interface is very clean, straightforward, yet packed with features. Inserting text elements, graphics, editing the text, everything. And, it has a powerful PDF Export feature, complete with prepress quality options.

There is one caveat with this program though. It cannot import any proprietary files, i.e. PageMaker files. If you have old files that you created in a proprietary program, you must recreate the file from scratch. Apparently the developers of Scribus did not want to encounter any issues with the proprietary programs, so they decided to stay away and make Scribus completely independent.

It's too much to go through here, but if you do any sort of desktop publishing it's definitely worth checking out. If you use Linux, Scribus should be available with your distribution.

Wednesday, February 10, 2010

The Zen Cart Execution Process

以:http://192.168.0.161/lightbox/index.php?main_page=account 为例

We know $main_page=account

index.php will do the following:

1. it loads 'includes/application_top.php'

This file will load in all of general definitions used site-wide, initialize some site-wide classes ($template, $db) and do other general stuff.

2. it loads all of the files starting with 'header_php' in 'includes/modules/pages/account'

'header_php.php'

3. now it loads from includes/templates/mytemplate/common/

'html_header.php'

The default html_header.php file will simply create all of the HTML up to the </head> tag

It loads 'includes/modules/meta_tags.php',

It loads 'includes/templates/mytemplate/css/style*.css'

It loads 'includes/templates/mytemplate/js/jscript_*.js'

'main_template_vars.php'

set $body_code to: includes/templates/mytemplate/templates/tpl_{$main_page}_default.php (tpl_account_default.php)

Here all of the program logic and variables will be mixed up with the actual displayed HTML code

'tpl_main_page.php'

this file lays out the basic page.

1. <body>

2. loads the 'includes/modules/header.php' file

3. if the left column is enabled, it loads 'includes/modules/column_left.php'

4. it loads the file set in $body_code (tpl_{$main_page}_default.php &#20063;&#23601;&#26159;: tpl_account_default.php)

5. if the right column is enabled, it loads 'includes/modules/column_right.php'

6. loads 'includes/modules/footer.php'

7. </body>

Reference: The Zen Cart Execution Process

Google发布Gmail微博客Google Buzz

Google发布Gmail微博客Google Buzz-月光博客

  今天,Google在其最热门的产品Gmail中发布了一个重要的社交网络服务Google Buzz,该服务类似Twitter等热门社交网络服务,可让Gmail用户分享自己的状态更新,可从浏览器或手机终端使用,目前这项服务正在分批向Gmail用户开放,预计不久Gmail用户都会看到这项功能。

  Google的这项服务将对Twitter产生一定的压力,Yahoo则称自己早在1年半前就推出过Yahoo Buzz(其实这个产品和Google的并不一样),微软则对Google Buzz进行了抨击,称人们不需要再多一个社交网络了。目前Gmail是全球第三大电子邮件服务,使用量仅次于雅虎邮件和微软Hotmail。

  对于中国用户来说,Gmail支持微博客后,有可能会导致Gmail服务被屏蔽,这是一个令人悲哀的预测,我的工作生活已经离不开Gmail了,如果用不了这个服务,那么上网的一半事情都做不了。

  因此,虽然我现在还没有开通Google Buzz,不知道Buzz实际是什么样子,但我还是希望Google Buzz是类似QQ邮箱的那种微博,从外部无法访问,登录后才能看到,这样的话即保护了隐私,又避免了被墙。不过从QQ邮箱的微博使用情况来看,这么设置的话可能不会有太多人使用。

Google发布Gmail微博客Google Buzz

  由于Google Buzz在iPhone中默认就能使用,喜欢尝鲜的用户可以安装Firefox扩展User Agent Switcher,然后设置User Agent为iPhone 3.0就可以模拟iPhone使用Google Buzz的功能,我目前就是通过这种方法提前体验Buzz,但是在电脑的浏览器上却依然看不到Buzz的链接。

  Google Buzz默认使用了Google Reader的好友关系,我刚刚登录使用,就有了1137个followers,并Following了407个人,用户的发言可以在自己的个人Google Profile地址中显示,这让我更加担心google.com的安危了。

  Google以前在Google Reader中也曾经推出过类似微博客的产品,界面和功能都克隆Twitter,可惜最终并未成功,但是这次,我比较看好Google Buzz,虽然以前Google Reader的微博失败了,但因为Google Reader是个小众产品,而Gmail是个大众产品,只要有1%的Gmail用户使用Buzz,那就有几十万用户,这是其他微博客产品所不敢想象的。

  在我使用Buzz的过程中,发现只要自己发布或者参与过的信息有更新,Buzz都会发邮件一个邮件,这点设计的太不好了,容易让人受到邮件骚扰,LifeHacker介绍了一个防止被Buzz邮件打扰的办法,创建Gmail过滤器,包含字词label:buzz,将其存档并标记已读即可。

  Google Buzz API 已经开放了,可供第三方程序调用,API的地址是: http://code.google.com/apis/buzz/

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...