Unix : transfering a filesystem or directory

to transfer a filesystem or directory while preserving permissions, special files and such, you can use the following :

# cd sourceDirectory
# tar cpf – . | (cd destinationDirectory && tar xpf – )

The first tar will archive the source directory and pipe it out to the second one which operates the extraction in the destination directory.

OpenBSD : Creating a transparent bridge

This post will be short, because it is actually easier than I expected … Anyway, considering my memory, better blog out that for later reference 😉

A bridge is a network device used to connect two or more network segments. You can achieve this easily on OpenBSD with the following commands :

# echo 'up' > /etc/hostname.if0
# echo 'up' > /etc/hostname.if1
# echo 'add if0 add if1 up' > /etc/bridgename.bridge0

This will setup the two interfaces if0 and if1 (replace with your own, like rl0, em0, etc etc) and add them into the bridge0.

Then you need to enable ip forwarding so that IP packets will pass from one interface to the others as needed. You do that by editing the file /etc/sysctl.conf and uncommenting the line which reads :

Once this is all done, reboot to activate.

This bridge is IP-less, which means it is “harder” to attack. You can still filter at MAC level and at IP level through PF (the firewall of OpenBSD).

Tested on OpenBSD 3.9

Man pages :

Windows XP – Disable administrative shares

Windows has a bad habit of enabling by default some shares on a new installation. These are, for example, C$, D$ (they give access to your partition roots) … ADMIN$, IPC$

Those shares are accessible by the administrators, but they could be a useless security breach.

Even worse, if you delete them, they will come back at the next start of the Server service starts…
If you wish to permanently disable them then create the following key in the registry (if it already exists, set the value to 0) :



more good informations here : http://www.petri.co.il/disable_administrative_shares.htm

Windows XP – Repair the boot block

if your boot block got corrupted (virus, or installation which went wrong), you may want to try to repair it by using the Recovery Console of Windows XP.

To do so, boot on the Windows XP CD and when asked, choose to repair the Windows XP installation by pushing R.

This will lead you to the Recovery Console. You will be asked for the installation to repair (ex : 1: C:\Windows), and then to enter the administrator’s password.

Then you can try to do a fixmbr (which is equivalent to the old fdisk /mbr) or a bootblock which will install a new boot block.

Be sure to understand what you do ! You might as well spoil your last chance to recover your installation with those commands !

OpenBSD : Give money !!

not to me !! 😀

The OpenBSD project needs money to hold its events (such as hackaton, where developpers gather to implement features, or usual running costs).

If you think you don’t use OpenBSD, think again ! The project OpenSSH, which implements a free, and secure SSH implementation, comes from OpenBSD. It is widely used in many OSes and appliances …

We need OpenBSD !! Don’t hesitate to make a donation !

The original post
The OpenBSD project

The OpenSSH sister project

Add disk in an AIX machine

few useful commandes :

  • lsdev : allows you to list the hardware in your machine AIX knows about. For example
    lsdev -C | grep scsi

    will list all the SCSI interfaces of your machine

  • cfgmgr : lets you change the hardware settings. For example
    cfgmgr -l scsi0

    will rescan the scsi0 bus to find and configure any newly attached SCSI peripheral.

Sun T3 StorEdge : Batteries refresh …

if you get this kind of “error” :
Dec 14 02:36:31 hostname StoreX (Dec 14, 2005 2:36:31 AM FQDN):P3:System hostname-t3 (XX.XX.XX.XX) - Unit-unit-1 - Power-Module-2 (u1pcu2) : Power supply unit has switched to battery. Fru ID: u1pcu2, Model: 300-1454-01(50), Serial Number: XXXXXX
Dec 14 02:58:31 hostname StoreX (Dec 14, 2005 2:58:30 AM FQDN):P3:System hostname-t3 (XX.XX.XX.XX) - Unit-unit-1 - Power-Module-2 (u1pcu2) : The FRU has some error. Fru ID: u1pcu2, Model: 300-1454-01(50), Serial Number: XXXXX

then be aware that a T3 performs a battery refresh every so and then (this is by default every 28 days, but can be modified in /etc/schd.conf). This battery refresh can provoke this kind of error messages which are no error at all …

Sun T3 StorEdge : Identifying a failure

when logged on the T3, you can see the state of each FRU with the command

fru stat

Example :

hostname-t3:/:fru stat
------  -------  ----------  ----------  -------    ----
u1ctr   ready    enabled     master      -          32.5

DISK    STATUS   STATE       ROLE        PORT1      PORT2      TEMP  VOLUME
------  -------  ----------  ----------  ---------  ---------  ----  ------
u1d1    ready    enabled     data disk   ready      ready      34    v0
u1d2    ready    enabled     data disk   ready      ready      30    v0
u1d3    ready    enabled     data disk   ready      ready      43    v0
u1d4    ready    enabled     data disk   ready      ready      31    v0
u1d5    ready    enabled     data disk   ready      ready      39    v0
u1d6    ready    enabled     data disk   ready      ready      31    v0
u1d7    ready    enabled     data disk   ready      ready      32    v0
u1d8    ready    enabled     data disk   ready      ready      30    v0
u1d9    ready    enabled     standby     ready      ready      31    v0

LOOP    STATUS   STATE       MODE        CABLE1     CABLE2     TEMP
------  -------  ----------  -------     ---------  ---------  ----
u1l1    ready    enabled     master      -          -          27.5
u1l2    ready    enabled     slave       -          -          30.0

------  -------  ---------   ------  ------  -------  ------  ------  ------
u1pcu1  ready    enabled     line    normal  normal   normal  normal  normal
u1pcu2  ready    enabled     line    normal  normal   normal  normal  normal