Posted in Uncategorized
Bash Trick: string modifiers
Why doesn’t bash have csh variable modifiers?
Posix has specified a more powerful, albeit somewhat more cryptic, mechanism cribbed from ksh, and bash implements it.
${parameter%word}
Remove smallest suffix pattern. The WORD is expanded to produce a pattern. It then expands to the value of PARAMETER, with the smallest portion of the suffix matched by the pattern deleted.
x=file.c
echo ${x%.c}.o
–>file.o
Posted in Computer Science
Upon the DCL Installation
What is DCL?
The simple answer, DCL is another Geophysical graphic library. This library is developed by GFD Dennou Club. Well, I’m not gonna talk about the library and the developer further. If interested about those think, the information can follow in their link here.
Like other open source software, the standard installation step are;
- configure
- make
- make install
You’ll be so lucky if this happen. Unfortunately, sometime the installation not run as we expect. At least, there are some problem that I have deal with.
Read More…
Posted in Computer Science
Ruby kill me part 1: $LOAD_PATH
So you’re not root now, what you have to do if you want a program that not in your system. Of course, the answer is install by yourself. Yeah, install a program is rather easy then configure itself. Like this example:
I have already install irb which is ruby interactive environment but I can not use it because require module not on the list of search able directory.
To solve this problem you can easily modify the irb script by added $LOAD_PATH at the beginning of script. For example like my modified irb script below:
#!/usr/bin/ruby1.8
#
# irb.rb - intaractive ruby
# $Release Version: 0.9.5 $
# $Revision: 11708 $
# $Date: 2007-02-13 08:01:19 +0900 (Tue, 13 Feb 2007) $
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
$LOAD_PATH << '/home/jpatiani/lib/ruby/1.8'
require "irb"
if __FILE__ == $0
IRB.start(__FILE__)
else
# check -e option
if /^-e$/ =~ $0
IRB.start(__FILE__)
else
IRB.setup(__FILE__)
end
end
Thank God found this simple solution. I found it here
Posted in Computer Science
Playing with FB
Up Again
Like I wrote yesterday that the email server was down, today it’s up again. My feeling was right, the error was not at my side. Error was happened in center DNS. Somebody accidentally made mistake when edit the dns record. I didn’t who’s that, hope that it was not myself.
Everything just work fine and I can sleep well tonight.
PS:
when set relayhost in postfix use IP don’t use hostname.
If hostname is used, it will be error with message “Name or service not known”.
At least it’s happen to me.
Posted in Computer Science | Tags: dns, email
Creepy Thursday
Today seem everything goes wrong. Complain due to email malfunction still continued. My deduction point to problem in upper network, which is ITB network. Network unreachable when access from outside network. Here, I use network from XL to test it, and the same thing happen when access from Speedy.
Right now, I still can’t figure out where the problem source. May be due to black out last Tuesday, or may be another reason, I don’t know. So, until this noon geoph mail wouldn’t accept email from outside network. Hope this over soon.
Well, that was the bad news. Fortunately, not only bad news I also have the good one. My script from last Wednesday work well. The script for the lazy person that what I call this. The script mainly contains wget and sed command. Small script, but good one.
This script divided into to two part. First part, download full index.html with contains list name of file in current folder. Second, manipulate the index.html and then download the needed file.
May be this step seem to be complicated. Because wget actually can choose what we want to download. But in this case I don’t see this work. So this tricky work fine for me.
Posted in Computer Science | Tags: email, script
Update php 5.2.6 on SLES 9
I Luv SuSE
More POP3 command
Here the complete command use in pop3 shell.
USER userid
This must be the first command after the connect. Supply your e-mail userid (not the full e-mail address). Example: USER john.smith
PASS password
This must be the next command after USER. Supply your e-mail password. The password may be case sensitive.
The following commands may be used as needed:
STAT
The response to this is: +OK #msgs #bytes Where #msgs is the number of messages in the mail box and #bytes is the total bytes used by all messages. Sample response: +OK 3 345910
Read More…
Posted in Computer Science | Tags: data transfer, protocol
