domenica 25 ottobre 2015

Bring back old style logon panel in Windows 7

The following procedure modifies Windows' registry. Proceed with caution.

Launch Windows' registry editor, Regedit.exe. Go to the following location.


In the right side pane, change the key's value of


to 1.

If you don't see any dontdisplaylastusername, create a new DWORD key. Name it dontdisplaylastusername and set its value to 1.

Possible values of dontdisplaylastusername are

0 - The name of the last user who logged on successfully appears in the Log On to Windows dialog box. This setting is designed to make logging on faster and easier.

1 - The User name field in the Log On to Windows dialog box is blank. This setting is designed to enhance the security of the system by not displaying a valid user name.

sabato 10 ottobre 2015

Standard user can't FTP on OS X default FTP service

If you, like me, are used to work with a standard user and need, for a number of reason, to enable OS X's FTP service ( Enable FTP service in OS X Lion ), typical case is multifunction printer sending scanned documents to your Mac, you'll be surprised to know that you cannot login successfully unless you are an administrator.

host01:~ admin$ ftp localhost
Trying ::1...
Connected to localhost.
220 ::1 FTP server (tnftpd 20100324+GSSAPI) ready.
Name (localhost:admin):
331 User admin accepted, provide password.
230 User admin logged in.
Remote system type is UNIX.
Using binary mode to transfer files.

This is what happen trying to login with a standard user

host01:~ example$ ftp localhost
Trying ::1...
Connected to localhost.
220 ::1 FTP server (tnftpd 20100324+GSSAPI) ready.
Name (localhost:example): 
331 User example accepted, provide password.
530 User example denied by SACL.
ftp: Login failed

User example denied by SACL

SACL stands for Service Access Control List, that is, Access Control List applied to services.

Honestly I don't know if this is a normal behavior on pre OS X Yosemite's version. I'm actually running 10.10.5.

Anyway, the problem is easy solvable following the instructions below.

Open Terminal and issue the command

dseditgroup -o edit -u admin -a example

The password asked is admin's password. The command above add (-a) the user example to the group by the administrator user admin. It also works if the user you are issuing it, is a standard user. 

To remove (-d) example from the group issue

dseditgroup -o edit -u admin -d example


The procedure described above is also valid for OS X El Capitan

sabato 2 maggio 2015

Edit a remote file via ssh

ssh is mainly used to securely remote login to another computer.
It can also be used to issue commands on a remote machine without actually logging in. Thus, you may as well edit a remote file using vi. The syntax would be

ssh user@host 'vi filename'

Unfortunately you'll get the following message

Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal

You can quickly resolve the problem adding -t option to ssh

ssh -t user@host 'vi filename'

Here's what man ssh tells about -t option

  • -t  Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

lunedì 24 novembre 2014

OS X, how to launch an application in a different language than your default system language

Sometimes it can be useful to launch a particular application in a language that is not the one you choose when you first set up your account.

In order to do that momentarily, let's say I want to execute Preview in English instead of Italian, open Terminal and type the following command (or copy and paste the line below)

/Applications/ -AppleLanguages '(en-US)' &

The ampersand at the end of the line puts the execution of Preview in background, returning to the Terminal's prompt immediately.

It is also possible to always launch an application in another language. For the purpose of this example, Spanish. Open Terminal and type (or copy and paste) the following line
defaults write AppleLanguages '("es")'

To revert back to the default language, the command to issue into Terminal is 

defaults delete AppleLanguages

giovedì 26 dicembre 2013

Prevent auto mount in OS X

I like experimenting, a lot, with my computers. To be honest, that is the funny part of owning a computer.

I am going to use the Terminal in order to edit the file /etc/fstab
As a matter of fact, this file does not exist by default in OS X 10.5, 10.8 and 10.9. It doesn't probably exist on other versions of OS X too, but those OSs are what I'm using.

To create and/or edit /etc/fstab use vifs. Do not simply edit fstab with a text editor like vi.

This is vifs' man page

The goal here is to insert into fstab the IDs of the volumes you don't want to mount when the system boots.
You have two options. Specify the UUID (universally unique identifier) of the volume, or the volume disk label.
The volume disk label is the easiest method, because you already know it. For example the internal Macintosh hard drive is labelled "Macintosh HD" or whatever you named it. So, the line to add, looks like this

LABEL=Macintosh\040HD none hfs rw,noauto

The \040 represents the space character (see ASCII table) in octal numeral system.

The other option is to put in the UUID of the volume you don't want to mount.
To know the UUID you must issue a couple of commands.

diskutil list

   #:            TYPE NAME                 SIZE       IDENTIFIER
   0:  GUID_partition_scheme              *500.1 GB   disk0
   1:            EFI                       209.7 MB   disk0s1
   2:            Apple_HFS MacOSX_SYS      499.2 GB   disk0s2
   3:            Apple_Boot Recovery HD    650.0 MB   disk0s3

Lists all the information about the disks connected to your Mac. You must search for a line with the name equivalent to the volume's name you want to exclude from auto mount and make note of its identifier.
In my example this is /dev/disk0s2.
The last command let you know the UUID associated to the volume

diskutil info /dev/disk0s2 | grep UUID

Volume UUID:         72B18CD5-ADD4-382E-A877-F67239F204B3

So, the line to add to fstab is

UUID=72B18CD5-ADD4-382E-A877-F67239F204B3 none hfs rw,noauto

Save the new fstab file and reboot.

lunedì 4 novembre 2013

Disable hibernation on Windows 7, 8, 8.1

By default hibernation is enabled, and uses the file named hiberfil.sys located on the root folder of the system disk. This file is as big as the total amount of RAM installed inside your computer.
To disable hibernation, the quickest way is running a Command Prompt session with Run as administrator

At the prompt type

powercfg.exe /hibernate off

To verify that hibernation is really gone issue the following command

dir /as %SystemDrive%\hiberfil.sys

if you get "File not found" then hibernation is disabled.

To revert the above command

powercfg.exe /hibernate on

sabato 19 ottobre 2013

EFI and SMC firmware updates for Intel-based Macs

Usually Software Update can detect autonomously if your computer needs firmware updates.
If you want to be sure that your Mac's EFI and SMC firmware are updated, especially before upgrading the operating system, check this Knowledge Base document HT1237.