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

Sunday, November 1, 2009

Drop all tables in a MySQL database

Drop all tables in a MySQL database

After finding a reference on the MySQL Lists (http://lists.mysql.com/mysql/193430) I started playing with the idea. I didn't want to have to dump into one file and then run that query. Also - the problem with the above concept is that it drops the table and then recreates it - not what i wanted!

I then looked into using the pipe and grep features in Linux. Now I was getting somewhere! A few tweaks later and this is what I got:

  1. mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE] | grep ^DROP | mysql -u[USERNAME] -p[PASSWORD] [DATABASE]

In the above, [USERNAME], [PASSWORD] & [DATABASE] are all the details for your database. You might not need the username and password fields - depends on your setup!

Hide Removable Drive Icons from Your Ubuntu Desktop

Hide Removable Drive Icons from Your Ubuntu Desktop :: the How-To Geek

I prefer a clean desktop with no icons cluttering it up, but by default Ubuntu adds icons to the desktop for every single removable drive that you attach to your system.

Having recently transitioned to using Ubuntu full-time at home (instead of just part-time), this was one of the first things I wanted to disable. Sadly there's no option in the default configuration screens, so we'll have to use the "registry editor" for Ubuntu, called gconf-editor.

Just type in gconf-editor into the Alt+F2 run dialog to open the app.

Now browse down to the following key:

apps \ nautilus \ desktop

You should see a key in the right-hand pane called volumes_visible. Remove the checkbox from it, and the icons will instantly disappear from the desktop. Remember that you can always access the drives from the "Computer" icon, or easily in the file browser.

I'm much happier now with my beautiful desktop.

Saturday, October 31, 2009

How to Automount NTFS Drives on Ubuntu

HowTo: Automount NTFS Drives - Ubuntu Forums

Fire up a terminal, to do this click Applications > Accessories > Terminal
Then type (or copy/paste) the following - 1 line at a time
Code:
sudo aptitude update sudo aptitude install ntfs-config
Ok so when that returns you to user@pcname, that should be it installed

Next, make sure you have NO drives mounted (they'll usually appear on your desktop). And then run the program from Applications > System Tools

Note: In Ubuntu 9.04 (Jaunty) it appears that the configuration tool has moved to System > Administration.

Enter your password when prompted - and then choose the drives that you want to be automounted. Click Apply.

Now simply make sure that "Enable Write Support for Internal Drives" and click OK.

Enjoy your automounted NTFS Drives

Google网站性能优化工具Page Speed

Google网站性能优化工具Page Speed-月光博客

  和Yahoo的YSlow一样,Google的开源网站优化工具Page Speed,是一个基于Firebug的FireFox插件,和YSlow一样,Page Speed可以帮助用户改善网站性能的工具。在运行它之后,可以看到一个帮助你的网站加载速度加快的建议列表,它会根据列表中的每一项检查你的网站并标明是否通过。

  Page Speed在运行时会分析一些Web服务器配置和服务器上下载下来的代码,还会创建一个结果列表,其中包括如何改进网页的建议。分析基于一个分为五类的最佳实践列表:

  * 优化缓存——让你应用的数据和逻辑完全避免使用网络

  * 减少回应时间——减少一连串请求-响应周期的数量

  * 减小请求大小——减少上传大小

  * 减小有效负荷大小——减小响应、下载和缓存页面的大小

  * 优化浏览器渲染——改善浏览器的页面布局

  这些实践考虑了页面加载时间,以及发出页面请求到客户端看到结果之间的时间。页面加载时间包括创建TCP连接、解析DNS名称、发送请求、获取(包括来自于缓存的)资源、执行脚本、渲染。

  点击访问:Google Page Speed

Friday, October 30, 2009

Using Webilder to set desktop wallpaper on Ubuntu

Howto Set Flickr images as Ubuntu desktop wallpaper | Ubuntu Geek

Webilder delivers stunning wallpapers to your Linux desktop, directly from Flickr and Webshots. You choose what keywords (tags) to watch for, and photos are automatically downloaded to your computer. Webilder can also change the wallpaper every few minutes.

Webilder Features

  • download flickr photos that match tags (for example: beach,party)
  • download photos from flickr users of your choice.
  • download most interesting photos from flickr.
  • download amazing daily proshots from Webshots (requires Webshots account).
  • automatically download new photos for you.
  • change your wallpaper every few minutes.
  • import webshots collections (wbz or wbc formats).

Install Webilder in Ubuntu

First you need to edit the /etc/apt/sources.list file

sudo gedit /etc/apt/sources.list

and add the following source list which is suitable for you save the file and exit

For Ubuntu Intrepid (i386, amd64, powerpc of sparc) Users

deb http://debian.websterwood.com/ intrepid main
deb-src http://debian.websterwood.com/ intrepid main

For Ubuntu Hardy (i386, amd64, powerpc of sparc) Users

deb http://debian.websterwood.com/ hardy main
deb-src http://debian.websterwood.com/ hardy main

For Ubuntu Gusty (i386, amd64, powerpc of sparc) Users

deb http://debian.websterwood.com/ gusty main
deb-src http://debian.websterwood.com/ gusty main

For Ubuntu Feisty (i386, amd64, powerpc of sparc) Users

deb http://debian.websterwood.com/ feisty main
deb-src http://debian.websterwood.com/ feisty main

For Ubuntu Edgy (i386, amd64, powerpc of sparc) Users
deb http://debian.websterwood.com/ edgy main
deb-src http://debian.websterwood.com/ edgy main

For Ubuntu Dapper (i386, amd64, powerpc or sparc) Users

deb http://debian.websterwood.com/ dapper main
deb-src http://debian.websterwood.com/ dapper main

Now you need to update the source list using the following command

sudo apt-get update

Install Webilder using the following command

If you are using GNOME Desktop use the following command

sudo apt-get install webilder webilder-gnome

If you are using KDE Desktop use the following command

sudo apt-get install webilder webilder-kde

This will complete the installation process

Adding Webilder to your Desktop Panel

For GNOME Users

Right-click on the GNOME panel you should see the following screen here you need to choose "Add to Panel"

Once you choose Add to Panel option you should see the following screen here under utility you need select "Webilder Webshots Applet" and click on add

Now you should see one small camera icon marked with Red added to your desktop panel

For KDE Users

From the graphics menu, start KWebilder. Go to the preferences Window, to the Advanced Tab, and select KDE wallpapers settings

Now you need to download photos from flicker for this right click on Webilder on your desktop panel and select "Download Photos" option you can see this in the following screen

Downloading Photos are in progress

Once dowload finished your desktop will start refreshing wallpapers by default 5 min if you want to change this option you need to right click on Webilder on your desktop panel and select "Preferences"

You should see the following option here you can select what time your wallpaper need to be refresh or photos download option

Thursday, October 29, 2009

Q and A - How to Defrag a Linux System

Q and A - How to Defrag a Linux System - Question - NYTimes.com

By J.D. BIERSDORFER
Published: October 28, 2009

Q. I recently bought a netbook with Ubuntu as its operating system and would like to know if there is any simple way to defragment the drive. The help manual for the system talks only about a complete start-over with reinstalling the OS, rather than defragmenting it.

A. Ubuntu Linux uses a different file system, or method of storing and organizing data, than other operating systems do. Most Ubuntu systems use the ext3 file system, which does not need regular defragmentation like a Windows system does.

Windows uses either the NTFS or FAT file systems, which do not always store all the pieces of a file near each other on the hard drive. Running the built-in Disk Defragmenter program reorganizes these fragmented file parts near each other for faster access by the system.

The ext3 system used by Ubuntu Linux, however, keeps all the parts of a file together (or nearby), making regular defragmentation unnecessary. A page on the Community Ubuntu Documentation site has a full explanation at bit.ly/4iKt4.

It's not impossible to defragment a Linux system, however; the Web Upd8 blog has some tips for doing so at bit.ly/4r2yS1. A newer version of the Linux file system, ext4, includes a built-in defragmenting program.

Personal Tech invites questions about computer-based technology, by e-mail to QandA@nytimes.com. This column will answer questions of general interest, but letters cannot be answered individually.

Tuesday, October 27, 2009

A Linux GUI Diff Tool - Meld

Meld : Home Page

Meld is a visual diff and merge tool. You can compare two or three files and edit them in place (diffs update dynamically). You can compare two or three folders and launch file comparisons. You can browse and view a working copy from popular version control systems such such as CVS, Subversion, Bazaar-ng and Mercurial. Look at the screenshots page for more detailed features.

screenshot screenshot screenshot screenshot

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