Skip navigation.

Unefunge's Blotter

scribbling around

Posts tagged with "linux"

New russian school distro is a major cockup (it seems so...)

, , ,

Русский человек славится своим умением находить выход из самых трудных ситуаций, но еще более он славится своим умением находить туда вход.
Russian people are famous for their ability to find escape ways from the most difficult situations. They're even more famous for finding ways into the situations.

For those not speaking Russian -- the article in "Novosti" starts like this:
The free OS distributed in Russian schools doesn't work
Alt Linux version developed especially for and sent to all(?) russian schools in June cannot be installed on the PCs - says manufacturer in his statement. Blah, blah, technical error, blah, blah, the replacement install CDs will be sent...
It just happens. Nobody's perfect. But I'm already waiting for M$ "that-incompetent-linux-bunch-of-nerds" statement...
ВЕДОМОСТИ
Свободное ПО, разосланное в российские школы, оказалось неработоспособным

Дистрибутивы свободного программного обеспечения (СПО) «Линукс Мастер» и «Школьный сервер», разосланное в российские школы в начале июня, оказались непригодными для установки на компьютеры. Далее

Эта статья в блогах [?]
sibskull

Marginal Hacks: setting EDITOR variable with fallback

, , ,

Assuming your preferred editor is nano (then joe, then emacs...)
export EDITOR=$(which nano ||
which joe ||
which emacs ||
which vim ||
which sam ||
which ed)


My configuration is much simpler ;-) :
export EDITOR=vim

Software: Freemind/Pocket Freemind

, , , ...



When it comes to storing and retrieving information computers outperform humans by factor of... well -- it's barely comparable.

What we are better at is establishing connections between retrieved information chunks. Human brains work better with structured information, computers - on the other hand - like it[1] rectangular.

As long as all the variables are known and reasonably numerous you may just put them in a single (Excel, OpenOffice Calc, HTML) table. As long... It works good for your expenses, books in your library, grocery lists. But it probably won't work for your friends list. Ok. Let's try anyway:
Aaron Addams:aaron@addams-family.net:+15551231231
Barbie Bunny::+15552342342,+1552342343
Charlie Chong:charlie@chong.tv,charlie.chong@chong-inc.com:+1553453453:http://blog.chong-inc.com


See? Barbie has two phone numbers, but no email and only Charlie has a webpage (blog).

Of course you can extend your table with additional columns. But then you'll want to add some information like "has birthday on March, 19th", "borrowed a book", "has blonde hair"... The number of columns grows and information turns back to data[2].



Enough theory! Please welcome our guests: mind mapping in general and Freemind in particular. There's no point in replicating the Wikipedia entry on mind mapping. They wrote it there, read it there.

Convinced? I am. I use Freemind since it appeared on the Net. I use it for project documentation, concepts, team meeting minutes. My notes. Even started to write an administration handbook for one of our systems (and it works so far). Just try it. All you will need for a desktop installation is Java Runtime (and there's quite a chance you already have it). No installation required[3] - just unzip, start, use.

Oh yeah, and it's cross-platform. Just download the version for your OS.

FreeMind
Pocket Freemind

[1] of course it's nothing emotional -- it's just easier to stuff your data into some "orthogonal" structure like a table or a "flat" file.
[2] you have all bits but you can't use it for anything ;-)
[3] installers available for RPM/DEB based Linux and Windows

Marginal Hacks: xterm status line

, , , ...

Bash one-liner

It's not perfect, if you don't like it keep it for yourself -- I just had to paste my clipboard somewhere ;-)
  • assumes standard (80x24) xterm and bash.
  • could be (probably) done with single printf statement
    Edit: ver. 2
  • variables could be dynamic
    Edit: ver. 3


It's a one liner, so be sure it still is before executing the code on your system
ver. 1
$ PS1="$ ";PROMPT_COMMAND='echo -e "\e7\e[24;24r\e[46m\e[24;0f$(printf " %-14s | %-14s | %-44s "
$LOGNAME $HOSTNAME $PWD)\e[0m\e[1;23r\e8"'

ver. 2
PS1="$ ";PROMPT_COMMAND='printf "\e7\e[24;24r\e[46m\e[24;0f"\
" %-14s | %-14s | %-44s \e[0m\e[1;23r\e8" $LOGNAME $HOSTNAME $PWD'

ver. 3
PS1="$ ";PROMPT_COMMAND='printf "\e7\e[%s;%sr\e[46m\e[%s;0f %-14s | %-14s | %-51s \e[0m\e[1;%sr\e8" $LINES $LINES $LINES $LOGNAME $HOSTNAME $PWD $((LINES-1))'

ver. 4
PS1="$ ";PROMPT_COMMAND='printf "\e7\e[%s;%sr\e[1;33;41m\e[%s;0f TEST SYSTEM | %-10s | %-10s | %-$((COLUMNS-42))s \e[0m\e[1;%sr\e8" $LINES $LINES $LINES $LOGNAME $HOSTNAME $PWD $((LINES-1))'

Edits may, but must not follow.

Marginal Hacks: Santas little helper

, , , ...

The bash(1) shell has some sadly underestimated features.
Most of shell users are aware of the existence of the so-called "here documents":

$ # create text file
$ cat > file.txt <<!
My username is $LOGNAME and my "home" directory is $HOME.
The quick brown fox...
!
$ #display the file content
$ cat file.txt
My name is unefunge and my "home" directory is /home/unefunge
The quick brown fox...
$

But did you know there's also "here string"?

$ # let's rot13
$ tr "a-z" "n-za-m" <<<"onfu ebpxf"
bash rocks
$

.. or, a bit more practical:

$ echo $HOME
/export/home/homer
$ BARTS_HOME=$(sed -e 's/homer/bart/' <<< "$HOME")
$ echo $BARTS_HOME
/export/home/bart
December 2009
M T W T F S S
November 2009January 2010
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31