Archive for the ‘ Apple ’ Category

Apple resume

Apple Lion’s new feature “resume” can be nice, but it can be very annoying.

Instead of disabling it for all applications, you can get used to close an application with <cmd>+<alt>+Q. Like this, the application starts clean again after a restart.

IPv6 Privacy Extensions on Apple Mac

IPv6 does not use NAT anymore. Everytime you connect to a website in the wild, wild Internet, you have the same IP address. NAT did hide this to some extent. Now with IPv6 you can enable privacy extensions. Apple does not automatically activate them, but it is no problem to activate them permanently.

In Terminal edit the file /etc/sysctl.conf

sudo vi /etc/sysctl.conf

Don’t worry if the file does not exist, and add the following line:

net.inet6.ip6.use_tempaddr=1

Reboot your Mac. Now your Mac generates at least with every restart a temporary address.

How to Flush DNS Cache on Apple Mac

Every Mac caches resolved DNS queries. Sometimes you get entries which create problems. To get rid of them you have to options: reboot the machine. This is the bad one. The good one is: Type the following command in the Terminal:

dscacheutil -flushcache

Connect to a serial console with a Mac

Most network devices still got a serial console. If you got a Mac and want to connect to this console, get yourself a Serial-to-USB converter that is supported by Apple. A good one is the Keyspan usa-19hs. After you installed the driver, plug in the USB serial Adapter.

Now you could search and download some Terminal Software. But it is much easier. Use screen. screen is already built in. You have nothing to compile, nothing to add, just use it like this:

screen /dev/tty.Keyserial1 9600

When you finished your work just close screen with “ctrl-a k“.

Reset MySQL root password

Sometimes you do not remember a password anymore. Like me just before. I cannot remember the root password of the one MySQL database. Well, that is not really a problem. You can easily recover it, if you got root access to the machine with the following steps:

  1. Log into the system as root
  2. Stop MySQL like
    /etc/init.d/mysql stop
  3. Create a file, e.g. /tmp/reset, with the following content:
    SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(‘MyNewPassword’);
  4. Execute the next command:
    mysqld_safe –init-file=/tmp/reset
  5. Restart MySQL:
    /etc/init.d/mysql restart
  6. Remove the temporary file:
    rm /tmp/reset