Archive

Author Archive

pwconf

October 7th, 2009 roger No comments

Em alguns sistemas  unix podemos ainda encontrar a hash da password no ficheiro /etc/passwd

Para passar as password para o ficheiro /etc/shadow usa-se a seguinte ferramenta de sistema pwconf:

PWCONV(8)			  26 Sep 1997			     PWCONV(8)

NAME

pwconv, pwunconv, grpconv, grpunconv - convert to and from shadow passwords and groups.

SYNOPSIS

pwconv pwunconv grpconv grpunconv

DESCRIPTION

pwconv creates shadow from passwd and an optionally existing shadow. pwunconv creates passwd from passwd and shadow and then removes shadow. grpconv creates gshadow from group and an optionally existing gshadow. grpunconv creates group from group and gshadow and then removes gshadow. These four programs all operate on the normal and shadow password and group files: /etc/passwd, /etc/group, /etc/shadow, and /etc/gshadow. Each program acquires the necessary locks before conversion. pwconv and grpconv are similar. First, entries in the shadowed file which don't exist in the main file are removed. Then, shadowed entries which don't have `x' as the password in the main file are updated. Any missing shadowed entries are added. Finally, passwords in the main file are replaced with `x'. These programs can be used for initial conversion as well to update the shadowed file if the main file is edited by hand. pwconv will use the values of PASS_MIN_DAYS, PASS_MAX_DAYS, and PASS_WARN_AGE from /etc/login.defs when adding new entries to /etc/shadow. Likewise pwunconv and grpunconv are similar. Passwords in the main file are updated from the shadowed file. Entries which exist in the main file but not in the shadowed file are left alone. Finally, the shadowed file is removed. Some password aging information is lost by pwunconv. It will convert what it can.

BUGS

Errors in the password or group files (such as invalid or duplicate entries) may cause these programs to loop forever or fail in other strange ways. Please run pwck and grpck to correct any such errors before converting to or from shadow passwords or groups.

FILES

/etc/login.defs shadow password suite configuration

SEE ALSO

grpck(8), login.defs(5), pwck(8).
Categories: sysadmin Tags:

Benfica2009

September 29th, 2009 roger 2 comments

É certo que as vitorias vigorosas do Benfica incomoda muitas minorias, mas  faz bem ao povo em geral.

Taxa de felicidade subiu.

Taxa de violência domestica está a descer.

é uma maravilha :P

Categories: Desporto Tags:

SSH Manager

September 25th, 2009 roger No comments

Normalmente uso o putty para ligações ssh senti a falta de algo do género para linux mas em modo texto com alguma pesquisa descobri o seguinte programa  sshmgr deixo aqui a referencia ao programa :)

SSH ManaGeR is now deprecated in favour of CONNection ManaGeR.

If you have many ssh accounts on different servers requiring different ports and user names, this is the tool for you!
This is more than _just_ a simple ssh wrapper, sshmgr is really seven applications in one!
There is sshmgr, scmdmgr, sftpmgr, scpget, scpput, ftpmgr and telnetmgr.

sshmgr depends on Perl (>= 5.6.0) and the CPAN module AppConfig. sshmgr also has an accompanying Bash (requires bash >= 2.05b) script for extending the tab auto completion for the commands sshmgr, scmdmgr, sftpmgr, ftpmgr and telnetmgr. There is now a Makefile included for all those that don’t want the hassles of the deb, rpm or tgz packages. Please don’t ask me to include password storing facilities, use ssh-agent and ssh keys to alleviate any password typing woes. Documentation on ssh-agent and ssh keys can be found here.

If you want to contribute bug-reports, feature requests, or code you can join the mailing list here or you can contact me directly.

Here’s my PGP Key.
PGP key num: 04A112AD
Fingerprint: 0864 D1CC E3E5 48BF 3B0F 4373 55EC C529 04A1 12AD

Categories: scripts, sysadmin Tags: ,

HomeServer

September 9th, 2009 roger No comments

Ando a procura de um homeserver para o utilizar como laboratório de testes.

O problema neste tipo de computadores é normalmente o preço. Mas encontrei este boato de um servidor da lenovo por cerca de 500$:

Lenovo-IdeaCentre-D400-Home-Server

IdeaCenter D400 runs on Intel’s Pentium Dual Core processor and 4GB of memory. It offers four 3.5-inch drive bays, which is enough for up to a total of 8TB storage capacity. There are also an eSATAport and five USB ports. Of course, Etherner port is available.

Categories: gadget, homeserver Tags:

Pstools

September 2nd, 2009 roger No comments

Por vezes tenho de dar algum tipo de assistência em maquinas Microsoft (infelizmente).

Recentemente voltei a descobrir e utilizar um conjunto de ferramentas que permitem executar alguns comandos unix style, o que aconselho vivamente.

The Windows NT and Windows 2000 Resource Kits come with a number of command-line tools that help you administer your Windows NT/2K systems. Over time, I’ve grown a collection of similar tools, including some not included in the Resource Kits. What sets these tools apart is that they all allow you to manage remote systems as well as the local one. The first tool in the suite was PsList, a tool that lets you view detailed information about processes, and the suite is continually growing. The “Ps” prefix in PsList relates to the fact that the standard UNIX process listing command-line tool is named “ps”, so I’ve adopted this prefix for all the tools in order to tie them together into a suite of tools named PsTools.

Note: some anti-virus scanners report that one or more of the tools are infected with a “remote admin” virus. None of the PsTools contain viruses, but they have been used by viruses, which is why they trigger virus notifications.

The tools included in the PsTools suite, which are downloadable as a package, are:

  • PsExec – execute processes remotely
  • PsFile – shows files opened remotely
  • PsGetSid – display the SID of a computer or a user
  • PsInfo – list information about a system
  • PsKill – kill processes by name or process ID
  • PsList – list detailed information about processes
  • PsLoggedOn – see who’s logged on locally and via resource sharing (full source is included)
  • PsLogList – dump event log records
  • PsPasswd – changes account passwords
  • PsService – view and control services
  • PsShutdown – shuts down and optionally reboots a computer
  • PsSuspend – suspends processes
  • PsUptime – shows you how long a system has been running since its last reboot (PsUptime’s functionality has been incorporated into PsInfo)

The PsTools download package includes an HTML help file with complete usage information for all the tools.

Experimentem.

Categories: sysadmin Tags:

3D Nvidia

August 26th, 2009 roger No comments

Aqui fica duas  “reviews”  de um gadget que eu gostaria de experimentar :)

Motivos pelos quais gostaria de experimentar:

  • Filmes
  • jogos

Esta tecnologia poderá num futuro muito próximo tornar-se standard nas nossas casas.

Categories: gadget Tags: , ,

Tarefa chata + perl

August 21st, 2009 roger No comments

Tarefa abrir 80 zips e substituir um documento.

Uma vez que não gosto de tarefas rotineiras resolvi elaborar um script para isto e aqui fica.

#!/usr/bin/perl -w
use warnings;
#use strict;

use Archive::Zip qw( :ERROR_CODES );

#list directory
@files = <*.zip>;
foreach $file (@files) {
print $file . “\n”;

# Read the ZIP
my $zip = Archive::Zip->new();
unless( $zip->read($file) == AZ_OK ) {
die “read error\n”;
}

# Update file
$zip->removeMember( ‘Pathdentrodozip’);
$zip->addFile( ‘.Pathforadozip’, ‘Pathdentrodozip’ );

# Save the Zip file
$zip->overwrite();
}

Posso ainda melhorar mas não prevejo ter que usar novamente este script.

O que tive de ler: Modulo CPAN

E tive ajuda do Bruno Barão na interpretação do modulo que desde já agradeço

Categories: Uncategorized, scripts Tags: ,

WDTV2

August 18th, 2009 roger 2 comments

Ora aqui está um gadget bastante interessante , já algum tempo que comprei o wdtv e alguns problemas* que tinha identificado em principio não vão existir na segunda versão, se assim for eu compro :)

Link

* DTS decoder; interface de rede.

Categories: gadget Tags: ,