Skip to main content

How to detect Macbook open and close lid

I find this useful when tracing the time I spent in the computer or when I opened/closed my computer.

Find when you opened the lid:

$ tail -n 1000 /var/log/system.log | grep "Wake reason: EC.LidOpen (User)"


  • Replace 1000 with the number of lines you wish to backtrack
  • system.log might have already logrotated. gunzip if the past logs are already rotated:

$ ls /var/log/system.log*

Example: $ gunzip /var/log/system.log.0.gz

Find when you closed the lid:

$ tail -n 1000 /var/log/system.log | grep "messageType = 0xE0000280"

Example line:

Nov  1 15:37:07 My-MacBook-Pro kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000280

Comments

Popular posts from this blog

ld: unrecognized option '--hash-style=both'

gcc -Wl,-Map=contiki.map,-export-dynamic testv6.co obj_linux-native/socketdev_listener.o \ contiki-linux-native.a -o testv6.linux-native /usr/local/bin/ld: unrecognized option '--hash-style=both' /usr/local/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status If you look closely, the error is something related to the local gcc not using the host's linker (ld). $ which gcc /usr/bin/gcc $ which ld /usr/local/bin/ld For some reason, I messed my compiler path. To synchronized gcc to use the host's dynamic linker (i.e. /usr/bin/ld ), set the environment variable COMPILER_PATH to /usr/bin . $ export COMPILER_PATH=/usr/bin $ echo $COMPILER_PATH /usr/bin $ gcc -print-prog-name=ld /usr/bin/ld

Ubuntu on Intel D945GCLF (with Intel Atom)

The rig: D945GCLF board Intel Atom @ 1.6GHZ w/HT It looks like it's a linux kernel bug: http://www.gossamer-threads.com/lists/linux/kernel/982159 The ethernet controller is: Realtek Semiconductor Co., Ltd. RTL8101E PCI Express Fast Ethernet controller (rev ff) does not seem to work in any of the Ubuntu versions. Fix: recompile the kernel with patch You can download my patched packages here (currently uploading, let me know if something is missing): http://mirakulo.com/pub/linux-image-2.6.24-21-patched/ NOTE: I got the .udeb packages because of this warning: dpkg-gencontrol: warning: deb package with udeb specific field Kernel-Version or you can do the following steps if you don't trust me: apt-get source linux-source-2.6.24 apt-get build-dep linux-source-2.6.24 aptitude install install devscripts build-essential fakeroot cd linux-2.6.24/ Get this patch: http://bugzilla.kernel.org/attachment.cgi?id=17604&action=view patch -p 1 debuild -us -uc -b Install the kernel that...

Ebay scammer

+639056538210 09056538210 Gene Paminiano Claiming to be his wife: Ramona Carmen Paminiano City States savings account# 011-22-001124-3 TIP: Do not push with the transaction without hearing the seller/buyer's voice on the phone. Record the conversation for publicity purposes.