domenica 11 gennaio 2026

Black hole printer

Using *nix netcat to impersonate a network printer sending all received data to /dev/null

nc -kl 9100 > /dev/null

Snippet code below formatted by hilite.me

#!/bin/bash

# Start listening on port 9100

echo "Listening on port 9100 emulate HP Jetdirect - Socket. All data received is sent to /dev/null"
echo "^C to halt script"
nc -kl 9100 > /dev/null

giovedì 28 settembre 2017

Apple AirPort Utility 5.6.1 on macOS High Sierra - Update

macOS High Sierra, the new major release of Apple's operating system, is here . I did a clean install onto an external USB3 SSD yesterday evening. This morning I tested the old AirPort Utility 5.6.1 combined with AirPort Utility 5.6.1 Launcher, by Corey J. Mahler, and again, it works just fine. I connected the base station to the computer using an Ethernet cable, otherwise via Wi-Fi, the old AirPort Utility does not find any base station.




mercoledì 5 ottobre 2016

Apple AirPort Utility 5.6.1 on macOS Sierra - Update

I'm testing the latest Apple OS, macOS Sierra. I did a clean install of the new operating system onto an external USB3 SSD, just to see if all the programs and peripherals I use are compatible.

I also tried the old AirPort Utility 5.6.1 combined with AirPort Utility 5.6.1 Launcher, by Corey J. Mahler, and for me, it works just fine as you can see on the picture below



lunedì 11 luglio 2016

Gmail and POP3

In my experience the optimal way to manage a Gmail account, is either using an Android device and setting the Gmail app appropriately, or through a browser getting to the Gmail site page.

Trying to get to work Gmail with a different email client is leading to mixed result. In this case if you are still relying on the old POP3 protocol and using different devices to manage your electronic messages, I recommend reading the following Gmail help page

Using POP on multiple clients or mobile devices

giovedì 24 marzo 2016

Apple AirPort Utility 5.6.1 on El Capitan - Update

Thanks to Cucho Olivares that commented my previous post, here's an update.

It is an update note that comes from Corey J. Mahler, the guy who wrote the AirPort Utility 5.6.1 Launcher.

Here's the note

"It would appear that Apple has changed something in the network stack in a recent update to Yosemite. This update has resulted in AirPort Utility v5.6.1 not being able to find some AirPort Units some of the time. While this is annoying, there is a simple fix: Connect the AirPort Unit you wish to view in AirPort Utility v5.6.1 to the Mac running the utility via a wired (i.e., Ethernet) connection. I have yet to hear of any case where this has not solved the connectivity issue."

This is the link, the note is taken from

AirPort Utility v5.6.1

Scroll down to Old Content and expand.

10 May 2015: AirPort Units Not Showing in AirPort Utility 5.6.1 under OS X 10.10 Yosemite (Likely Limited to 10.10.3 and Later)

domenica 31 gennaio 2016

Apple AirPort Utility 5.6.1 on El Capitan

I have an "ancient" :-) but still working AirPort Extreme (mod. A1034).
The latest AirPort Utility included with El Capitan, can see my AirPort Extreme base station but cannot manage it.
The latest version of AirPort Utility be able to configure the A1034 model is 5.6.1 still available on Apple Support site at this link https://support.apple.com/kb/DL1536 but, is not working on El Capitan (or is it?).

Well, it turned out that AirPort Utility 5.6.1 can also run on El Capitan despite its icon's prohibition sign


Follow along this guide to know how.

First of all, you need to download the Apple AirPort Utility from the link above, plus this little Apple Script utility, AirPort Utility 5.6.1 Launcher, by Corey J. Mahler from his site here.

  • Create a new folder on the desktop. For this example I'll name it Foo.
  • Double click AirPortUtility.dmg downloaded from Apple support site
  • Open Terminal and issue the following commands


cd ~/Desktop/Foo
xar -xf /Volumes/AirPortUtility/AirPortUtility.pkg
cat AirPortUtility.pkg/Payload | gunzip -dc | cpio -i

Open the Foo folder and rename Utility AirPort as AirPort Utility 5.6.1


The last step is very important, otherwise Mahler's Script does not work.

  • Create another folder on the desktop, in my example AirPortUtil561
  • Move AirPort Utility 5.6.1 and AirPort-Utility-5.6.1-Launcher.app_.zip inside AirPortUtil561
  • Open folder AirPortUtil561
  • Double click AirPort-Utility-5.6.1-Launcher.app_.zip
  • Trash AirPort-Utility-5.6.1-Launcher.app_.zip
  • Trash the desktop Foo folder

The final result in AirPortUtil561 folder is


Double click AirPort Utility 5.6.1 Launcher to start the old AirPort Utility 5.6.1

*** Enjoy

You can put AirPortUtil561 wherever you want as long as you include the two items above.
I tested this on El Capitan but should also work on Yosemite and Mavericks.

*** Dismiss the warning about a new AirPort Utility version when the program launches.

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.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

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

dontdisplaylastusername

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.
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.
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 com.apple.access_ftp

The password asked is admin's password. The command above add (-a) the user example to the group com.apple.access_ftp 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 com.apple.access_ftp group issue

dseditgroup -o edit -u admin -d example com.apple.access_ftp

 Addendum 

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/Preview.app/Contents/MacOS/Preview -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 com.apple.Preview AppleLanguages '("es")'

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

defaults delete com.apple.Preview 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

/dev/disk0
   #:            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.

domenica 16 dicembre 2012

FAT32 is not fat enough

FAT32 is making its days.

If you frequently exchange data between Windows and Mac you should be aware of a relatively new file system called exFAT that extends FAT32 features.
As many of you know, NTFS would be the best choice but OS X cannot natively write on NTFS formatted volumes.

Windows prerequisites: Windows Vista onwards

Windows XP with this update Update for Windows XP (KB955704)

Mac OS prerequisites: OS X 10.6.5 onwards

More in depth explanation and links on exFAT from Microsoft knowledge base

In OS X use Disk Utility to format an external drive as exFAT.




domenica 27 maggio 2012

IE8 misbehaves on virtualized Windows XP SP3 inside Virtual PC 7.0.2

A few months ago I subscribed to Microsoft TechNet Standard.

Today I installed Microsoft Virtual PC 7.0.2 onto my glorious PowerBook G4 1.67 GHz/1.5 GB, to test Windows XP Professional SP3.

The installation took quite a long time but in the end all went fine. Running XP on a PowerPC G4 is not the fastest experience, but acceptable anyway.

Next step, I updated Internet Explorer from version 6 to version 8.

I run IE8-WindowsXP-x86-ENU.exe, restarted the virtual machine, launched IE8, went along the first time run questionnaire. I don't like automatic updates, so I opted for not to let the system check for updates for IE.

Everything was in place. Time to test internet sites. I typed in the first URL that came to mind, hit return and waited for the page to load. I could see, on the status bar, the loading page progress, but I got nothing but a blank page. Tried a couple of other URLs. Same results.

What I discovered after some Google searches was that, I wasn't alone.
At first, the only resolutive suggestion I found was to uninstall IE8 and install IE7. I didn't like the idea. Tried harder and I came across this MacWindows.com post.

Now I knew that an IE patch would have fixed the issue. But which one?
Back to Google search engine I entered "Cumulative IE8 updates" into the search box. As expected, I got in return a plethora of links. I went for the first one in the list 


and, YES, that did the trick :-)

domenica 8 gennaio 2012

Preventing iTunes to automatically backup your iDevice

I don't know about you, but I get very annoyed when I have to wait for iTunes to finish the backup of my iPhone or iPad. There is no option in iTunes to disable automatic backup.
Follow along this post explain how to accomplish that.

  • Quit iTunes
  • Open Terminal
  • Type or copy and paste the line below

defaults write com.apple.iTunes AutomaticDeviceBackupsDisabled -bool true

That prevent backup to happen, but allows you to manually do it at your own will 'ctrl clicking' the device icon, like in the picture


To revert the original backup behavior

defaults write com.apple.iTunes AutomaticDeviceBackupsDisabled -bool false

or completely get rid of the key AutomaticDeviceBackupsDisabled added with defaults write

defaults delete com.apple.iTunes AutomaticDeviceBackupsDisabled

What about if you don't even want to be able to perform a manual backup?

defaults write com.apple.iTunes DeviceBackupsDisabled -bool true

To revert the original backup behavior

defaults write com.apple.iTunes DeviceBackupsDisabled -bool false

or completely get rid of the key DeviceBackupsDisabled added with defaults write

defaults delete com.apple.iTunes DeviceBackupsDisabled


Footnote
I tested this hack on a Macintosh with iTunes 10.5.2 and worked as expected with iPhone 4, iPad and iPad2.

venerdì 4 novembre 2011

Enable FTP service in OS X Lion, Mountain Lion, Mavericks, Yosemite, El Capitan


Beginning with OS X Lion (client), Apple removed in System Preferences,  the option to activate the FTP server.
Fortunately the daemon is still there, just dormant.

To wake it up launch Terminal and type

sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist

You can disable FTP anytime typing the following command

sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist

mercoledì 1 giugno 2011

Enable Administrator in Windows 7, 8, 8.1

To enable the Administrator account, the quickest way is running a Command Prompt session with Run as administrator

At the prompt type

net user administrator /active:yes

At this point it is recommended to assign a good password.

To disable the Administrator account

net user administrator /active:no

venerdì 21 gennaio 2011

Cables. Who cares?

A few days ago I was struggling with a desktop multifunction Samsung printer.

Everything was fine except, the scanner.

The MFP was hooked up to a PC with a USB cable.
Whenever I tried to scan a document, an error panel appeard saying Hardware I/0 error.
I removed and downloaded the latest drivers from Samsung support site without luck.

Changing the USB cable with a new, good shielded, not too long one, removed the impediment.

PowerMac G5 DP using one processor

Suddenly a PowerMac G5 Dual Processor started having kernel panic after a few minutes from start up.

It turned out that one of the two processors was faulty.

A Google search reported that in a DP PowerMac, if the first processor is damaged, usually the computer does not even boot up.

While, if it is the second, it shows the behavior I experienced.

I was able to circumvent the problem leaving the processor in its place.

To do so, you must enter Open Firmware.
Immediately after the startup sound, press and hold the key combination Command-Option-O-F
Release the keys when you see a white screen that says "Welcome to Open Firmware."

At the prompt type

setenv boot-args cpus=1

and hit return. If the syntax was correct you got an OK result.
Now type

mac-boot

hit return and the operating system boots.
I tested the reliability of the new mono PowerMac :-) by running Grapher, find the program inside Utilities folder, with a few windows drawing 3D animations for more than two hours and no crash at all.

Beware! Reissue the Open Firmware procedure if you reset PRAM