MVC with Fluent validation when set a rule the view doesn’t validate

I include the rule for my model, but when I do it then view doesn’t validate. If I remove the rule the view validate correctly.

The problem is that the razor doesn’t include the validation on the model when I include the rule in the validator.

This is the model with the rule:

public class LoginModelValidator : AbstractValidator<LoginModel>
{
    public LoginModelValidator()
    {
        RuleSet("login", () =>
        {
            RuleFor(model => model.Email)
                .NotNull()
                .EmailAddress();

            RuleFor(model => model.Password).NotNull();
        });

        /*
        RuleSet("forgotpass", () =>
        {
            RuleFor(model => model.Email)
                .NotNull()
                .EmailAddress();
        });
        */
    }
}

When send the request, in the action I include:

[CustomizeValidator(RuleSet="login")]

for validate the rule login and it work find. The problen is in the view.

Solutions to resize root partition on live mounted system

I’m writing a Chef recipe to automate setting up software RAID 1 on an existing system with. The basic procedure is:

  1. Clear partition table on new disk (/dev/sdb)
  2. Add new partitions, and set then to raid using parted (sdb1 for /boot and sdb2 with LVM for /)
  3. Create a degraded RAID with /dev/sdb using mdadm –create … missing
  4. pvcreate /dev/md1 && vgextend VolGroup /dev/md1
  5. pvmove /dev/sda2 /dev/md1
  6. vgreduce VolGroup /dev/sda2 && pvremove /dev/sda2

I’m stuck on no. 5. With 2 disks of the same size I always get an error:

Insufficient free space: 10114 extents needed, but only 10106 available
Unable to allocate mirror extents for pvmove0.
Failed to convert pvmove LV to mirrored

I think it’s because when I do the mdadm –create, it adds extra information to the disk so it has slightly less physical extents.

To remedy the issue, one would normally reboot the system off a live distro and:

  • e2fsck -f /dev/VolGroup/lv_root
  • lvreduce -L -0.5G –resizefs …
  • pvresize –setphysicalvolumesize …G /dev/sda2
  • etc etc
  • reboot

and continue with step no. 5 above.

I can’t do that with Chef as it can’t handle the rebooting onto a live distro and continuing where it left off. I understand that this obviously wouldn’t be idempotent.

So my requirements are to be able to lvreduce (somehow) on the live system without using a live distro cd.

Anyone out there have any ideas on how this can be accomplished?

Maybe?:

  • Mount a remote filesystem as root and remount current root elsewhere
  • Remount the root filesystem as read-only (but I don’t know how that’s possible as you can’t unmount the live system in the first place).
  • Or another solution to somehow reboot into a live distro, script the resize and reboot back and continue the Chef run (Not sure if this is even popssible

Ideas?

[ Singles & Dating ] Open Question : Sex Research for my book?

If you’re in a relationship how many time’s should you and your partner have sex? Or how many time out of a week do you and your partner have sex?

U.D.O. To Release ‘Decadent’ In January

U.D.O., the German metal band led by former ACCEPT frontman Udo Dirkschneider, will release a new studio album, “Decadent”, in January 2015. U.D.O.s most recent studio CD, “Steelhammer”, was released on May 24, 2013 via AFM Records. The effort was produced by Dirkschneider and Fitty Wienhold. U.D.O.s latest concert DVD, “Steelhammer – Live From Moscow”, came out in May. The first live release of U.D.O.s new lineup (with a Russian bandmember) was filmed on September 28, 2013 at the Arena Hall in Moscow to highlight the “Steelhammer” tour. The band put together an exceptional setlist, including many classics that havent been played for a long time, fan favorites and tracks from “Steelhammer”. “Steelhammer – Live From Moscow” was made available as DVD/2-CD, Bluray/2-CD and triple-vinyl in Russian national colors (tricolor). U.D.O. in 2012 announced the addition of guitarist Andrey Smirnov to the groups ranks. He replaced Stefan Kaufmann, who left the group for health reasons. (Thanks: NJthrasher)

Read More…