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

Wednesday, December 9, 2009

How to reset my WordPress admin password?

How to reset my WordPress admin password?

You have to do this through the WordPress database directly. The most convenient way to manage the database is via the phpMyAdmin tool at your web hosting account.

Once in phpMyAdmin select the WordPress database from the drop-down menu on the left. The page will refresh and the database's tables will be displayed on it. Open the SQL tab (look at the top navigation bar).

In the text field write the following SQL query:

UPDATE `wp_users` SET `user_pass` = MD5( 'new_password_here' ) WHERE `wp_users`.`user_login` = "admin_username";

"new_password_here" - replace this with the new password you wish to use.
"admin_username" - replace this with the username the password should be updated for.

Once you are ready, click on the GO button to submit the query. If everything goes fine without errors, you should be able to login to WordPress with the new password.

If you have problems resetting the password yourself, ask your host for assistance. SiteGround provides the best WordPress hosting and such requests are handled with ease.

How to Move WordPress Blog to New Domain or Location

How to Move WordPress Blog to New Domain or Location » My Digital Life

For blogger who self-hosts the WordPress blog publishing system on a web hosting server with own registered domain name, sometimes, you may decide to reorganize the blog link URL to make it tidier or to reflect new focus or theme of the blog. If you decide to change the URL or link location of your WordPress blog due to changing of domain name (such as from http://www.old-domain.com/ to http://www.new-domain.com/) or the blog to another directory location (such as from http://www.domain.com/ to http://www.domain.com/blog/), there are some steps that should be done to ensure the proper migration and no breaking links.

The tricky part when moving WordPress blog to another location is that WordPress is using absolute path in URL link instead of relative path in URL link location when stores some parameters in database. Within blog posts' contents itself, users may also use the old URLs when creating reference backlinks. All these values in the database will need to be changed when WordPress is moved. The following guide will show you which database fields that has references or values related to blog's URLs that you want to modify. Note that this guide is not about how to move WordPress blog from one server or host to another new hosting service.

Once the blog has been moved (all files copy over in case of moving location or server or new domain name properly propagated across Internet for new domain name), the first thing to change is to tell WordPress the new blog location (wp-config.php should be no changes, and .htaccess file should be also no changes. If for some reason mod_rewrite rules for friendly URLs no longer works, you can always regenerate the .htaccess file via WP Administration's Update Permalinks page). This value can be changed via WordPress Options page, but if you no longer able to access to old blog URL, you have to modify the value via MySQL database.

Note: The guide uses SQL statements based on MySQL replace() function to modify the database. To run SQL queries, login to MySQL database that houses WordPress tables via phpMyAdmin or loginto the DB server and run MySQL client as root.

To update WordPress options with the new blog location, use the following SQL command:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as absolute URLs instead of relative URLs, so it needs to be changed with the following SQL query:

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

Browse through WordPress blog to check if everything is okay. You also need to re-login to WP Administration as authentication cookie has now became invalid due to different domain.

Tuesday, December 8, 2009

Howto Clean up your packages

Howto Clean up your packages | Ubuntu Geek

It's worthwhile to do this every now again again on your ubuntu box when you've been installing and uninstalling new apps. This will go through and check which packages have been installed that are no longer needed. It will then remove them for you

apt-get autoremove

Output looks like below

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
libcommoncpp2-1.5.3-0
The following packages will be REMOVED
libcommoncpp2-1.5.3-0
0 upgraded, 0 newly installed, 1 to remove and 29 not upgraded.
Need to get 0B of archives.
After unpacking 688kB disk space will be freed.
Do you want to continue [Y/n]?

Here you need to select Y to remove these packages

EtherPad: Realtime Collaborative Text Editing

EtherPad: Realtime Collaborative Text Editing

EtherPad is the only web-based word processor that allows people to work together in really real-time.

When multiple people edit the same document simultaneously, any changes are instantly reflected on everyone's screen. The result is a new and productive way to collaborate on text documents, useful for meeting notes, drafting sessions, education, team programming, and more.

Introduction to the xmonad Tiling Window Manager

Introduction to the xmonad Tiling Window Manager | Tombuntu
Posted by Tom in software

(Tried, but removed, HL)

What good is having a large display if you're constantly rearranging windows to fit them on the screen? I got tired of try to fit a web browser with other smaller windows and decided to try xmonad, a tiling window manager that could do this for me.

A tiling window manager arranges your windows in a grid. This maximizes window sizes and prevents any window from obscuring another.

xmonad displaying a few windows

Installing xmonad
xmonad is available from the Ubuntu repositories. Install xmonad from the package xmonad (click the link to install), or by running the command below in your terminal:
sudo apt-get install xmonad

A number of dependencies will be installed with xmonad. They are needed because reconfiguring xmonad requires recompiling it. (Don't worry, this is handled automatically.)

I'd also highly recommend installing dmenu, a simple application launcher that integrates with xmonad. Install dmenu from the package dwm-tools (click the link to install), or by running the command below in your terminal:
sudo apt-get install dwm-tools

From the login screen, you should now be able to select an xmonad session and log in to start xmonad.

The basics of using xmonad
Note: All the keyboard commands you'll use with xmonad begin with what's called the mod key. The default mod key is the left alt key.

If no windows are open xmonad will just display a blank screen. Open a new terminal window with mod+shift+return. With only one window open, xmonad will let it use the entire screen.

Instead of running more applications using the terminal, let's use the dmenu launcher. If you have dmenu installed, pressing mod+p with open it on the top of the screen. Start typing to find an application, use the right and left arrows to select a result, and press return to run the selected application. Press escape to close dmenu if you decide not to run anything.

Open some applications so you have more windows to experiment with. Notice how xmonad splits the screen down the center. On the left side is the master pane by itself. On the right side all the other windows are displayed stacked on top of each other.

xmonad tall layout

Press mod+space to cycle though different tiling algorithms. By default there are three: tall (vertical split with master pane on left), mirror tall (horizontal split with master pane on top), and full (one window displayed full screen).

The currently focused window is displayed with red borders. You may have already noticed that you can focus a window by moving the mouse over it. On the keyboard, switch focus using mod+j (focus next window) and mod+k (focus previous window).

Perform the equivalent of clicking a conventional window manager's close box for a window by pressing mod+shift+c.

What if you want to move a window into the master pane? The simplest way to do this is mod+return, which swaps the currently focused window into the master pane. For finer control of where windows are displayed use mod+shift+j (move the focused window up) and mod+shift+k (move the focused window down).

If the master pane is not the right width (tall mode) or height (mirror tall mode), you can resize it using mod+h (smaller) and mod+l (larger).

Like most window managers, xmonad offers multiple workspaces. By default you get nine workspaces, each corresponding to a number key. Pressing mod+[num], where [num] is from 1 to 9, will switch you to that workspace. Use mod+shift+[num] to move the focused window to the specified workspace.

You may have noticed that some applications and dialog windows are not tiled normally. These are floating windows, which you can move and resize like windows in a conventional window manager. To float any window yourself, hold down the mod key and drag the window with the left mouse button. Once a window is floated you can move it around the screen in the same manner. Use the mod key and right mouse button to resize a floated window. Tile a window normally again by focusing it and pressing mod+t.

With these basics, you should be able to start using xmonad.

Reconfiguring xmonad
xmonad is configured using a Haskell source file (~/.xmonad/xmonad.hs); you will need to create this file for your user:
mkdir ~/.xmonad
touch ~/.xmonad/xmonad.hs

The easiest way to get started customizing xmonad is using a template configuration file containing all the default settings and comments explaining what they do. Such a template is available on the xmonad wiki. Paste it into your ~/.xmonad/xmonad.hs file. You'll probably want to change the myTerminal setting back to gnome-terminal (or your own preferred terminal) instead of xterm.

The mod+q key combo will reconfigure xmonad with your settings, and restart it. This process happens very fast and nearly seamlessly, you might miss it! If there's an error in the configuration file, xmonad will fall back to the previous settings and display an error dialog.

Read though the template configuration file and have fun customizing it to your tastes!

These are only the basics, you can do much more with xmonad than what I've covered. The xmonad documentation is a good resource if you want to learn more.

Sunday, December 6, 2009

Google Analytics推出异步跟踪分析

Google Analytics推出异步跟踪分析-月光博客

  据Google Code博客报道,Google宣布推出Google Analytics异步跟踪模式,用来提高使用Google Analytics的用户体验,提高用户的访问速度。

  新的代码具有以下优点:

  1、网页能更快地加载跟踪代码,改善浏览器加载时间。

  2、增强数据收集的准确性。

  3、消除因JavaScript代码未完全加载而差生的错误。

  这里是新的统计跟踪代码示例

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();

</script>

  异步跟踪代码的第一部分分配了_gaq变量的JavaScript数组,此后,两个API调用将编码后的数据写入此数组,当跟踪代码初始化的时候,它把数组_gaq的数据加载到一个新的对象中,并执行跟踪API调用此数组中的初始数据,因此,使用这样的代码,可以将所有跟踪统计所需要的数据全部存储下来,即使Google Analytics的代码还没有下载完,因此就不必再担心ga.js跟踪代码的依赖性问题了。

  该代码的下半部分动态创建了一个script元素,并设置好合适的地址,因此,大多数浏览器将在另一个script代码中加载跟踪代码,以减少网页加载时间。

  一旦代码被加载,就会将_gaq数组转换为一个谷歌分析的_gaq对象,该队形做为基础的_gat对象执行所有命令,将数据发送到用户的Google Analytics账户。

  新的异步跟踪代码正处于测试阶段,可供所有的Google Analytics用户使用,这个代码是可选项,原有的Google Analytics代码依旧工作正常,不过,如果你想要提高你网站的速度并增加分析数据的准确性,建议使用这个新代码。该代码的开发文件参见这里,示例参见这里

Friday, December 4, 2009

Google推出免费DNS服务

Google推出免费DNS服务-月光博客

  据Google官方博客报道,Google推出了一个名为"Google Public DNS"的域名解析系统,允许用户免费使用Google的服务器解析网络域名,以加快上网速度,改善网络用户的浏览体验,提高安全性和有效性。

  DNS(Domain Name System)是域名解析服务器的意思,它在互联网的作用是把域名转换成为网络可以识别的IP地址。当用户在浏览器中输入网址域名时,首先就会访问系统设置的DNS域名解析服务器(通常由ISP运营商如电信、联通提供)。如果该服务器内保存着该域名对应的IP信息,则直接返回该信息供用户访问网站。否则,就会向上级DNS逐层查找该域名的对应数据。

  目前国内上网用户普遍使用的是默认DNS服务器,即电信运营商的DNS服务,这带来一个巨大的风险,就是DNS劫持。目前国内电信运营商普遍采用DNS劫持的方法,干扰用户正常上网,例如,当用户访问一个不存在(或者被封)的网站,电信运营商就会把用户劫持到一个满屏都是广告的页面:电信114互联星空网站,这个114网站不仅搜索质量低劣,而且广告众多,极大的影响了用户上网的安全性和浏览体验。后来,电信运营商的胆子越来越大,甚至连Google的网站电信都敢劫持,这进一步证明了电信运营商的DNS服务可靠性是多么糟糕。

电信114互联星空

电信114互联星空的页面

  因此,我以前曾经强烈建议网友使用国外DNS解析服务器,例如OpenDNS的免费DNS服务,他们的DNS为208.67.222.222和208.67.220.220,以免被中国电信劫持。

  但OpenDNS有两个缺点,一是OpenDNS的服务器在美国,使用的人多了有可能会速度变慢,没有国内的DNS速度快,二是OpenDNS的IP地址不太好记,容易忘。

  现在,中国网民的福音终于到了,Google面对大众推出了免费的公共DNS系统,Google表示推出免费DNS的主要目的就是为了改进网络浏览速度,为此Google对DNS服务器技术进行了改进,通过采用预获取技术提升性能,同时保证DNS服务的安全性和准确性。

  普通用户要使用Google DNS非常简单,因为Google为他们的DNS服务器选择了两个非常简单易记的IP地址:"8.8.8.8"和"8.8.4.4"。用户只要在系统的网络设置中选择这两个地址为DNS服务器即可。使用方法非常简单,对于宽带拨号用户来说,在"设置"-"网络连接"中找到宽带上网的连接,打开网络连接属性,选择Interner协议(TCP/IP)的属性页里,不要选择自动获取DNS,而要选择"使用下面的DNS服务器地址",首选DNS服务器和备用DNS服务器分别设置为 8.8.8.8和8.8.4.4,如下图所示,完成后重新连接上网即可。

网络连接属性

网络连接属性

  Google提供的公共DNS服务与电信或OpenDNS的不同,当用户输入一个错误的或者不存在的网址的时候,不会像中国电信一般直接弹出一个满屏都是广告的页面,Google公司承诺绝不会重定或者过滤用户所访问的地址,而且绝无广告。对于OpenDNS用户来说,Google的技术雄厚,两个IP地址也很好记,并且不会显示广告,相信会有不少原先OpenDNS的用户会跳槽到Google DNS。

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,然...