Showing posts from June 2, 2013

Emacs: Stop Cursor Going into Minibuffer Prompt

Perm URL with updates: emacs minibuffer prompt, when you presses the left arrow key, the cursor will move back all the way over the prompt text. This is annoying because user often will hold down 【Alt+b】 to move back by word to edit, and when user starts to type something, emacs will say “This is read-only”. Then you have to manually move cursor out of the prompt. You can try it now by calling query-replace or shell-command.Here's how to set the cursor not going into prompt:;; don't let the cursor go into minibuffer prompt (setqminibuffer-prompt-properties (quote (read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt)))Emacs Lisp: Hotkeys to Open File FastUsing Emacs's Bookmark FeatureEmacs: File Management, dired Tutorial

Tech Geeking: Ruby Rails Mongrel Thin Zed Shaw

Perm URL with updates: (web server) is a thin web server, written in Ruby, by Zed Shaw.Here's a interesting characteristic:… It is used to run Ruby web applications and presents a standard HTTP interface. This makes layering other servers in front of it possible using a web proxy, a load balancer, or a combination of both, instead of having to use more conventional methods employed to run scripts such as FastCGI or SCGI to communicate.This is made possible by integrating a custom high-performance HTTP request parser implemented using Ragel.Mongrel was the first web server used by Twitter, and inspired Node.js according to Ryan Dahl [2]Shaw subsequently created Mongrel2, an open-source “language agnostic” web server and the successor to Mongrel server.After the original author Zed Shaw left the Ruby on Rails-scene[4] the releases of Mongrel stopped. The current release 1.1.5 is no longer able to install in Ruby ve…

Tech Jargon of the Day: shard

A database shard is a horizontal partition in a database or search engine. Each individual partition is referred to as a shard or database shard.Horizontal partitioning is a database design principle whereby rows of a database table are held separately, rather than being split into columns (which is what normalization and vertical partitioning do, to differing extents). Each partition forms part of a shard, which may in turn be located on a separate database server or physical location.source: Shard (database architecture)

Sqlite and libssl-dev Install Problem

Perm URL with updates: and libssl-dev Install ProblemSummery. If you are trying to install Ruby on Rails on Ubuntu, and you got this error:The following packages have unmet dependencies: libsqlite3-dev : Depends: libsqlite3-0 (= 3.7.9-2ubuntu1) but 3.7.9-2ubuntu1.1 is to be installed libssl-dev : Depends: libssl1.0.0 (= 1.0.1-4ubuntu5.8) but 1.0.1-4ubuntu5.9 is to be installed sqlite3 : Depends: libsqlite3-0 (= 3.7.9-2ubuntu1) but 3.7.9-2ubuntu1.1 is to be installed E: Unable to correct problems, you have held broken packages.The problem is probably because you disabled one of the repository source in update-manager.To fix, start update-manager &, then in the “settings” button at bottom, in “Updates” tab, make sure you check box the “Recommended updates (precise-updates)”.linux update-manager screenshotManual Fix Using 「dpkg」If you search the web, you might find a few page that tries to tell you how to fix it …

Microsoft Natural keyboard discontinued

The classic Microsoft Natural keyboard is discontinued. Get a few of them while they are still out there.amazonamazonamazonChances are, in a year or two, you'll see the price rise to a few hundred. That's usually the case with good but discontinued products.In my 5 years experience of using this and the Microsoft 4000, i think this is actually better. The 4000 got stiff space bar problem.

cygwin git push error: “error setting certificate verify locations”

when using cygwin, doing git push, you get this error:error: error setting certificate verify locations:Solution: install “ca-certificates” in cygwin.Installing Cygwin TutorialEmacs + Cygwin, gunzip not found?How Fast is Running Perl in Cygwin or Using NTFS on Linux? (The Price You Pay for Layers and Emulations)Unix tools on Windows: Cygwin vs VirtualBoxXah's Cygwin Tool List

Linux: Setting Default App

In Ubuntu Linux 12.04, running xfce, to set default app, just right click on a file, select “Properties”, then choose the app you want.Or, you can edit this file ~/.local/share/applications/mimeapps.listthe global one is at /usr/share/applications/defaults.listIntro to Linux Window Manager & Desktop Environment (Gnome, KDE, Xfce, xmonad, …)Linux: Xfce Keybinding ⌨Xah Linux Box Configurations

Python: format number in human readable way

Example:# -*- coding: utf-8 -*- # python 3 print("{:,}".format(78515573)) # 78,515,573This is available in both python 2.7 and 3. Detail: Python 3: Formatting String

Linux desktop idiocy: eject drive warning

Perm URL with updates: you hear people comparing Linux desktop with Microsoft Windows or Mac. What have they been smoking?Witness Linux Showstopper Episode #28824:USB drive is supposed to be hot-pluggable. That is, you just plug-in or unplug without worrying. But in practice, not really so. You are advertised to eject first. This is so on Microsoft Windows.So, in Linux, i also wanted to play nice and eject first. But, when you eject, you get this message:Linux xfce warning when ejecting a USB drive.This message is completely useless, because, the drive is ejected (dismounted) anyway. What am i supposed to do after seeing this message? Am i supposed to wait? Is it now safe to unplug my drive or not??See also: Is Linux Desktop Ready for Mom & Pop?

Dropbox tip: add folder outside of dropbox

Dropbox tip. To sync files outside the Dropbox folder, just create a soft link. On Linux or Mac Os X, do like this:ln -s ~/web ~/Dropbox/mywebsiteOn Mac, creating a file alias should also work.On Microsoft Windows, creating a file shortcut should work. If not, please let me know.