segunda-feira, janeiro 31, 2005

LFS

Jaspion (vamos cantar)

quarta-feira, janeiro 26, 2005

Dear Penis - tem que ver isso !!

domingo, janeiro 23, 2005

Cores para diferenciar terminais !

Normalmente, estou com vários terminais abertos e em alguns deles estou como root. Eu queria poder diferenciar melhor esses terminais dos demais, fazendo a fonte neles ter uma cor diferente. Para isso, editei o .bashrc do root para colorir a fonte e o bash_logout para descolorir. Infelizmente, a vida não é tão fácil e alguns comandos descolorem meu terminal. E uma delas em especial é utilizada com muita frequência: ls. Sendo assim, eu tive que fazer um bacalhau para isso parar de acontecer. Criei então o shellscript lsfred (em /usr/local/bin) que chama o ls com os mesmos argumentos da linha de comando e recolore minha fonte. Daí, foi só mandar um alias ls=lsfred.

Para tudo funcionar, baixe esse arquivo e salve ele como /root/.bashrc , daí baixe isso e salve como /root/.bash_logout. Baixe então esse e salve como /usr/local/bin/lsfred.

Pronto.

[ ]'s
fred

Improving multi-terminal usage using colors

I am generally with many terminals opened, and at least in one of them i'm root. What i wanted to do for a long time was being able to use colors to ease differing from a root terminal from a 'myself' terminal. To do that i edited root's .bashrc, so that it would color the shell red, and .bash_logout to restore default terminal color. Unfortunatelly, live is not that easy. So, some applications spoil my coloring of the font. One of them is specially used: ls. Therefo.re, i had to find a way to stop it from doing so. My poor solution was to create a shellscript lsfred (kept in /usr/local/bin) that called ls with command line parameters and recolored my line. After that, i aliased ls=lsfred.
Don't bother an extra line after the ls... Thats an echo effect.

To get it working, download this and save it as /root/.bashrc and then this and save as /root/.bash_logout. Download this and save as /usr/local/bin/lsfred.

That's all.

[ ]'s
fred



Get Firefox

Get Firefox!

Relembrando outra do Bertrand Russell

"The axiomatic method has many advantages over honest work."
B. Russell

quinta-feira, janeiro 20, 2005

Coloring the shell

Coloring the screen in shellscripts is very much like doing so in batch files (.bat). Maybe even equal. The idea is to use 'echo -e "\033[..."'. The -e enable interpretation of backslash-escaped characters. \NNN is the ascii char whose code is NNN octal. We want an 'escape' 033octal... Then, after [ we place the ansi control code the video will interpret. To color, just writer 3x or 4x where x is the color number. Anyway, run this code that you will understand and it is nice.

The code came from here. I just added some comments and tests.

Enought to start playing.

[ ]'s,
fred

Texto colorido em shellscript

Colorir a tela usando shellscript é bem parecido com fazer isso em arquivos de lote (.bat). Eu não digo que é igual pq num lembro bem como faz isso nos batch. A parada é usar 'echo -e "\033[..."'. O -e habilita interpretação dos códigos com barra invertida. \NNN é o caracter ascii correspondente a NNN em octal. A gente quer um escape que é o 033octal (que nem no dos)... e depois do [ a gente põe códigos de controle ansi que vão para o vídeo interpretar. Pra colorir, basta colocar 3x ou 4x onde x diz a cor. Enfim, rodem esse código que dá pra entender e sai bonito.

O código veio daqui. Eu só adicionei alguns comentarios e testes no fim.

Com isso, já deve dar pra brincar.

abraços,
fred

quarta-feira, janeiro 19, 2005

Enviando e Recebendo mensagens do tipo "net send" do windows em uma máquina linux com samba

Pra mandar é fácil:

smbclient -M nomedamáquinaOUusuario

E siga as instruções...

Pra recceber, adicione a seguinte linha no seu /etc/samba/smb.conf na sessão [GLOBAL]:


message command = DISPLAY=:0.0; xterm -e "cat %s; read"; rm %s

A idéia, é abrir uma janela com a mensagem na minha cara quando chegar uma. No meu sistema, as mensagens chegam como nobody. Não sei mudar isso. Deve ter um jeito de determinar que usuário o samba usa pra fazer as coisas... Então tive que adicionar a esse usuário direito pra abrir uma janela no meu xserver. Eu coloquei a seguinte linha no meu ~/.bashrc:

xhost +local:nobody > /dev/null

Deve ter jeito melhor de fazer isso, mas esse jeito funciona... Se alguém souber outro, me dá um toque. :)

that´s all folks

Sending and receiving "net send" messages in a linuxbox via samba

To send, its quite easy:

smbclient -M hostORuser

then follow the instructions... (type and press CTRL-D)

To receive, everybody tells its necessary to use xmessage or someother stuff like linuxpopup.
I found a quick solution wich needs no more than xterm being installed. And as it comes with probably all distros... its gonna work.

add the following line to /etx/samba/smb.conf in [GLOBAL] section:
message command = DISPLAY=:0.0; xterm -e "cat %s; read"; rm %s

In my system, the messages come as user nobody, so I had to add this user to the list of allowed users to connect to my xserver. I certainly didn't do it the best way, but I know no other. I added this line to my ~/.bashrc:


xhost +local:nobody > /dev/null

and everything works ok...

best regards,
fred