Üstün Özgür

Filed underTip

See all posts on Posterous with this tag »

Üstün Özgür

Follow me on Twitter! http://twitter.com/ustunozgur

Email: ustunozgur+blog 'at' gmail.com

Follow me on Twitter!

Twitter
Üstün Özgür's profile »

Tags

  • Tip (5)
  • Apple (2)
  • Emacs (2)
  • Git (2)
  • Opera (2)
  • Django (1)
  • Music (1)
  • Readability (1)
  • Shell (1)
  • Turkce (1)
  • View all 22 tags »
  • Unix (1)
  • Vi (1)
  • ates (1)
  • bilkent (1)
  • damla (1)
  • damla ates (1)
  • extension (1)
  • iPad (1)
  • nanotam (1)
  • reference (1)
  • safari (1)
  • tech (1)
Subscribe to this posterous »
Unsubscribe »
Loading...
You're a contributor here (Edit)
This is your Space (Edit)
Follow by email »
Get the latest updates in your email box automatically.
February 27, 2010

Opera and vi Style Navigation Scrolling Shortcuts

  • Edit
  • Delete
  • Tags
  • Autopost
I'm an emacs user, but honestly, vi style navigation is better if you are a touch typist. By vi style navigation, I mean scrolling down with j and up with k, and with these keys, you can keep your hands on the home row.

One thing that annoys me reading web pages is that in order to scroll, I have to press the down button instead; however this has an easy fix in Opera since it supports customizable one key shortcuts.

  1. Go to Tools - Preferences.
  2. Go to Advanced - Shortcuts
  3. Select Enable single-key shortcuts.
  4. Duplicate the current keyboard  setup by pressing Duplicate.
  5. Select the new duplicate keyboard setup, press Edit.
  6. Select the Browser Window group.
  7. Select  New, for the shortcut, enter "j", for the command, enter Scroll down.
  8. Select  New, for the shortcut, enter "k", for the command, enter Scroll up. 
  9. Select OK, and make sure you select the duplicate, not the original keyboard set.

Now, you can scroll down with j and up with k. This works in all sites except those that make use of j already, like Gmail and Google Reader.  j and k already have different functions in those sites.

Combined with this Readability tip, it makes perusing the web much nicer.

Filed under  //

  • Opera
  • Tip
  • Vi

Comments [0]

February 27, 2010

Opera and Readability Bookmarklet Shortcut

  • Edit
  • Delete
  • Tags
  • Autopost
Arclab's Readability is a browser bookmarklet that gets the text of the current webpage you are viewing, and reformats it for a much better reading experience. Since it is Javascript based, it is usable with most browsers.

One catch though is, one has to click the readability link and there is no keyboard shortcut. I have seen a Google Chrome extension that assigns a keyboard shortcut to readability, and since Opera is my browser of choice, came up with a solution for Opera.

  1. Go to http://lab.arc90.com/experiments/readability/ and select your preferred style.
  2. Now, instead of dragging the bookmarklet to your toolbar, right click it and select "Copy Link Address".
  3. Go to the Speed Dial page in Opera, and assign one of the speed dial pages (1-9) with the link you copied.
  4. Now, you can view any page with Readability by pressing Ctrl-1 for example if you have assigned the Readability for the first SpeedDial page. 

Also see http://www.ustunozgur.com/2010/02/opera-and-vi-style-navigation-scrolling.html for more reading tips within Opera.

Alternative Method:

The method above, though simple forces you to sacrifice a speeddial just for Readability. Also, one can't assign an alternative keyboard shortcut, like Ctrl-r to his liking. An alternative approach is to assign a shortcut in Opera that goes to the Readability bookmarklet:

  1. Copy the Readability bookmarklets url to clipboard as above. 
  2. Go to Tools-Preferences.
  3. Go to Advanced-Shortcuts.
  4. Keyboard setup, Edit.
  5. Click on Application.
  6. Click New, for the shortcut key, Enter r Ctrl if you want Ctrl-r for readability.
  7. For the  action, enter Go to page," (with only opening quote), then paste the url and close the quote " . 
  8. Now, Ctrl-r is assigned to reload by default, search for r ctrl and remove that assignment in the shortcuts list.
  9. Pressing Ctrl-r on any page will format it using Readability now. Obviously, this method works for any bookmarklet, for example, Instapaper. 

Filed under  //

  • Opera
  • Readability
  • Tip

Comments [0]

February 22, 2010

emacs'i daemon modda çalıştırma

  • Edit
  • Delete
  • Tags
  • Autopost

Daemon Mod Nedir?

emacs 23.1'den beri daemon modu ile birlikte gelmekte. Daha önceden var olan server moduna benzeyen bu mod sayesinde arkaplanda, penceresiz çalışan bir emacs daemonınız oluyor. Daha sonra dosyaları hızlıca emacsclient ile daemona bağlanarak açabiliyorsunuz. Böylece emacs'ın açılma anındaki yavaşlığı tamamen ortadan kalkıyor.

Çalıştırma

emacs'ı daemon modu ile başlatmak için emacs --daemon komutunu kullanabilir, daha sonra da dosyaları emacsclient ile açıp bu daemona bağlanabilirsiniz. Dosya ile işiniz bittiğinde C-x # komutu ile pencereyi kapatabilirsiniz; emacs arkaplanda çalışmaya devam edecektir.

Alternatif (ve daha güzel) Yöntem

Bunu yapmanın daha kolay bir yolu ise ~/.bashrc dosyasına export ALTERNATE_EDITOR="" satırını eklemek. Bu satırı ekledikten sonra emacs'ı açmak için kullanmanız gereken tek komut emacsclient. Çalışan bir emacs daemoni yoksa emacsclient, emacs komutunu çağırıp yeni bir daemon yaratacak, çalışan daemon varsa doğrudan o daemon'a bağlanacaktır.

emacs'i Terminalden kullanmak

Dosyaları GUI'siz terminalde açmak için ise emacsclient -t komutunu kullanabilirsiniz.

Kısayollar

Daha sonra yapmanız gereken ~/.bashrc dosyasına kolay kullanım için birkaç alias eklemek:

alias vi="emacsclient -t" #Terminalden kullanmak icin 
alias e="emacsclient -c" # GUI ile açmak için

GUI'de ise istediğiniz dosya uzantılarını (.c, .java gibi) emacsclient ile açılacak şekilde ayarlarsanız dosyalara çift tıkladığınızda anında açılacaktır.

Daemon'ı Sonlandırma

emacs daemon kullanırken dikkat edilmesi gereken önemli bir konu da daemon sürecinin düzgün sonlandırılması.

Doğrudan oturumu kapatır ya da bilgisayarı kapatırsanız desktop-save kullanıyorsanız (son oturumda açık olan dosyaların yeniden açılmasını sağlayan eklenti) daemon emacs desktop dosyasına bir lock koyacak, daha sonraki daemonların açılmasını engelleyecektir. (Açılış sırasında .emacs.desktop locked gibi bir hata mesajı verebilir.)

Bu nedenle emacs daemonini düzgün kapatmak sonraki oturumlarda daemonin çalışması için çok önemlidir. Bunu yapmanın en kolay yolu ise emacs içerisinden M-x save-buffers-kill-emacs komutu ile bufferları kaydedip daemoni sonlandırmaktır; ancak bu yöntemin en önemli sorunu bilgisayarı kapatırken bu komutu çalıştırmayı unutmak. Bu konuda daha detaylı bilgiye http://stackoverflow.com/questions/1167484/how-to-gracefully-shutdown-emacs-daemon adresinden ulaşabilirsiniz.

Sonuç

emacs daemon sayesinde dosyaları emacs ile çok hızlı bir şekilde açabilirsiniz. Bu daemonin önceki emacs-server eklentisine göre en önemli avantajı açıkta bir pencereye ihtiyaç duymaması, anlattığım alternatif yöntemle daemon yoksa yeni bir daemonı otomatik yaratması, aynı zamanda SSH ile bağlandığınızda var olan daemoni kullanmaya olanak tanıması.

Filed under  //

  • Emacs
  • Tip

Comments [0]

November 25, 2009

Some Helpful CLI Utilities

  • Edit
  • Delete
  • Tags
  • Autopost

These are mainly from this thread:

gt5 -- cli gui for du

autojump -- jumping to most used dirs

iptraf -- network monitor

Filed under  //

  • Shell
  • Tip
  • Unix

Comments [0]

November 23, 2009

git clean

  • Edit
  • Delete
  • Tags
  • Autopost
git has a nice switch to clean untracked and/or ignored files. git help clean for more info.

Filed under  //

  • Git
  • Tip

Comments [0]