February 26, 2008

1

Enabling Serial Console on /dev/ttyAM1 in TS-7260


I'm running Debian on SD card for this TS-7260. I decided to switch the serial console to the second port which is /dev/ttyAM1 because I'm going to use the first serial /dev/ttyAM0 for my Wavecom GPRS modem. So, I open the /etc/inittab and just realize that serial console on /dev/ttyAM1 is already there.

Then I grab my RS-232 cable and plug it from my /dev/ttyS0 on my PC to the /dev/ttyAM1 on the TS-ARM board... after waiting for some seconds, my minicom shows the login...

Debian GNU/Linux 3.1 ts7000 ttyAM1

ts7000 login:


So, I type root and press the enter... the console returns, "Login incorrect"... WTF!!

How come the serial console on the second port is useless for root? The solution for this is actually very simple. But it took me some minutes to figure it out... hehehe...

Thank god, i've already fixed the ssh, so i can ssh to the board...

$ ssh root@10.1.1.91
$ Password:


The solution is, edit the /etc/securetty file...

$ vi /etc/securetty

And then add the line ttyAM1 under the ttyAM0 in the /etc/securetty file... press escape and type :wq

That's it. Reboot the board. and now i can login with root on my second serial console. Thanks to the guys in #debian at freenode for pointing me to the right direction.

Share This Article:


Bookmark This Article:
Feed Me Digg Technorati del.icio.us Best to Stumbleupon Reddit Blinklist Furl Spurl Yahoo Simpy




0

Speed Up your Internet Speed in Ubuntu

Did you know that you can boost up your internet speed in Ubuntu Gutsy Gibbon 7.10 by some simple changes in a test file? Have a try on these...

Open up your Terminal (Applications > Accessories > Terminal) and type this command:

$ sudo gedit /etc/modprobe.d/aliases


After that, find for a line that looks like this...

alias net-pf-10 ipv6

and comment it out.

then just add this 3 more lines after that commented line...

alias net-pf-10 ipv6 off
alias net-pf-10 off
alias ipv6 off


Save it and close... That's all... restart your PC and you'll feel the difference... have nice day!

Share This Article:


Bookmark This Article:
Feed Me Digg Technorati del.icio.us Best to Stumbleupon Reddit Blinklist Furl Spurl Yahoo Simpy

February 25, 2008

0

Extracting RAR files in Ubuntu

RAR files is common package and compression format that is used by people who share files in rapidshare. As one of rapidshare fan, I always found the shared files are in RAR format. So, if you are Ubuntu Gutsy user like me, you may notice that unrar (the program to open RAR files) is not installed by default.

No Problem... you can simply install it in less than a minute. Open up your Terminal (Application > Accessories > Terminal ) and issue this command:

$ sudo apt-get install unrar

Then after it is installed, you can now right click on the file and click on Extract Here. Isn't it simple?

Share This Article:


Bookmark This Article:
Feed Me Digg Technorati del.icio.us Best to Stumbleupon Reddit Blinklist Furl Spurl Yahoo Simpy




February 22, 2008

0

Installing Microsoft Fonts in Ubuntu

You may want to install Microsoft Truetype fonts in Ubuntu for any reason. It's very simple. All you need to do in your Ubuntu Gutsy Gibbon 7.10 is to install the msttcorefonts package.



The Truetype Microsoft fonts provided by the package include:

  • Andale Mono
  • Arial Black
  • Arial (Bold, Italic, Bold Italic)
  • Comic Sans MS (Bold)
  • Courier New (Bold, Italic, Bold Italic)
  • Georgia (Bold, Italic, Bold Italic)
  • Impact
  • Times New Roman (Bold, Italic, Bold Italic)
  • Trebuchet (Bold, Italic, Bold Italic)
  • Verdana (Bold, Italic, Bold Italic)
  • Webdings
To install msttcorefonts package, open a Terminal... Application > Accessories > Terminal and type (without the dollar sign):

$ sudo apt-get install msttcorefonts

After doing this, you can also install other TTF fonts in your collection by copying them in your ~/.fonts folder. After installing new fonts, you will have to log out and log in again to be able to see and use the new fonts. If you want to avoid this, you can regenerate the fonts cache by issuing the following command:

$ sudo fc-cache -fv

That's all. Anyway, I wanna credit Carthik of Ubuntu Wordpress where I learn this from his post on Installing Microsoft Fonts Hope it will help others too.

Share This Article:


Bookmark This Article:
Feed Me Digg Technorati del.icio.us Best to Stumbleupon Reddit Blinklist Furl Spurl Yahoo Simpy

February 21, 2008

16

How to Show and Hide Text in Blog Post with teaser

As my reply to Andrea's question in the comment section of my previous post on How to Show and Hide Text in Blog Post, Here is how to show and hide text in blog post with something like 300 words teaser before the link to read the rest of the story...
Click here to read more...





This post is already the example to show that it is possible to use the same technique in my previous show/hide blog post article to have a teaser before the link to show the rest of the story.

What I've done here is just placing the "span" tags at the right position where i wanted it to be. To make it short and clear, here is the sample template to this kind of blog post...


--- Place your 300 words teaser here ---
<span class="postshown" id="your-topic-link-id-0001">
<a href="javascript:expandcollapse('your-topic-link-id-0001');
expandcollapse('your-topic-id-0001');">
Click here for more...</a></span>
<span class="posthidden" id="your-topic-id-0001">
--- place the rest of your story here ---
</span>



Here's the screenshot of where exactly you should place all these codes and text:



Done! that's all it takes to do it assuming you have already follow the necessary steps on editing the CSS and everything before making the blog post. Good Luck!





Share This Article:


Bookmark This Article:
Feed Me Digg Technorati del.icio.us Best to Stumbleupon Reddit Blinklist Furl Spurl Yahoo Simpy




February 12, 2008

3

Simple Linux Socket Programming in Ubuntu

After years of programming in Microsoft Windows, now I'm exploring new programming skill in linux. Previously, I've been struggling to run linux on my laptop. I tried Red Hat, Fedora, Mandrake... but they are not stable in my old laptop. Until I found Ubuntu... Now, I'm really satisfied to settle down with this great, easy to use and pretty stable open source Operating System for my laptop. So, I have Ubuntu Gutsy Gibbon 7.10 on my lappy now and I thought I'll forget windows soon...

Normally, people start learning programming with some simple typical Hello World sample. However, I'm searching for some challenge as my first try. So, I pick linux socket programming as my quick start. During my short journey on the web, I found this simple tutorial by Rob Tougher. Pretty cool and complete for my starting point... So, if you wanna try it too, feel free to get the code from Rob Tougher's tutorial page and compile it yourself. Modify the codes as you like and learn new things.

While working on the codes downloaded from that page, I found errors while compiling it. Maybe Rob leave this error for us to learn... Anyway, don't worry mates, I'll share the answer... heheheh...

Here's the error on my first try...

apogee@apogee-laptop:~/C-codes/socketserver$ make
g++ -c -o ServerSocket.o ServerSocket.cpp
g++ -c -o Socket.o Socket.cpp
Socket.cpp: In member function ‘int Socket::recv(std::string&) const’:
Socket.cpp:135: error: ‘cout’ is not a member of ‘std’
make: *** [Socket.o] Error 1
apogee@apogee-laptop:~/C-codes/socketserver$


g++ returns this error not because there is no 'cout' in std. But, because we didn't properly declare the std to use 'cout'. In order to fix this, I just add this line...#include <iostream> in Socket.cpp (you can place it on top, just after all #include codes) and try to 'make' again. I'm sure this error will disappear.

Then, here's the second 'make' trial...

apogee@apogee-laptop:~/C-codes/socketserver$ make
g++ -c -o Socket.o Socket.cpp
g++ -c -o simple_server_main.o simple_server_main.cpp
simple_server_main.cpp: In function ‘int main(int, int*)’:
simple_server_main.cpp:7: error: ‘cout’ is not a member of ‘std’
simple_server_main.cpp:35: error: ‘cout’ is not a member of ‘std’
make: *** [simple_server_main.o] Error 1
apogee@apogee-laptop:~/C-codes/socketserver$


Ups... still got the error... but this time, it is in simple_server_main.cpp... No problem, let's do the same on this file too... save them and here is the third 'make' trial...

apogee@apogee-laptop:~/C-codes/socketserver$ make
g++ -c -o simple_server_main.o simple_server_main.cpp
g++ -o simple_server ServerSocket.o Socket.o simple_server_main.o
g++ -c -o ClientSocket.o ClientSocket.cpp
g++ -c -o simple_client_main.o simple_client_main.cpp
g++ -o simple_client ClientSocket.o Socket.o simple_client_main.o
apogee@apogee-laptop:~/C-codes/socketserver$


SUCCESS!!! without errors anymore... And now, time for testing... open up a terminal and you will see this output when you type ./simple_server

apogee@apogee-laptop:~/C-codes/socketserver$ ./simple_server
running....


Then open another terminal and run the simple client... I run it 3 times...

apogee@apogee-laptop:~/C-codes/socketserver$ ./simple_client
We received this response from the server:
"Test message."
apogee@apogee-laptop:~/C-codes/socketserver$ ./simple_client
We received this response from the server:
"Test message."
apogee@apogee-laptop:~/C-codes/socketserver$ ./simple_client
We received this response from the server:
"Test message."
apogee@apogee-laptop:~/C-codes/socketserver$


Now, I can start modifying the code to learn how it really works. Feel free to download my 'fixed version' of Rob Tougher's code. You can simply untar it by issuing this command in your newly created project folder...

prompt:~$ tar -zxvf simple-socket.tgz


Programming is fun! give it a try if you haven't tried once! Good luck!!

Share This Article:


Bookmark This Article:
Feed Me Digg Technorati del.icio.us Best to Stumbleupon Reddit Blinklist Furl Spurl Yahoo Simpy