Monday, October 22, 2012

Deny NetBIOS

sudo ipfw add 1 deny tcp from any to any 137 out
sudo ipfw add 2 deny udp from any to any 137 out
sudo ipfw add 3 deny udp from any to any 138 out

Friday, October 19, 2012

Recover a corrupted zip

1) Copy archive to desktop.
2) Open terminal.
3) Type this without quotes "zip -FF ~/desktop/ --out ~/desktop/".
4) Is this a single-disk archive? (y/n): y.
5) Your new archive is created on the desktop.
6) In case the name is no coherent. Add .zip to produced file.
7) Uncompress new archive.

Secure Time Machine backup

In Terminal :

: ifconfig en0 | grep ether
: ether 00:00:00:00:00:00

Get name of your computer inside Sharing Preferences :

: Mac


Open disk utility :

1) Create a new empty image.
2) Save as Mac_000000000000 inside Time Machine hard drive.
3) Name : Mac.
4) Size : As you wish.
5) Format : Mac OS Extended (Journaled).
5) Encryption 128 or 256bits.
6) Partition : Single partition - Apple Partition Map.
7) Image format : sparse bundle disk image.
8) You are asked to enter a secure password.

: Drag and drop secure password from login to system.
: Inside Time Machine Preferences select Time Machine hard drive containing the new secure empty image.

Delete a Certification Authority from Keychains

1)Backup Certificates.

sudo cp /System/Library/Keychains/SystemRootCertificates.keychain /System/Library/Keychains/SystemRootCertificates.keychain.bak

2)Extract "SHA1" from the specific Certificate.
3)Delete Certificate.

sudo security delete-certificate -Z "SHA1" /System/Library/Keychains/SystemRootCertificates.keychain

Thursday, October 18, 2012

Disable AirDrop

To disable AirDrop :

defaults write DisableAirDrop -boolean YES

To enable AirDrop :

defaults write DisableAirDrop -boolean NO