Tag Archives: ubuntu

Automate running dhclient in Ubuntu

Well, this is basically a reminder to the future when you need to reconfigure my network. haha!

Since I’m using a DHCP service on a router “D-Link”, I needed to automate my settings on my network interface to avoid always run the command “dhclient”.

/etc/nework/interfaces

auto eth0
iface eth0 inet dhcp

So save the file “interfaces”, run “ifdown eth0″ to stop the service and “ifup eth0″ to starter again.

- Now run the command “ifdown eth0″ for stop service

root@btlagutoli-desktop:/home/btlagutoli# ifdown eth0
There is already a pid file /var/run/dhclient.eth0.pid with pid 1125
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:xx:aa:dd:dd:dff
Sending on   LPF/eth0/00:xx:aa:dd:dd:dff
Sending on   Socket/fallback
DHCPRELEASE on eth0 to 192.168.0.1 port 67
suspect value in server_name option - discarded



- Finally, run “ifup eth0″ for start the service again

root@btlagutoli-desktop:/home/btlagutoli# ifdown eth0
There is already a pid file /var/run/dhclient.eth0.pid with pid 1125
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:xx:aa:dd:dd:dff
Sending on   LPF/eth0/00:xx:aa:dd:dd:dff
Sending on   Socket/fallback
DHCPRELEASE on eth0 to 192.168.0.1 port 67
suspect value in server_name option - discarded

That’s it!

Alterar editor default no Linux

Bom, isso não é um artigo e sim uma pequena dica para as pessoas que odeiam editar arquivos utilizando o nano (/bin/nano).

No Ubuntu o Nano  é o editor default e para alterar isso, digite;

sudo update-alternatives --config editor

Executando o comando você terá as seguintes opções;

btlagutoli@agutoli:/var/www/gazetaesportiva$ sudo update-alternatives --config editor
Existem 4 escolhas para a alternativa editor (fornecendo /usr/bin/editor).

  Seleção    Caminho             Prioridade Estado
------------------------------------------------------------
* 0            /bin/nano            40        modo automático
  1            /bin/ed             -100       modo manual
  2            /bin/nano            40        modo manual
  3            /usr/bin/vim.basic   30        modo manual
  4            /usr/bin/vim.tiny    10        modo manual

Pressione ENTER para deixar a escolha corrente[*] ou digite o número selecionado:

Eu prefiro utilizar o vim, então escolhi a opção 4

É isso.

abraço!

Charset no Apache

Acredito que não há um programador web no mundo que nunca se deparou com problemas de charset (UTF-8, ISO-8859-1).
read more »

Criando atalhos no Linux

Se você é um daqueles que adora navegar no Linux utilizando o terminal, veja como criar atalhos dos pontos mais acessados.
read more »

  • RSS
  • Facebook
  • Google+
  • LinkedIn
  • Twitter
  • Git Hub
  • YouTube