Mês: julho 2012

[Dica] – Iniciar sessão GDM com usuário desejado

Iniciar sessão do GDM – Automaticamente com o usuário desejado.

root@FriendlyARM:~# uname -a
Linux FriendlyARM 2.6.28.6-FriendlyARM #2 Sat Jun 26 13:24:08 CST 2010 armv6l GNU/Linux

root@FriendlyARM:~# ls /etc/gdm/
custom.conf        failsafeXinit    Init         PreSession
failsafeBlacklist  failsafeXServer  PostLogin    Xsession
failsafeDexconf    gdm.schemas      PostSession

Editar o arquivo custom.conf

root@FriendlyARM:~# cat /etc/gdm/custom.conf
[daemon]
TimedLoginEnable=false
AutomaticLoginEnable=true
TimedLogin=ubuntu
AutomaticLogin= User
TimedLoginDelay=30

Anúncios

[Linux] – Syntek Semiconductor 802.11g + Bluetooth Wireless Adapter

Como ativar o módulo Syntek Semiconductor 802.11g + Bluetooth Wireless Adapter no Linux (Ubuntu >= 10.04)

fredim@corleone:~$ lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 05e1:0100 Syntek Semiconductor Co., Ltd
Bus 001 Device 003: ID 0c45:62c0 Microdia Sonix USB 2.0 Camera
Bus 001 Device 002: ID 1e3d:2093
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

fredim@corleone:~$ sudo lsusb -v -d 05e1:0100

Bus 001 Device 004: ID 05e1:0100 Syntek Semiconductor Co., Ltd
Device Descriptor:
bLength                18
bDescriptorType         1
bcdUSB               2.00
bDeviceClass            0 (Defined at Interface level)
bDeviceSubClass         0
bDeviceProtocol         0
bMaxPacketSize0        64
idVendor           0x05e1 Syntek Semiconductor Co., Ltd
idProduct          0x0100
bcdDevice            0.02
iManufacturer           1 Syntek Semi Co..
iProduct                2 WiFi USB Dongle
iSerial                 3 Manufacture
bNumConfigurations      1
Configuration Descriptor:
bLength                 9
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
wMaxPacketSize     0x0200  1x 512 bytes
bInterval               1
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x83  EP 3 IN
bmAttributes            2
Transfer Type            Bulk
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0200  1x 512 bytes
bInterval               1
Endpoint Descriptor:
bLength                 7

(Bus Powered)

Drivers disponíveis no site da Syntek são:

[2010-08-30] Ubuntu10.04 32bit[2.6.32-21/22/23/24-generic]
[2010-06-04] Ubuntu10.04 64bit[2.6.32-21/22-generic]

A solução abaixo é pra quem usa kernel diferente dos listado acima:

fredim@corleone:~$ git clone git://github.com/reyiyo/3dsp.git

fredim@corleone:~$ cd 3dsp/
fredim@corleone:~/3dsp$ chmod +x Install_3DSPUSB.sh
fredim@corleone:~/3dsp$ sudo ./Install_3DSPUSB.sh

fredim@corleone:~/3dsp$ sudo shutdown -r now

WiFi:

Aplicativos -> Acessórios -> 3DSP WiFi Radar

Bluetooth:

Sistema -> Preferências -> Bluetooth

[Python] – TCP Socket

Cliente conecta no servidor –> Cliente envia mensagens para o Servidor

Cliente.py

import socket

HOST = ‘10.0.0.11’   # Endereco IP do Servidor
PORT = 5000            # Porta que o Servidor esta

tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
dest = (HOST, PORT)
tcp.connect(dest)

print ‘Para sair use CTRL+X\n’
msg = raw_input()
while msg <> ‘\x18’:

  tcp.send (msg)
msg = raw_input()

tcp.close()

 

___

 

Servidor.py

import socket

HOST = ‘ ‘                # Endereco IP do Servidor
PORT = 5000            # Porta que o Servidor esta

tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
orig = (HOST, PORT)
tcp.bind(orig)
tcp.listen(1)
while True:

con, cliente = tcp.accept()
print ‘Concetado por’, cliente
while True:

msg = con.recv(1024)
if not msg: break
print cliente, msg

print ‘Finalizando conexao do cliente’, cliente
con.close()