Search
Archive

You are currently browsing the archives for the TechTips category.

Categories
Ad

Archive for the ‘TechTips’ Category

Run mulitple ‘exec’ commands to UNIX ‘find’ command

Tuesday, March 30th, 2010

Problem

You want to apply multiple commands against the results of ‘find’

Solution

Just pass as many exec options as you want :) .

The command below will run ‘id’, ‘echo’ and ‘file’

% find . -type f -exec id {} \; -exec echo ' and ' \; -exec file {} \;

F8-F12 non working on Snow Leopard

Thursday, March 11th, 2010

Problem

Your SnowLeopard sometimes doesn’t respond to F8-F12. You cannot launch Spaces, Expose, and Dashboard via those keyboards.

Solution

I haven’t gone into this problem deeply yet, but the quick solution for this symptom is to type

% killall Dock

on your Terminal.app.

installing phpmyadmin (or other linux-world softwares) to Ubuntu 9.10 server

Monday, February 1st, 2010

Problem

You want to install open-source softwares like phpmyadmin to your ubuntu 9.10, but you got errors.

E: Couldn't find package phpmyadmin.

Solution

Add universe components to your sources.list

deb http://archive.ubuntu.com/ubuntu karmic main universe multiverse restricted
deb-src http://archive.ubuntu.com/ubuntu karmic main universe multiverse restricted
 
deb http://archive.ubuntu.com/ubuntu karmic-updates main universe multiverse restricted
deb-src http://archive.ubuntu.com/ubuntu karmic-updates main universe multiverse restricted
 
deb http://archive.ubuntu.com/ubuntu karmic-security main universe multiverse restricted
deb-src http://archive.ubuntu.com/ubuntu karmic-security main universe multiverse restricted

Check your SIMBL version

Thursday, January 14th, 2010

Problem

You want to know which version of SIMBL is installed on your machine.

Solution

On Leopard,

% head /Library/InputManagers/SIMBL/SIMBL.bundle/Contents/Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>CFBundleGetInfoString</key>
        <string>0.8.2, © 2007 Mike Solomon</string>

On Snow Leopard,

% head /Library/Receipts/SIMBL.pkg/Contents/Info.plist

Generate a valid feed(RSS/Atom) on Wordpress

Saturday, December 5th, 2009

Problem:

In some cases, your wordpress do not generate a valid rss; Weirdly, your rss includes an empty line at the top of the feed. In such a case, when viewed on Firefox3.5 or validated with Feed Validator, your rss would fail.

Solution:

What we have to do is just to remove an empty line, but to find the bug source is not easy. The output feed is generated through mulitple processes inside Wordpress, themes, and plugins.

The point is that

  1. Check your wp-config.php that there are no trailing empty lines before <?php and after ?>
  2. Check functions.php in your theme, too.
  3. Check other theme php files.
  4. If you still cannot solve the problem, stop each plugin and re-generate RSS. Sometimes an empty line is included in plugin php files.

Hope your luck.

2 must-have SIMBL extensions for using Terminal on OSX Leopard

Saturday, November 7th, 2009

Yes, SnowLeopard is already out. But most of users including me still loves Leopard, right ?

In this small article, I would like to introduce 2 useful extensions for Terminal.app

1. Visor

With Visor, you can always show Terminal by typing one HotKey. Visor makes Terminal.app invisible when you don’t use, and makes it visible when you need. This is a great application if you are one of CUI freaks!

2. TerminalColoreopard

091107-0001

With TerminalColoreopard, you can change your color settings of ANSI colors in Terminal easily via OSX’s default Color dialog. I strongly recommend to use Adobe Kuler or see the entry “Terminal color schemes for .Xdefaults or .Xresources file” to arrange nice color combinations.

Clear ques of Postfix

Friday, August 28th, 2009

Problem

You want to delete all the messages in sending ques of Postfix.

Solution

$ sudo postsuper -d ALL

Showing Japanese Texts in Vertial Orientation(縦書き) in Flash Player 10

Monday, August 17th, 2009

Problem

You want to show texts in a vertical orientation on Flash Player 10.

Solution

From Flash Player 10, you can use Flash Text Engine(aka, FTE), included in flash.text.engine.*. To show (and edit) text contents in Flash, you can do much much more than good and old TextField class.

“vertical orientation” is one of the great features FTE offers to us. I made a easy-to-use wrapper class for this feature. Check the code below.

And, here is a sample usage of “VText” class.

package 
{
	import com.hoora.view.VText;
	import flash.events.Event;
	import flash.display.MovieClip;
 
	public class Main extends MovieClip {
		public function Main() {
			addChild(new VText("Hello, 日本語!English words are shown like this. 日本語は縦書きに表示されます。", 80, 180, 0x005596));
		}
 
	}
}

And the result is,

Click on the image to play the SWF. Note that you need to have flash player 10 installed on your machine to see the swf.

Install locate and updatedb on CentOS and Debian

Saturday, August 15th, 2009

Problem

‘locate’ and ‘updatedb’ commands are the best commands to search files on Linux. However, you dont have them installed on your Linux.

Solution

Use these commands. On Debian,

sudo apt-get install locate

, and on CentOS,

sudo yum install mlocate

root_url undefined

Friday, August 7th, 2009

Problem

On Ruby on Rails, you see the NameError of “undefined local variable or method `root_url’ for #<YourController>”.

Solution

You need to set map.root in config/routes.rb, such as

  mpa.root :controller => :welcome