Weblogs for uroboros
For those that are looking for something looking...
#!/bin/bash
# by Matous Jan Fialka
CPREFIX='<'
CSUFFIX='>'
cecho(){
local message=$@ # the message
# CLEAR COMMANDS
message="${message//${CPREFIX}c$CSUFFIX/\e[2J}" # screen
message="${message//${CPREFIX}cl$CSUFFIX/\e[K}" # rest of line
# ATTRIBUTES
message="${message//${CPREFIX}n$CSUFFIX/\e[2m}" # normal
message="${message//${CPREFIX}v$CSUFFIX/\e[7m}" # reverse
message="${message//${CPREFIX}b$CSUFFIX/\e[1m}" # bold
message="${message//${CPREFIX}u$CSUFFIX/\e[4m}" # underline
message="${message//${CPREFIX}i$CSUFFIX/\e[8m}" # invisible
message="${message//${CPREFIX}l$CSUFFIX/\e[5m}" # blink
message="${message//${CPREFIX}r$CSUFFIX/\e[0m}" # reset (white/black)
# FOREGROUND COLOURS
message="${message//${CPREFIX}C$CSUFFIX/\e[36m}" # cyan
message="${message//${CPREFIX}M$CSUFFIX/\e[35m}" # magenta
message="${message//${CPREFIX}Y$CSUFFIX/\e[33m}" # yellow
message="${message//${CPREFIX}K$CSUFFIX/\e[30m}" # black
message="${message//${CPREFIX}R$CSUFFIX/\e[31m}" # red
message="${message//${CPREFIX}G$CSUFFIX/\e[32m}" # green
message="${message//${CPREFIX}B$CSUFFIX/\e[34m}" # blue
message="${message//${CPREFIX}W$CSUFFIX/\e[37m}" # white
# BACKGROUND COLOURS
message="${message//${CPREFIX}bC$CSUFFIX/\e[46m}" # cyan
message="${message//${CPREFIX}bM$CSUFFIX/\e[45m}" # magenta
message="${message//${CPREFIX}bY$CSUFFIX/\e[43m}" # yellow
message="${message//${CPREFIX}bK$CSUFFIX/\e[40m}" # black
message="${message//${CPREFIX}bR$CSUFFIX/\e[41m}" # red
message="${message//${CPREFIX}bG$CSUFFIX/\e[42m}" # green
message="${message//${CPREFIX}bB$CSUFFIX/\e[44m}" # blue
message="${message//${CPREFIX}bW$CSUFFIX/\e[47m}" # white
builtin echo -n -e "$message"
}
ccat(){
cecho $(</dev/stdin)$'\n' # read stdin
}
# small demo
ccat<<:wq
<C>UN<M>I<l>T<Y>E<u>D<r> <b><R>CO<G>L<l>O<B>R<u>S<r>
:wq
# the end
exit 0
I hope it helps.
--
MJF
Hello.
I have just written small, quick and quite dirty howto on how to set up virtual box using User Mode Linux.
It can be found on http://uml.ligatura.org/.
It is not complete at all; however it works for me very well.
The howto is written in pure XHTML 1.0 Strict (there might still be some "ooops" in the code, but validators does not think so) with external CSS stylesheet, so can be easily converted to plain text.
I hope it helps.
--
mjf
I know that the code below is NOT real OOP, but it is really nice trick.
#!/bin/bash
# Object-oriented-like programming using pure BASH only:
persons.add ()
{
local obj_name=$1
local surname=$2
local name=$3
local birth=$4
eval "$obj_name.set_surname ()
{
eval \"$obj_name.surname ()
{
echo \$1
}\"
}"
eval "$obj_name.set_name ()
{
eval \"$obj_name.name ()
{
echo \$1
}\"
}"
eval "$obj_name.set_birth ()
{
eval \"$obj_name.birth ()
{
echo \$1
}\"
}"
$obj_name.set_surname $surname
$obj_name.set_name $name
$obj_name.set_birth $birth
}
# Test database:
persons.add 1 'Tachion' 'Charles' '24/02/1979'
persons.add 2 'Quark' 'Carlos' '05/06/1958'
persons.add 3 'Proton' 'Thomas' '14/12/1997'
# Print out the test database:
for i in 1 2 3
do
echo $i:\ `$i.surname`,\ `$i.name`\ \(`$i.birth`\)
done
# The end!
exit 0
The whole concept could be, oh yes, much more improved! I hope it helps!
--
MJF
Hello everybody,
I switched from ATerm to XTerm (that one in Debian/Sarge GNU/Linux) and registered several problems with keyboard. At first, look at my ~/.Xresources file if there is not some stupid fault. Then I will describe the problem.
XTerm*termName: xterm XTerm*eightBitInput: true Xterm*eightBitOutput: true XTerm*metaSendsEscape: false XTerm*modifyCursorKeys: 2 XTerm*alwaysUseMods: false XTerm*brokenSelections: true XTerm*locale: false XTerm*curses: true XTerm*cursorBlink: false XTerm*cursorColor: red XTerm*popOnBell: true XTerm*visualBell: true XTerm*messages: true XTerm*underLine: true XTerm*printAttributes: 2 XTerm*colorBDmode: true XTerm*color256: true XTerm*color1: darkred XTerm*color3: orange XTerm*color4: navyblue XTerm*color5: magenta XTerm*color6: deepskyblue XTerm*color7: white XTerm*background: black XTerm*foreground: white XTerm*pointerShape: right_ptr XTerm*font: -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-2 XTerm*saveLines: 10000
And now the problem:
When I type ctrl-left it will produce 3D output. But in ATerm it produced ctrl-p (I guessed that from behaviour of some programs, typically IRSSI, where ctrl-n|p switches window forth and back). Similarly in XTerm I get 5C instead of ctrl-n as in ATerm. The problem is much more serious, because any other combinations of modifiers and arrow-keys does work as well. My meta-something keypress is destroyed too.
Can anybody help to get back the behaviour I had in ATerm changing configuration of XTerm please? I spent 3 or 4 days (really, not kidding) in "googling out something", tried several tens of different keyboard remapings, XTerm X resources hacks etc., but with no progression. I am very sad of it, because I like XTerm the most (and because it can be found nearly everywhere).
Thank you for your advices.
I need to try some HW routers that are able to connect to OpenVPN. Does anyone have some tips on that topic? Do you have some suggestions which HW router is good to use?
Topology will be:
private <-> HW router <-> OpenVPN Debian/Sarge server <-> HW router <-> privateVPNs will be bridged (I need ARP to go through the tunnels).
Or, if you can, give me some links to resources on the Internet where I can find some information on that topic, please. Google did not give me much information.
My name is Matous Jan Fialka (*1979) and I live in Prague, Czech republic, Central Europe. I will try to put some interesting tips & tricks for Debain/Sarge GNU/Linux (and future stable releases too) in here. The main topics will be: security (firewalling included), interesting shell (BASH) tips & tricks, system administration and other things around Debian GNU/Linux.
My English is not perfect at all; so beg my pardon. That's all for now. Have all of you a nice day.