Tuesday, November 29, 2011

Associate File Extension in Kate Editor


Today, I want to share you how to associate a file extension with some syntax highlighting mode. Normally, you can make it with GUI manner. But sometimes, you will find something strange that you can't using GUI setting. The only solution is modify the file system regarding Kate file association. It's been explained here and here how make that modify. I just want to make the summary of those. For this example, I modify *.do file that by default is associated with Stata script to Tcl script.

1. GUI Way:
  • Inside Kate, chose menu from the toolbar Setting -> Configure Kate... -> Editor Component -> Open/Save -> Modes & Filetypes
  • In MIME type, chose text -> Tcl Script
  • add ;*.do in the File extensions text box
2. File System Modify
  • Edit this file /usr/share/kde4/apps/katepart/syntax
  • In fact, I can't find that file in my computer. What I did then is looking for any suspected files.
~/.kde$ find -name *syntax*
  • this was what I got
./share/config/katesyntaxhighlightingrc
  • from the filename, I strongly suspect that was the file what I expected. And that is exactly what I want. I can now edit that file.
  • Find some *.do word. By default, together with *.ado, that file extension is located under Stata script association. Delete it, as *.do file what I expected should be associated with Tcl script, move that keyword under Tcl script association. Your new setting should be like this.
[Cache /usr/share/kde4/apps/katepart/syntax/tcl.xml] author= extension=*.tcl;*.tk;*.do hidden=false indenter= lastModified=1305932851 license= mimetype=text/x-tcl name=Tcl/Tk priority= section=Scripts style= version=1.10
  • All is done. If your *.do file is still not associated with Tcl script, try to make a new do file, and copy your old do file content to your new file. It seems that the older Kate session still save your previous file setting by temporary.

Monday, November 28, 2011

Open and Read Webpage using Telnet

telnet www.google.com 80 [CR/LF]
Trying 64.233.167.104...
Connected to www.google.com.
Escape character is '^]'.
GET / HTTP/1.1 [CR/LF]
Host: www.google.com [CR/LF][CR/LF]

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html
Set-Cookie: PREF=ID=1419ca500e7b105b:TM=1100715011:LM=1100715011:S=wgU7QYb0rFA5D1n7; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com
Server: GWS/2.1
Content-Length: 1888
Date: Wed, 17 Nov 2004 18:10:11 GMT


  .
  .
  .


Here is forum link explaining how to open and read webpage using telnet protocol

http://forums.fedoraforum.org/showthread.php?t=27145

Grub2 Installation

This is what you could to reinstall/repair your grub2 installation

grub-install --root-directory=/mnt/ /dev/sda

ubuntu 11.10 touchpad problem

This is what might you do if your touchpad is not working

http://askubuntu.com/questions/66907/touchpad-not-working-on-msi-u130-after-login-in

Thursday, November 24, 2011

Cygwin Backspace Key doesn't Work

If you installed Cygwin in Windows 7 and your backspace key doesn't work, try to add --noediting argument in your *.bat file!

here is the working *.bat file


@echo off

C:
chdir C:\Xilinx\10.1\EDK\cygwin_vista\bin

bash --noediting --login -i 


You can go directly to my reference for more complete explanation

Source: http://www.gnu.org/s/bash/manual/html_node/Invoking-Bash.html


Friday, November 18, 2011

Lab Report

This is my 1'st Lab Report of Microelectronic System

Lab 1 Report