How to fix ‘$MFTMirr does not match $MFT (record 0)’ error

From time to time hard disks with NTFS filesystem get a ‘$MFTMirr does not match $MFT (record 0)’ error when user try to mount or read/write.

This error can be easily fixed running the ntfsfix command as seen below.

root@artemis:~# ntfsfix /dev/sdf1
Mounting volume… $MFTMirr does not match $MFT (record 0).
FAILED
Attempting to correct errors…
Processing $MFT and $MFTMirr…
Reading $MFT… OK
Reading $MFTMirr… OK
Comparing $MFTMirr to $MFT… FAILED
Correcting differences in $MFTMirr record 0…OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition… OK
Going to empty the journal ($LogFile)… OK
Checking the alternate boot sector… OK
NTFS volume version is 3.1.
NTFS partition /dev/sdf1 was processed successfully.

User can then mount the drive and proceed with read/write operations.

Debugging Mobile Applications using Fiddler

Debugging web applications using IDEs or Web Browser extensions.

Debugging mobile applications is harder and this is where web debugging proxies come in hand.
Fiddler (http://www.telerik.com/fiddler) is a nice free app that can help here.

From Fiddler side you have to be sure that you check «Allow remote computers to connect» from menu Tools -> Fiddler Options and Connections Tab.

On the client side (in our case an Android device) from Network Connections(Wi-Fi), long-press the connected Network then Modify and on Advanced Options enter the Proxy hostname and Proxy port (default on Fiddler is 8888).

Just for testing try to open a web page from Chrome and you will see on Fiddler the traffic.

Enjoy!

NetApp Data Ontap Change Gateway and other useful commands

Changing the default gateway in Data Ontap usually requires 2 steps.

First delete the current default gateway

route delete dafault

and then add the new default gateway e.g.

route add 0.0.0.0 192.168.1.1 1

We can see that everything is ok with the command

netstat -rn

that shows the routing table and with the command

rdfile /etc/rc

showing the network interfaces configuration.

Delete Network Share Cached Credentials

Recently i had the need to test access to a network share using different domain credentials.

Command net use can show the network shares currently connected and with net use \\sharename /del you can delete cached credentials for this share.

Allow-Request in Bind

Recently i figured out that using Openvpn on my Android phone failed to properly query DNS using my Bind9 service.
Following entries appeared in syslog in my attempts to access http sites:

client 74.125.189.18#38921: query (cache) ‘ns1.domain2.com/A/IN’ denied

I had to do the following to make it work.

Add following line in /etc/bind/named.conf.local

// Managing acls
acl internals { 127.0.0.0/8; 192.168.1.0/24; 10.8.0.0/24; };

and

// Allow recursive queries to the local hosts
allow-recursion { internals; };

in /etc/bind/named.conf.options

And it worked!

Revoke OpenVpn Certificate

First step is to navigate to /etc/openvpn/easy-rsa where keys and certificates are stored.

After that we should run source ./vars and then ./revoke-full CertificateName. The latter should be only the name without the extension.

Index.txt file inside keys folder should write R in front of each certificate revoked before.

Properly redirect in LoginStatus ASP.NET

Under some circumstances redirection to LogoutPageUrl set in asp:LoginStatus control will not work as expected. You have to explicitly set the LogoutAction to value «Redirect».

Comment and Uncomment Shortucts in Visual Studio 2010

Using CTRL+K, CTRL+C, or CTRL+K, CTRL+U in Visual Studio, you can comment or uncomment selected text.

FTP using Unix Authentication in NetApp

For some reason this caused me some time to figure out how it is working so i thought i should share it.

Let’s say we want FTP access to a share created in a NetApp filer, using Unix authentication mode.
Συνέχεια

Print Server using CUPS in Linux

CUPS (www.cups.org) is an open source printing system developed by Apple for UNIX-like operating systems and OSX.

Implementing a print server with CUPS could be simple or very complicated if integration with AD, LDAP is needed.

Here we will take a look on how we can share a simple USB printer across our network.
Συνέχεια