Mostrando postagens com marcador linux. Mostrar todas as postagens
Mostrando postagens com marcador linux. Mostrar todas as postagens

quarta-feira, 22 de junho de 2011

making a .dot (graphviz) graph of RPM dependencies

http://www.singularity.be/2008/07/making-dot-graphviz-graph-of-rpm.html

nice tool for making .dot graphs with RPM dependecies on installed system:


#!/bin/bash

# deps:
# bash
# rpm
# sed
# cut
# uniq
# sort

installedrpms=$(rpm -qa --queryformat "%{NAME}\n")


function printdeps() {
local package deps dep providedby out

package=$1
out=""
deps=$(rpm -qR $package | cut -d " " -f 1)

for dep in $deps;
do
providedby=$(rpm -q --queryformat "%{NAME}\n" --whatprovides "$dep")
if [ $? -eq 0 ];
then
# packages should not depend on themselves
if [ "$package" != "$providedby" ];
then
out="$out\"$package\" -> \"$providedby\";\n"
fi
fi
done

echo $out
}

alloutput=""

for i in $installedrpms;
do
output=$(printdeps $i)
alloutput="$alloutput$output"
done


echo "digraph deptree {"
echo -e "$alloutput" | sort | uniq
echo "}"

sexta-feira, 5 de março de 2010

chroot with smart

Smart is a package manager tool that can handle many types of repositories. It has packages for all major Linux distributions: Debian, Fedora, Opensuse, Mandriva. Most of the RPM and Deb based distributions.

My problem was that I needed a packager tool that allow different channel configuration using diferent files for the configuration. I used to use zypper, but it only works with SuSE. You can find a package for Fedora Core 12, but didn't work for me.

The developers of YUM didn't like that idea, at least that what i read in the mailing list.

Smart solve my problems. I had to build a chroot system using packages from http repositories.

A combination of two options handle that, every time you call smart for your chroot system you will have to add this option:

smart -o rpm-root=/chroot-system --data-dir=/chroot-system/var/lib/smart/

I think this might help people that need to build chroot systems.

segunda-feira, 22 de fevereiro de 2010

mimetypes in gnome

Tired of trying to open a file in the formats of OpenOffice, like odt or odp, and clicking on the button Display?

You can make it as default option on the Gnome environment, just use the gconftool-2 to set the option for nautilus. You can have 3 kinds of options:
  • display
  • ask
  • launch

Use:
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --set --type=string /apps/nautilus/preferences/executable_text_activation 'display'

to make display as default option.

quinta-feira, 7 de janeiro de 2010

Haldaemon segmentaton fault Solved

So, is your haldaemon rising a Segmentation Fault like that:

hald[2903]: segfault at 0 ip 08057f96 sp bff4db50 error 4 in hald[8048000+50000]

I don't know why this is happening, but as listed here: http://bbs.archlinux.org/viewtopic.php?id=68943

This may be caused by garbage left on this file:
/var/cache/hald/fdi-cache

Simply removing the file worked for me.

segunda-feira, 28 de setembro de 2009

Bug in autolog - User name with more then 8 characters

Autolog is a tool that helps the management of user sessions, the idea is to control the time that users are allowed to use the computer, and check for idle users.

The code that i'm working on has a bug that users with more then 8 characters (like leonardol, for instance) cannot be logged out due to the use of ps command. The ps command shows the userid instead of the user name if that user name has more than 8 chars.

So, this patch can fix the autolog.c code, if you need the files used to build this patch, send me an email.

I could not find the original developers of this tool, and the debian package has been abandoned also.

--- autolog.c 2009-09-23 12:07:41.000000000 -0300
+++ /tmp/autolog.c.old 2009-09-23 11:23:35.000000000 -0300
@@ -548,7 +548,6 @@
{
char ddev[STRLEN],*gn = "";
char dev[STRLEN], name[STRLEN], prname[STRLEN];
- char name_to_kill[STRLEN];
int idle;
struct stat status;
time_t start, stime;
@@ -556,12 +555,8 @@
struct group *group_entry;
conf_el *ce;
int i;
- int larger_than_eight; /* for usernames greater than 8 characters */

strcpy(name,akt_usr->Name );
-
- larger_than_eight = (strlen(name)>8);
-
strcpy(dev, akt_usr->Device);
idle = akt_usr->IdleTime;
stime = pres_time - akt_usr->SessStrt;
@@ -581,7 +576,6 @@
if (listall)
printf("\nChecking: %-11s on %-12s I:%-4d\n",name,dev,idle);

-
/* now try to find the group of this person */
/* if usernames in utmp are limited to 8 chars, we will may fail on */
/* names that are longer than this, so we'll try to find it by uid */
@@ -682,18 +676,11 @@

/*.. action either warning or killing. */
// if (akt_usr->WarnEndsed && (pres_time > akt_usr->Ban_Ends) ) {
-
- strcpy(name_to_kill,name);
-/* name is larger than_eight characters, get UID */
- if (larger_than_eight){
- name_to_kill[0] = '\0';
- sprintf(name_to_kill,"%d",passwd_entry->pw_uid);
-}
if (0WarnEnds && (pres_time > akt_usr->WarnEnds) ) {
if (debug)
printf("Killing user, now.\n");

- if (kill_PIDs(name_to_kill)==1) /* try to kill users' processes */
+ if (kill_PIDs(name)==1) /* try to kill users' processes */
mesg(LOGOFF, name, ddev, stime/60, idle, ce); /* mail to user */
else mesg(NOLOGOFF,name, ddev, stime/60, idle, ce); /* couldn't kill */
if (ce->hard)
@@ -715,7 +702,7 @@
mesg(ANGRY, name, ddev, stime/60, idle, ce); /* angry about user. */
if (debug)
printf("I am angry, user returned...\n");
- if (kill_PIDs(name_to_kill)==1) /* try to kill user, at once */
+ if (kill_PIDs(name)==1) /* try to kill user, at once */
mesg(LOGOFF, name, ddev, stime/60, idle, ce); /* mail to user */
else mesg(NOLOGOFF,name, ddev, stime/60, idle, ce); /* couldn't kill */
}

sexta-feira, 3 de julho de 2009

Software Livre

Então, fiquei com vontade de escrever sobre Software Livre hoje. Para colocar o contexto da minha postagem, ontem participei do Google Open Source Jam aqui em Belo Horizonte - Minas Gerais. Além disso trabalho num projeto que terá o código fonte publicado assim que o CD for distribuído (pois estou trabalhando no código do YAST que é GPL).

O open source jam foi bastante divertido , mas senti falta das pessoas colaborarem mais. Na verdade as maiores dicussões foram relacionadas a problemas nos projetos dos outros do que a soluções.

Fiquei pensando que falta uma união maior aos desenvolvedores de SW-livre. Aparentemente, as pessoas ficam mais preocupadas em mostrar o "tamanho do pau delas" ao invés de tentar ajudar as coisas a melhorarem.

Coitado dos caras do CEFET que criaram um sistema de distribuíção de imagens via torrent, fizeram uma solução FODA, mas quase foram apedrejados, pelo menos eu senti assim.

A reação das pessoas desdenhando das soluções propostas foi triste. As brigas entre GNOME X KDE, GLP X BSD, micro-kernel x kernel-monolitico, etc são ridiculas! O pessoal tem que ser mais prático e tentar resolver os problemas sem frescura. O mundo real prefere soluções, independentes se elas estiverem em Assembler ou python (considerando as duas pontas de linguagems - Vou levar pedradas, o povo vai soltar ML, haskel, falar de JAVA.. )


Enfim.
Precisava de desabafar isso, bom que tenho um blog que ninguém lê. :-)

VAMOS COLABORAR GALERA! e não ficar medindo quem sabe mais de determinado assunto de SW livre.

quinta-feira, 21 de maio de 2009

Configurando X no Asus EeePC900

O Asus EeePC 900 possui uma série de peculiaridades na sua configuração de vídeo, para utilizar a resolução de 1024x600, coloque o seguinte conteúdo no arquivo /etc/X11/xorg.conf:

# generic XFree86 4.x configuration file

Section "Files"
FontPath "/usr/share/fonts/truetype/"
FontPath "/usr/share/fonts/uni/"
FontPath "/usr/share/fonts/misc/"
InputDevices "/dev/input/mice"
EndSection

Section "ServerFlags"
Option "AllowMouseOpenFail"
Option "BlankTime" "0"
EndSection

Section "Module"
Load "dbe"
Load "glx"
Load "dri"
Load "extmod"
Load "synaptics"
EndSection

Section "InputDevice"
Driver "kbd"
Identifier "Keyboard[0]"
Option "Protocol" "Standard"
Option "XkbRules" "xfree86"
Option "XkbKeycodes" "xfree86"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Driver "mouse"
Identifier "Mouse[1]"
Option "Protocol" "explorerps/2"
Option "Device" "/dev/input/mice"
EndSection

Section "Monitor"
Identifier "Monitor[0]"
VendorName "ASUS"
ModelName "Eee PC P900"
Modeline "1024x600" 48.96 1024 1064 1168 1312 600 \
601 604 622 -HSync +Vsync
EndSection

Section "Device"
Driver "intel"
VendorName "Intel Corporation"
BoardName "Mobile 915GM/GMS/910GML Express Graphics \
Controller"
BusID "PCI:0:2:0"
Identifier "Device[0]"
EndSection

# Screen Section for module X support
# -------------------------------------
Section "Screen"
DefaultDepth 16
SubSection "Display"
Depth 16
Modes "1024x600" "800x600"
EndSubSection
SubSection "Display"
Depth 24
Modes "1024x600" "800x600"
EndSubSection
SubSection "Display"
Depth 32
Modes "1024x600" "800x600"
EndSubSection
SubSection "Display"
Depth 8
Modes "1024x600" "800x600"
EndSubSection
Device "Device[0]"
Identifier "Screen[0]"
Monitor "Monitor[0]"
EndSection
Section "DRI"
Mode 0666
EndSection



Section "ServerLayout"
Identifier "Layout[all]"
InputDevice "Keyboard[0]" "CoreKeyboard"
InputDevice "Mouse[1]" "CorePointer"
Option "Xinerama" "off"
Screen "Screen[0]"
EndSection

As linhas que contem um \ devem ser juntadas para dar certo. Coloquei o \ porque essa porcaria de blog nao quebra linha. :-)

quarta-feira, 11 de junho de 2008

Sistema operacional novo

Então, decidi voltar para o mundo proprietário dos sistemas operacionais... Depois de muito tempo usando Linux comprei um Mac... Agora estou usando o MacOS X... Muito bonitinho, mas a parte Unix dele só funciona bem com a ajuda de usuários, através do MacPorts.

Não sei se a Apple não gosta de UNIXes ou se eles acham que os usuários vão ficar muito surpresos, mas acho que eles ganhariam muito se dessem um suporte maior a usuários que migraram desse tipo de sistema para o MacOS X.

O problema deve ser meu, que sempre usei Linux e nunca usei um *BSD da vida.