elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


  Mostrar Temas
Páginas: 1 [2]
11  Sistemas Operativos / GNU/Linux / No inicia el entorno gráfico . ubuntu 10.10 en: 21 Febrero 2011, 19:37 pm
Hola a todos , resulta que  instale clamav y clamtk , le di a buscar virus en el sistema y no hizo nada , no le di importancia ,  seguí usando el ordenador pero me di cuenta de que no abría las ventanas ni documentos ni las fotos , pensé que era algo que se arreglaría con reiniciar y cuando le apagar el ordenador ni siquiera me dejaba hacerlo , lo tuve que apagar a la fuerza dándole al botón de encender.  Cuando reinicio me encontré con la sorpresa de que no me inicia el entorno gráfico y no se que hacer.

Mi pregunta es : por donde debo empezar a mirar ? , que comando podría ejecutar para restaurar el entorno gráfico ? , que ficheros podría mirar para tener una pista de lo que ha sucedido ?.

Lo que si me carga es la consola , puedo loggearme con mi usuario y hacer lo qye haga falta .

He hecho un  'dmesg | tail2 -40 y la verdad es que no me muestra nada que parezca un error .

alguien me podría ayudar ?

Saludos.

Por cierto , extrañamente tampoco puedo conectarme a internet desde la consola , al hacer un ping www.google.es no puede conectarse, e intentado navegar con lynx desde la consola y no encuentra la página.

Por si acaso ya he desinstalado clamav y clamtk .

He ejecutado el comando dpkg-reconfigure xserver-org y no hace nada , he conseguido un fichero de log de /var/log, pero la verdad es que es una sopa de letras  

También he ejecutado startx y me dado un mensage diciendo que escribiría en el fichero de log
Código
  1.  
  2. X.Org X Server 1.7.6
  3. Release Date: 2010-03-17
  4. X Protocol Version 11, Revision 0
  5. Build Operating System: Linux 2.6.24-25-server i686 Ubuntu
  6. Current Operating System: Linux diego-desktop 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686
  7. Kernel command line: BOOT_IMAGE=/boot/vmlinuz-2.6.32-28-generic root=UUID=bef968f8-7fcc-4bcd-8c80-104776a4666b ro single
  8. Build Date: 10 December 2010  05:53:04PM
  9. xorg-server 2:1.7.6-2ubuntu7.5 (For technical support please see http://www.ubuntu.com/support)
  10. Current version of pixman: 0.16.4
  11. Before reporting problems, check http://wiki.x.org
  12. to make sure that you have the latest version.
  13. Markers: (--) probed, (**) from config file, (==) default setting,
  14. (++) from command line, (!!) notice, (II) informational,
  15. (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
  16. (==) Log file: "/var/log/Xorg.0.log", Time: Mon Feb 21 19:46:18 2011
  17. (==) Using config file: "/etc/X11/xorg.conf"
  18. (==) Using config directory: "/usr/lib/X11/xorg.conf.d"
  19. (==) No Layout section.  Using the first Screen section.
  20. (**) |-->Screen "Default Screen" (0)
  21. (**) |   |-->Monitor "<default monitor>"
  22. (==) No device specified for screen "Default Screen".
  23. Using the first device section listed.
  24. (**) |   |-->Device "Default Device"
  25. (==) No monitor specified for screen "Default Screen".
  26. Using a default monitor configuration.
  27. (==) Automatically adding devices
  28. (==) Automatically enabling devices
  29. (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
  30. Entry deleted from font path.
  31. (==) FontPath set to:
  32. /usr/share/fonts/X11/misc,
  33. /usr/share/fonts/X11/100dpi/:unscaled,
  34. /usr/share/fonts/X11/75dpi/:unscaled,
  35. /usr/share/fonts/X11/Type1,
  36. /usr/share/fonts/X11/100dpi,
  37. /usr/share/fonts/X11/75dpi,
  38. /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,
  39. built-ins
  40. (==) ModulePath set to "/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules"
  41. (II) The server relies on udev to provide the list of input devices.
  42. If no devices become available, reconfigure udev or disable AutoAddDevices.
  43. (II) Loader magic: 0x81f0e80
  44. (II) Module ABI versions:
  45. X.Org ANSI C Emulation: 0.4
  46. X.Org Video Driver: 6.0
  47. X.Org XInput driver : 7.0
  48. X.Org Server Extension : 2.0
  49. (--) using VT number 7
  50.  
  51. (--) PCI:*(0:0:16:0) 10de:07e1:1458:d000 nVidia Corporation C73 [GeForce 7100 / nForce 630i] rev 162, Mem @ 0xe2000000/16777216, 0xd0000000/268435456, 0xe3000000/16777216, BIOS @ 0x????????/131072
  52. (II) Open ACPI successful (/var/run/acpid.socket)
  53. (II) "extmod" will be loaded by default.
  54. (II) "dbe" will be loaded by default.
  55. (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
  56. (II) "record" will be loaded by default.
  57. (II) "dri" will be loaded by default.
  58. (II) "dri2" will be loaded by default.
  59. (II) LoadModule: "glx"
  60. (II) Loading /usr/lib/xorg/extra-modules/libglx.so
  61. (II) Module glx: vendor="NVIDIA Corporation"
  62. compiled for 4.0.2, module version = 1.0.0
  63. Module class: X.Org Server Extension
  64. (II) NVIDIA GLX Module  195.36.24  Thu Apr 22 10:38:29 PDT 2010
  65. (II) Loading extension GLX
  66. (II) LoadModule: "extmod"
  67. (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
  68. (II) Module extmod: vendor="X.Org Foundation"
  69. compiled for 1.7.6, module version = 1.0.0
  70. Module class: X.Org Server Extension
  71. ABI class: X.Org Server Extension, version 2.0
  72. (II) Loading extension MIT-SCREEN-saber
  73. (II) Loading extension XFree86-VidModeExtension
  74. (II) Loading extension XFree86-DGA
  75. (II) Loading extension DPMS
  76. (II) Loading extension XVideo
  77. (II) Loading extension XVideo-MotionCompensation
  78. (II) Loading extension X-Resource
  79. (II) LoadModule: "dbe"
  80. (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
  81. (II) Module dbe: vendor="X.Org Foundation"
  82. compiled for 1.7.6, module version = 1.0.0
  83. Module class: X.Org Server Extension
  84. ABI class: X.Org Server Extension, version 2.0
  85. (II) Loading extension DOUBLE-BUFFER
  86. (II) LoadModule: "record"
  87. (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
  88. (II) Module record: vendor="X.Org Foundation"
  89. compiled for 1.7.6, module version = 1.13.0
  90. Module class: X.Org Server Extension
  91. ABI class: X.Org Server Extension, version 2.0
  92. (II) Loading extension RECORD
  93. (II) LoadModule: "dri"
  94. (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
  95. (II) Module dri: vendor="X.Org Foundation"
  96. compiled for 1.7.6, module version = 1.0.0
  97. ABI class: X.Org Server Extension, version 2.0
  98. (II) Loading extension XFree86-DRI
  99. (II) LoadModule: "dri2"
  100. (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
  101. (II) Module dri2: vendor="X.Org Foundation"
  102. compiled for 1.7.6, module version = 1.1.0
  103. ABI class: X.Org Server Extension, version 2.0
  104. (II) Loading extension DRI2
  105. (II) LoadModule: "nvidia"
  106. (II) Loading /usr/lib/xorg/extra-modules/nvidia_drv.so
  107. (II) Module nvidia: vendor="NVIDIA Corporation"
  108. compiled for 4.0.2, module version = 1.0.0
  109. Module class: X.Org Video Driver
  110. (II) NVIDIA dlloader X Driver  195.36.24  Thu Apr 22 09:34:29 PDT 2010
  111. (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
  112. (II) Primary Device is: PCI 00@00:10:0
  113. (II) Loading sub module "fb"
  114. (II) LoadModule: "fb"
  115. (II) Loading /usr/lib/xorg/modules/libfb.so
  116. (II) Module fb: vendor="X.Org Foundation"
  117. compiled for 1.7.6, module version = 1.0.0
  118. ABI class: X.Org ANSI C Emulation, version 0.4
  119. (II) Loading sub module "wfb"
  120. (II) LoadModule: "wfb"
  121. (II) Loading /usr/lib/xorg/modules/libwfb.so
  122. (II) Module wfb: vendor="X.Org Foundation"
  123. compiled for 1.7.6, module version = 1.0.0
  124. ABI class: X.Org ANSI C Emulation, version 0.4
  125. (II) Loading sub module "ramdac"
  126. (II) LoadModule: "ramdac"
  127. (II) Module "ramdac" already built-in
  128. (II) NVIDIA(0): Creating default Display subsection in Screen section
  129. "Default Screen" for depth/fbbpp 24/32
  130. (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
  131. (==) NVIDIA(0): RGB weight 888
  132. (==) NVIDIA(0): Default visual is TrueColor
  133. (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
  134. (**) NVIDIA(0): Option "NoLogo" "True"
  135. (**) Feb 21 19:46:18 NVIDIA(0): Enabling RENDER acceleration
  136. (II) Feb 21 19:46:18 NVIDIA(0): Support for GLX with the Damage and Composite X extensions is
  137. (II) Feb 21 19:46:18 NVIDIA(0):     enabled.
  138. (II) Feb 21 19:46:19 NVIDIA(0): NVIDIA GPU GeForce 7100 / nForce 630i (C73) at PCI:0:16:0
  139. (II) Feb 21 19:46:19 NVIDIA(0):     (GPU-0)
  140. (--) Feb 21 19:46:19 NVIDIA(0): Memory: 524288 kBytes
  141. (--) Feb 21 19:46:19 NVIDIA(0): VideoBIOS: 05.73.32.09.21
  142. (--) Feb 21 19:46:19 NVIDIA(0): Interlaced video modes are supported on this GPU
  143. (--) Feb 21 19:46:19 NVIDIA(0): Connected display device(s) on GeForce 7100 / nForce 630i at
  144. (--) Feb 21 19:46:19 NVIDIA(0):     PCI:0:16:0:
  145. (--) Feb 21 19:46:19 NVIDIA(0):     ACI ASUS VW193D (CRT-0)
  146. (--) Feb 21 19:46:19 NVIDIA(0): ACI ASUS VW193D (CRT-0): 350.0 MHz maximum pixel clock
  147. (II) Feb 21 19:46:19 NVIDIA(0): Assigned Display Device: CRT-0
  148. (==) Feb 21 19:46:19 NVIDIA(0):
  149. (==) Feb 21 19:46:19 NVIDIA(0): No modes were requested; the default mode "nvidia-auto-select"
  150. (==) Feb 21 19:46:19 NVIDIA(0):     will be used as the requested mode.
  151. (==) Feb 21 19:46:19 NVIDIA(0):
  152. (II) Feb 21 19:46:19 NVIDIA(0): Validated modes:
  153. (II) Feb 21 19:46:19 NVIDIA(0):     "nvidia-auto-select"
  154. (II) Feb 21 19:46:19 NVIDIA(0): Virtual screen size determined to be 1440 x 900
  155. (--) Feb 21 19:46:19 NVIDIA(0): DPI set to (89, 87); computed from "UseEdidDpi" X config
  156. (--) Feb 21 19:46:19 NVIDIA(0):     option
  157. (==) Feb 21 19:46:19 NVIDIA(0): Enabling 32-bit ARGB GLX visuals.
  158. (--) Depth 24 pixmap format is 32 bpp
  159. (II) Feb 21 19:46:19 NVIDIA(0): Initialized GPU GART.
  160. (II) Feb 21 19:46:19 NVIDIA(0): Setting mode "nvidia-auto-select"
  161. (II) Loading extension NV-GLX
  162. (II) Feb 21 19:46:19 NVIDIA(0): Initialized OpenGL Acceleration
  163. (==) NVIDIA(0): Disabling shared memory pixmaps
  164. (II) Feb 21 19:46:19 NVIDIA(0): Initialized X Rendering Acceleration
  165. (==) NVIDIA(0): Backing store disabled
  166. (==) NVIDIA(0): Silken mouse enabled
  167. (==) NVIDIA(0): DPMS enabled
  168. (II) Loading extension NV-CONTROL
  169. (II) Loading extension XINERAMA
  170. (==) RandR enabled
  171. (II) Initializing built-in extension Generic Event Extension
  172. (II) Initializing built-in extension SHAPE
  173. (II) Initializing built-in extension MIT-SHM
  174. (II) Initializing built-in extension XInputExtension
  175. (II) Initializing built-in extension XTEST
  176. (II) Initializing built-in extension BIG-REQUESTS
  177. (II) Initializing built-in extension SYNC
  178. (II) Initializing built-in extension XKEYBOARD
  179. (II) Initializing built-in extension XC-MISC
  180. (II) Initializing built-in extension SECURITY
  181. (II) Initializing built-in extension XINERAMA
  182. (II) Initializing built-in extension XFIXES
  183. (II) Initializing built-in extension RENDER
  184. (II) Initializing built-in extension RANDR
  185. (II) Initializing built-in extension COMPOSITE
  186. (II) Initializing built-in extension DAMAGE
  187. (II) Initializing extension GLX
  188. (II) XKB: reuse xkmfile /tmp/server-B20D7FC79C7F597315E3E501AEF10E0D866E8E92.xkm
  189. (II) config/udev: Adding input device Power Button (/dev/input/event1)
  190. (**) Power Button: Applying InputClass "evdev keyboard catchall"
  191. (II) LoadModule: "evdev"
  192. (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
  193. (II) Module evdev: vendor="X.Org Foundation"
  194. compiled for 1.7.6, module version = 2.3.2
  195. Module class: X.Org XInput Driver
  196. ABI class: X.Org XInput driver, version 7.0
  197. (**) Power Button: always reports core events
  198. (**) Power Button: Device: "/dev/input/event1"
  199. (II) Power Button: Found keys
  200. (II) Power Button: Configuring as keyboard
  201. (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
  202. (**) Option "xkb_rules" "evdev"
  203. (**) Option "xkb_model" "evdev"
  204. (**) Option "xkb_layout" "es"
  205. (II) XKB: reuse xkmfile /tmp/server-188C20793BE00CBD61865C180F610EC4A3A6D8CD.xkm
  206. (II) config/udev: Adding input device Power Button (/dev/input/event0)
  207. (**) Power Button: Applying InputClass "evdev keyboard catchall"
  208. (**) Power Button: always reports core events
  209. (**) Power Button: Device: "/dev/input/event0"
  210. (II) Power Button: Found keys
  211. (II) Power Button: Configuring as keyboard
  212. (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
  213. (**) Option "xkb_rules" "evdev"
  214. (**) Option "xkb_model" "evdev"
  215. (**) Option "xkb_layout" "es"
  216. (II) config/udev: Adding input device Logitech USB Optical Mouse (/dev/input/event4)
  217. (**) Logitech USB Optical Mouse: Applying InputClass "evdev pointer catchall"
  218. (**) Logitech USB Optical Mouse: always reports core events
  219. (**) Logitech USB Optical Mouse: Device: "/dev/input/event4"
  220. (II) Logitech USB Optical Mouse: Found 12 mouse buttons
  221. (II) Logitech USB Optical Mouse: Found scroll wheel(s)
  222. (II) Logitech USB Optical Mouse: Found relative axes
  223. (II) Logitech USB Optical Mouse: Found x and y relative axes
  224. (II) Logitech USB Optical Mouse: Configuring as mouse
  225. (**) Logitech USB Optical Mouse: YAxisMapping: buttons 4 and 5
  226. (**) Logitech USB Optical Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
  227. (II) XINPUT: Adding extended input device "Logitech USB Optical Mouse" (type: MOUSE)
  228. (II) Logitech USB Optical Mouse: initialized for relative axes.
  229. (II) config/udev: Adding input device Logitech USB Optical Mouse (/dev/input/mouse1)
  230. (II) No input driver/identifier specified (ignoring)
  231. (II) config/udev: Adding input device HDA Digital PCBeep (/dev/input/event5)
  232. (II) No input driver/identifier specified (ignoring)
  233. (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event3)
  234. (**) AT Translated Set 2 keyboard: Applying InputClass "evdev keyboard catchall"
  235. (**) AT Translated Set 2 keyboard: always reports core events
  236. (**) AT Translated Set 2 keyboard: Device: "/dev/input/event3"
  237. (II) AT Translated Set 2 keyboard: Found keys
  238. (II) AT Translated Set 2 keyboard: Configuring as keyboard
  239. (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD)
  240. (**) Option "xkb_rules" "evdev"
  241. (**) Option "xkb_model" "evdev"
  242. (**) Option "xkb_layout" "es"
  243. (II) config/udev: Adding input device Macintosh mouse button emulation (/dev/input/event2)
  244. (**) Macintosh mouse button emulation: Applying InputClass "evdev pointer catchall"
  245. (**) Macintosh mouse button emulation: always reports core events
  246. (**) Macintosh mouse button emulation: Device: "/dev/input/event2"
  247. (II) Macintosh mouse button emulation: Found 3 mouse buttons
  248. (II) Macintosh mouse button emulation: Found relative axes
  249. (II) Macintosh mouse button emulation: Found x and y relative axes
  250. (II) Macintosh mouse button emulation: Configuring as mouse
  251. (**) Macintosh mouse button emulation: YAxisMapping: buttons 4 and 5
  252. (**) Macintosh mouse button emulation: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
  253. (II) XINPUT: Adding extended input device "Macintosh mouse button emulation" (type: MOUSE)
  254. (II) Macintosh mouse button emulation: initialized for relative axes.
  255. (II) config/udev: Adding input device Macintosh mouse button emulation (/dev/input/mouse0)
  256. (II) No input driver/identifier specified (ignoring)
  257. (II) Power Button: Close
  258. (II) UnloadModule: "evdev"
  259. (II) Power Button: Close
  260. (II) UnloadModule: "evdev"
  261. (II) Logitech USB Optical Mouse: Close
  262. (II) UnloadModule: "evdev"
  263. (II) AT Translated Set 2 keyboard: Close
  264. (II) UnloadModule: "evdev"
  265. (II) Macintosh mouse button emulation: Close
  266. (II) UnloadModule: "evdev"
  267. ddxSigGiveUp: Closing log
  268.  
  269.  
12  Sistemas Operativos / GNU/Linux / problema con partición corrompida en: 27 Septiembre 2010, 23:40 pm
Hola a todos , como dice el título de este tema, resulta que tengo una partición corrompida que no puedo recuperar, les explico lo que ha pasado , tengo creadas en mi ordenador 3 particiones, una era para windows , en la segunda tenia instalado mi ubuntu, y la tercera la usaba para guardar algunos datos , lástimosamente no todos , la gran mayoria los guardaba en la de ubuntu, pues que me dio por instalar en windows el programa Ext2 IFS , para poder acceder a mis datos desde allí, por lo visto este programa corrompe la partición linux y no deja que entre ni con un live-cd, cuando intento entrar me dice

Citar
"error mounting: mount: wrong fs type, bad option, bad superblock on /dev/sda5,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so"

la salida de dicho comando es la siguiente
Citar
[   19.436652]  domain 0: span 0-1 level MC
[   19.436654]   groups: 1 0
[   24.116028] eth0: no IPv6 routers present
[   48.697754] EXT2-fs error (device sda5): ext2_check_descriptors: Inode bitmap for group 384 not in group (block 2147483647)!
[   48.697770] EXT2-fs: group descriptors corrupted!
[  190.761094] lo: Disabled Privacy Extensions
[  810.899384] lo: Disabled Privacy Extensions
[ 1474.447668] lo: Disabled Privacy Extensions
[ 1835.098143] EXT2-fs error (device sda5): ext2_check_descriptors: Inode bitmap for group 384 not in group (block 2147483647)!
[ 1835.098155] EXT2-fs: group descriptors corrupted!


he buscado por internet y una posible solución es ejecutando el comando fsck de la siguiente manera
sudo fsck -y /dev/sda5 , que es la partición que me da problemas , pero me da el siguiente mensaje

Citar
e2fsck -f -y -v /dev/sda5
       
e2fsck: Los descriptores de los grupos parecen dañados... intentando los bloques de respaldo...
e2fsck: going back to original superblock
¿Sistema de ficheros montado o abierto en exclusiva por otro programa?
e2fsck 1.41.11 (14-Mar-2010)
e2fsck: Bad magic number in super-block when using the backup blocks
e2fsck: Dispositivo ó recurso ocupado mientras se intentaba abrir /dev/sda5

es como si estuviera abierto o montado por algún programa , pero no , la he intentado desmontar y me dice que no esta montada , pareciera como si el programa que accedía a esta partición desde windows me la hubiera dejado como abierta de alguna manera ,  no se si alguien me pueda ayudar , no quiero perder los datos de esta partición , como info les dejo la salida del comando fdisk -l y de uname -a

Citar
Linux diego-desktop 2.6.32-25-generic #44-Ubuntu SMP Fri Sep 17 20:26:08 UTC 2010 i686 GNU/Linux


isco /dev/sda: 320.1 GB, 320072933376 bytes
255 cabezas, 63 sectores/pista, 38913 cilindros
Unidades = cilindros de 16065 * 512 = 8225280 bytes
Tamaño de sector (lógico / físico): 512 bytes / 512 bytes
Tamaño E/S (mínimo/óptimo): 512 bytes / 512 bytes
Identificador de disco: 0x90949094

Dispositivo Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/sda1   *           1       12158    97659103+  83  Linux
/dev/sda2           12159       38913   214909507    5  Extendida
/dev/sda5           12159       24316    97659103+  83  Linux
/dev/sda6           24317       38913   117250371    b  W95 FAT32




13  Programación / Programación C/C++ / Api de linux en: 27 Agosto 2010, 11:50 am
Hola ,  estoy buscando información sobre el api de linux , en principio me gustaría saber si es algo parecido al api de windows , alguien conoce algún enlace , libro ?
14  Programación / Programación C/C++ / Fallo en segmentación inexplicable (al menos para mi) en: 17 Julio 2010, 12:47 pm
Hola a todos , ejecutando el siguiente programa me da un fallo en segmentación , alguien me podria decia  a que se debe ? gracias de antemano
Código
  1.  
  2.  
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <stdlib.h>
  6.  
  7. typedef struct {
  8. char *nombre;
  9. char *direccion;
  10. int edad;
  11. char *dni;
  12. }type_persona;
  13.  
  14. crear_cliente(type_persona *cliente){
  15.    char aux[50];
  16.    int aux2;
  17.  
  18.        printf("%s", "\nCreando cliente......\n");
  19.        printf("\nNombre del cliente :");
  20.        fgets(aux,50,stdin);
  21.        cliente->nombre = (char*) malloc(strlen(aux) * sizeof(char));
  22.        strcpy(cliente->nombre , aux);
  23.        memset(aux,' ',50);
  24.  
  25.        printf("\nDirección del Cliente:");
  26.        fgets(aux,50,stdin);
  27.        cliente->direccion = (char*) malloc(strlen(aux)*sizeof(char*));
  28.        strcpy(cliente->direccion , aux);
  29.        memset(aux,' ',50);
  30.  
  31.        printf("\nDNI del Cliente:");
  32.        fgets(aux,50,stdin);
  33.        cliente->dni =(char*) malloc(strlen(aux)*sizeof(char*));
  34.        strcpy(cliente->dni , aux);
  35.  
  36.        printf("\nEdad del Cliente:");
  37.        scanf("%d", &(cliente->edad));
  38.        printf("\nsu edad es %d", cliente->edad);
  39.  
  40.        printf("\n Cliente creado !!!!");
  41.  
  42. }
  43.  
  44. int main(){
  45.    type_persona *cliente;
  46.  
  47.    crear_cliente(cliente);
  48.  
  49.    printf("\n%s %s %s", cliente->dni , cliente->nombre , cliente->direccion );
  50.  
  51.    return 0;
  52.  
  53. }
  54.  
15  Foros Generales / Sugerencias y dudas sobre el Foro / Creo que a un moderador se le ha olvidado leer las reglas del foro en: 4 Junio 2010, 14:20 pm
Lo referido es al siguiente post

http://foro.elhacker.net/programacion_cc/progrmacion_en_c-t295555.0.html

Reglas del foro , supongo que a Eternal Idol se le han olvidado ..
Citar
I.A.2. Respuestas.
   I.A.2.b. Antítesis.
    En caso de que un usuario esté en desacuerdo con el contenido de un mensaje, este deberá expresar su opinión de forma respetuosa y
   respaldando sus comentarios, en caso de que el tema sea completamente erróneo se deberá explicar el porqué, en todo caso se debe asumir buena fe.   

    El autor original del mensaje debe responder de igual forma a los mensajes dentro del tema, las opiniones de otros usuarios deberá ser
   respetada aunque no sea compartida.
16  Sistemas Operativos / GNU/Linux / Alguien sabe como instalar impresora multifuncion en ubuntu en: 19 Mayo 2010, 22:54 pm
Hola tengo una impresora multifunción epson sx105 , en concreto lo que no puedo usar es el scanner , estoy bajo ubuntu 10.05 , por si sirve de ayuda la salida del comando dmes | grep lpusb es
Código
  1. [   35.117092] usblp0: USB Bidirectional printer dev 3 if 1 alt 0 proto 2 vid 0x04B8 pid 0x0841
  2. [   35.117118] usbcore: registered new interface driver usblp
  3. [   36.346851] usb 2-4: usbfs: interface 1 claimed by usblp while 'usb' sets config #1
  4.  
ya he intentado lo que pone en éste enlace pero nada , alguien sabe algo ?
http://www.ubuntu-es.org/node/33976
17  Programación / Java / Cannot find symbol en: 15 Mayo 2010, 16:42 pm
Hola a todos , resulta que estoy intentando compilar dos ficheros fuente de java , al compilarlos sin la sentencia package ej1.servidor  ambos compilan bien , pero cuando a ambos les agrego dicha sentencia , el fichero ServidorRMI.java compila bien , pero el fichero ServidorRMIimpl.java al compilar me dice "cannot find the symbol ServidorRMI" , ay que decir que estoy trabajando sobre ubuntu 10.04 y que la carpeta ej1/servidor esta sobre /home/usuario/Documentos/fomento_curso/fuente , la variable CLASSPATH contiene dicha ruta , ya lo he comprovado ...! de antemano les agradezco vuestra ayuda , adjunto los fichero .java

Clase ServidorRMI.java
Código
  1. package ej1.servidor;
  2.  
  3. import java.rmi.RemoteException;
  4. import java.rmi.Remote;
  5. public interface ServidorRMI extends Remote {
  6.  
  7. public int Sumar (int arg1, int arg2)throws RemoteException ;
  8. public int Restar (int arg1, int arg2)throws RemoteException;
  9. public int Multiplicar (int arg1, int arg2)throws RemoteException;
  10. public float Dividir (int arg1, int arg2)throws RemoteException;
  11. }

Clase ServidorRMIimpl.java
Código
  1. package ej1.servidor;
  2.  
  3. import java.rmi.server.UnicastRemoteObject;
  4. import java.rmi.RemoteException;
  5. import java.rmi.Naming;
  6. import java.rmi.AlreadyBoundException;
  7. import java.net.MalformedURLException;
  8. public class ServidorRMIimpl  extends UnicastRemoteObject implements ServidorRMI {
  9.  
  10. public ServidorRMIimpl() throws RemoteException{}
  11.  
  12. public int Sumar (int arg1, int arg2)throws RemoteException {
  13. return arg1 + arg2;
  14. }
  15. public int Restar (int arg1, int arg2)throws RemoteException{
  16. return arg1 - arg2;
  17. }
  18. public int Multiplicar (int arg1, int arg2)throws RemoteException {
  19. return arg1 * arg2;
  20. }
  21. public float Dividir (int arg1, int arg2)throws RemoteException{
  22. return arg1 / arg2;
  23. }
  24.  
  25. public static void main (String[]arg){
  26. try{
  27. ServidorRMIimpl obj = new ServidorRMIimpl();
  28. Naming.bind("//localhost/my_servidor",obj);  //127.0.0.1 --> localhost
  29. }catch(RemoteException ABE){
  30. System.out.println("RemoteException ");
  31. }catch(AlreadyBoundException ABE){
  32. System.out.println("AlreadyBoundException ");
  33. }catch(MalformedURLException ABE){
  34. System.out.println("MalformedURLException ");
  35. }
  36. }
  37. }


18  Sistemas Operativos / GNU/Linux / problema al actualizar ubuntu 9.04 > 9.10 en: 27 Abril 2010, 18:03 pm
Hola , anoche actualize mi sistema operativo  ubuntu de la versión 9.4 a la 9.10 , pero al reiniciar no he podido entrar, me
ha mostrado la consola INITFRAMS o algo así (lo siento estoy escribiendo desde el trabajo y no recuerdo bien lo que ponia)
el caso es que no quiero reistalar la 9.4 sin por lo menos intentar arreglar la altual instalación , el problema es que no se que archivo
mirar para postear el error exacto que me da para poder pedir ayuda , alguien sabe como saco información del error o  si a alguien ya
le ha pasado , como lo arreglo , me parece que decia algo del disco o así , es la segunda vez que me sucede . Gracias.
P.D. entrar en modo de recuperación no me ha servido ...
19  Programación / Programación C/C++ / Problema con arbol en ubuntu en: 27 Abril 2010, 01:22 am
Buenas a todos , estoy intentando crear operaciones para un árbol binario y no se que sucede,  el compilador me da estos resultados
Código
  1. diego@diego-desktop:~/Documentos/fuente$ gcc arbol.c -o arbol
  2. arbol.c: En la función ‘main’:
  3. arbol.c:24: aviso: declaración implícita incompatible de la función interna ‘malloc
  4. arbol.c: En la función ‘insertar’:
  5. arbol.c:43: aviso: declaración implícita incompatible de la función interna ‘malloc
  6. arbol.c: En la función ‘arbol_to_array’:
  7. arbol.c:76: aviso: declaración implícita incompatible de la función interna ‘realloc
  8. arbol.c:81: aviso: declaración implícita incompatible de la función interna ‘realloc
  9. diego@diego-desktop:~/Documentos/fuente$
  10.  
Pero cuando ejecuto me aparece los siguiente
Código
  1. *** glibc detected *** ./arbol: realloc(): invalid pointer: 0xbfe00bd8 ***
  2. ======= Backtrace: =========
  3. /lib/tls/i686/cmov/libc.so.6[0xb7640604]
  4. /lib/tls/i686/cmov/libc.so.6(realloc+0x242)[0xb7645022]
  5. /lib/tls/i686/cmov/libc.so.6(realloc+0x42)[0xb7644e22]
  6. ./arbol[0x804872f]
  7. ./arbol[0x8048519]
  8. /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb75e7775]
  9. ./arbol[0x80483a1]
  10. ======= Memory map: ========
  11. 08048000-08049000 r-xp 00000000 08:05 10223911   /home/diego/Documentos/fuente/arbol
  12. 08049000-0804a000 r--p 00000000 08:05 10223911   /home/diego/Documentos/fuente/arbol
  13. 0804a000-0804b000 rw-p 00001000 08:05 10223911   /home/diego/Documentos/fuente/arbol
  14. 08ffa000-0901b000 rw-p 08ffa000 00:00 0          [heap]
  15. b75d0000-b75d1000 rw-p b75d0000 00:00 0
  16. b75d1000-b772d000 r-xp 00000000 08:05 376906     /lib/tls/i686/cmov/libc-2.9.so
  17. b772d000-b772e000 ---p 0015c000 08:05 376906     /lib/tls/i686/cmov/libc-2.9.so
  18. b772e000-b7730000 r--p 0015c000 08:05 376906     /lib/tls/i686/cmov/libc-2.9.so
  19. b7730000-b7731000 rw-p 0015e000 08:05 376906     /lib/tls/i686/cmov/libc-2.9.so
  20. b7731000-b7734000 rw-p b7731000 00:00 0
  21. b7734000-b7741000 r-xp 00000000 08:05 327701     /lib/libgcc_s.so.1
  22. b7741000-b7742000 r--p 0000c000 08:05 327701     /lib/libgcc_s.so.1
  23. b7742000-b7743000 rw-p 0000d000 08:05 327701     /lib/libgcc_s.so.1
  24. b7743000-b7746000 rw-p b7743000 00:00 0
  25. b7746000-b7747000 r-xp b7746000 00:00 0          [vdso]
  26. b7747000-b7763000 r-xp 00000000 08:05 328221     /lib/ld-2.9.so
  27. b7763000-b7764000 r--p 0001b000 08:05 328221     /lib/ld-2.9.so
  28. b7764000-b7765000 rw-p 0001c000 08:05 328221     /lib/ld-2.9.so
  29. bfded000-bfe02000 rw-p bffeb000 00:00 0          [stack]
  30. Cancelado
  31.  
Agradeceria cualquier sugerencia , el código es el siguiente
Código
  1. #include <stdio.h>
  2.  
  3. typedef struct {
  4.    int  info;
  5.    void *izq , *der;
  6. }Nodo;
  7.  
  8. //definimos el tipo puntero a nodo
  9. typedef Nodo * PtrNodo;
  10.  
  11.  
  12. void insertar(PtrNodo *ptrNodo, int info);
  13. int esVacio(PtrNodo nodo);
  14. int buscar(PtrNodo nodo, int elem);
  15. int nodos(PtrNodo nodo);
  16. int arbol_to_array(PtrNodo nodo, int **array, int numEle);
  17.  
  18. int main(){
  19.    PtrNodo raiz = NULL;
  20.    int array[] ={8,1,4,2,6,7};
  21.    int info = 4;
  22.    int  *elem;
  23.    int i = 0;
  24.    elem = (int*)malloc(sizeof(int));
  25.    insertar(&raiz , array[0]);
  26.    insertar(&raiz , array[1]);
  27.    insertar(&raiz , array[2]);
  28.    insertar(&raiz , array[3]);
  29.    insertar(&raiz , array[4]);
  30.    insertar(&raiz , array[5]);
  31.    if(arbol_to_array(raiz, &elem , 0)){
  32.        while(i < 5){
  33.            printf("\nValor %d",elem[1]);
  34.            i++;
  35.        }
  36.    }
  37.    return 0;
  38. }
  39.  
  40.  
  41. void insertar(PtrNodo *ptrNodo, int info){
  42.    if(esVacio(*ptrNodo)){
  43.        *ptrNodo = (PtrNodo) malloc(sizeof(Nodo));
  44.        (*ptrNodo)->info = info;
  45.        (*ptrNodo)->izq = (*ptrNodo)->der = NULL;
  46.    }
  47.    else if ((*ptrNodo)->info < info) insertar((void*)(&(*ptrNodo)->der), info);
  48.    else if ((*ptrNodo)->info > info) insertar((void*)(&(*ptrNodo)->izq), info);
  49. }
  50.  
  51.  
  52. int esVacio(PtrNodo nodo){
  53.    if(nodo == NULL)return 1;
  54.    return 0;
  55. }
  56.  
  57. int buscar(PtrNodo nodo, int elem){    
  58.  if (nodo == NULL) return 0;
  59.  else if (nodo->info < elem) return buscar(nodo->der, elem);
  60.  else if (nodo->info > elem) return buscar(nodo->izq, elem);
  61.  else return 1;
  62. }
  63.  
  64. int nodos(PtrNodo nodo){
  65.    if(!nodo)return 0;
  66.    else return(1 + nodos(nodo->izq) + nodos(nodo->der));
  67. }
  68. int arbol_to_array(PtrNodo nodo, int **array, int numElem){    
  69.    if(!nodo){
  70.        return 0;
  71.    }else{        
  72.        *array[numElem] = nodo->info;
  73.        printf("\nPos:%d  ele:%d",numElem ,*array[numElem]);
  74.        if(nodo->izq){
  75.            numElem++;
  76.            realloc(array , (numElem + 1) * sizeof(int));
  77.            arbol_to_array(nodo->izq , array , numElem);
  78.        }
  79.        if(nodo->der){
  80.            numElem++;
  81.            realloc(array , (numElem + 1) * sizeof(int));
  82.            arbol_to_array(nodo->der , array , numElem);
  83.        }
  84.        return 1;
  85.    }
  86. }
  87.  
  88.  
  89.  
Páginas: 1 [2]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines