28 Nov 2009

Howto send email from bash on DLink DNS-323

This can be done only on hacked dns-323 ffp/fun_plug. Many people have problem sending emails from shell scripts using DNS-323, it is possible without installing additional software or writing scritps. Sending emails right from bash scripts in DNS-323 is quite easy, but it took me some time to make it work.

23 Nov 2009

Getch() function in Linux

Some long time ago I was searching for GetCh() implementation on Linux, and I've entered google new groups and found some good stuff. Today durning some cleanings on my system I've found saved html page with this, so i will paste it here (this blog is my notepad recenty).

64k Demos

Not only 64k but mostly, first few were found some long time ago, rest is quite new.

Almost winter

I would like to ride snowboard/ski someday like these guys, the music is also quite nice.

17 Nov 2009

Some helpful Linux software

Network

Some tools which could be helpful in network and system troubleshooting

System

Some tools which may be helpfull to deal with hardware/security

Database management

  • mtop - MySQL terminal based query monitor
  • mytop - top like query monitor for MySQL
  • ptop - PostgreSQL performance monitoring tool akin to top
Did I missed some software which may be helpfull?

Gentoo stuff :P

If you're working on Gentoo box you should think about:

Disable buzzer

# in ~/.bashrc
setterm -blength 0
Did I missed something? If there is some cool stuff that I could need, please write it in comments below.

Linux IMAP Mail Notifier

If you want be notified about new mail in Linux, only using IMAP protocol you should consider using mail-notification - it's small application for Gnome, it looks like this: And really works quite nice, just test it mail-notification --sm-disable

Linux Tip: Color enabled pager - less

Recently I was using a command line tool which was generating many lines of color text. The output was displayed so fast on my xterm, that I couldn't read it. So I thought, that I could use "| less" pager to see what's up, and I was wrong :( - less "out of the box" doesn't support colors. I've tried most pager but I prefer less.

... but there is a way!

Less doesn't support colors "as it is", but there are some hacks. Thanks rha7dotcom.
export LESS="-RSM~gIsw"
  • R - Raw color codes in output (don't remove color codes)
  • S - Don't wrap lines, just cut off too long text
  • M - Long prompts ("Line X of Y")
  • ~ - Don't show those weird ~ symbols on lines after EOF
  • g - Highlight results when searching with slash key (/)
  • I - Case insensitive search
  • s - Squeeze empty lines to one
  • w - Highlight first line after PgDn
Remember the tip with export LESS works only if you software you want to page uses RAW ASCII colors not those ncursed based!

Color man pages using less pager

Thanks Nion
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
To make it available for full time add this entries to your ~/.bashrc or ~/.${SHELL}rc. Hope this helps someone.

3 Nov 2009

MySQL and UTF-8 - locales and some advanced settings

Default locales, and collation in MySQL since 4.1 is latin1_swedish_ci, it works well but if you have some polish texts it's not so good, there is way to change defaults, and it is quite easy. After installation of MySQL edit your config file (default location of this file is /etc/mysql/my.cnf).