Ramblings Of a Madman

Yeah, like i would know a good description…

Posts for Tag: findings

Nice tweaks for OSX

I think most of them work on both Snow Leopard and Lion. Not sure about previous versions. Just type the ones you want to activate/deactivate on the command line and have fun. # Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) defaults write NSGlobalDomain AppleKeyboardUIMode -int 3

# Enable the 2D Dock defaults write com.apple.dock no-glass -bool true

# Disable menu bar transparency defaults write -g AppleEnableMenuBarTransparency -bool false

# Expand save panel by default defaults write -g NSNavPanelExpandedStateForSaveMode -bool true

# Expand print panel by default defaults write -g PMPrintingExpandedStateForPrint -bool true

# Disable shadow in screenshots defaults write com.apple.screencapture disable-shadow -bool true

# Enable highlight hover effect for the grid view of a stack (Dock) defaults write com.apple.dock mouse-over-hilte-stack -bool true

# Enable spring loading for all Dock items defaults write enable-spring-load-actions-on-all-items -bool true

# Disable press-and-hold for keys in favor of key repeat defaults write -g ApplePressAndHoldEnabled -bool false

# Disable auto-correct defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

# Disable window animations defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

# Disable disk image verification defaults write com.apple.frameworks.diskimages skip-verify -bool true defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true

# Automatically open a new Finder window when a volume is mounted defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true

# Avoid creating .DS_Store files on network volumes defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

# Disable Safari's thumbnail cache for History and Top Sites defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2

# Enable Safari's debug menu defaults write com.apple.Safari IncludeDebugMenu -bool true

# Remove useless icons from Safari's bookmarks bar defaults write com.apple.Safari ProxiesInBookmarksBar "()"

# Disable send and reply animations in Mail.app defaults write com.apple.Mail DisableReplyAnimations -bool true defaults write com.apple.Mail DisableSendAnimations -bool true

# Disable Resume system-wide defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false

# Enable Dashboard dev mode (allows keeping widgets on the desktop) defaults write com.apple.dashboard devmode -bool true

# Reset Launchpad rm ~/Library/Application\ Support/Dock/*.db

# Show the ~/Library folder chflags nohidden ~/Library

# Disable local Time Machine backups sudo tmutil disablelocal

# Kill affected applications for app in Safari Finder Dock Mail; do killall "$app"; done

# Fix for the ancient UTF-8 bug in QuickLook (http://mths.be/bbo) echo "0x08000100:0" > ~/.CFUserTextEncoding The original source can be found here.

Browser and visitor statistics

Was just now looking at google analytics for my blog and got some surprises, especially when it comes to the browser people use to access it. Seems that Chrome is leading and Internet Explorer is dead. Long live Internet Explorer :D

[caption id="attachment_1427" align="alignnone" width="300" caption="Browser usage"][/caption]

Also, very interesting is the fact that i'm Portuguese and Portugal is not on the top visitors' countries list. Special thanks to my followers in India, you know who you are :)

[caption id="attachment_1426" align="alignnone" width="300" caption="Language"][/caption]

UPDATE: As requested by a friend of mine, here are some more statistics: Top sources and keywords.

[caption id="attachment_1431" align="alignnone" width="300" caption="Top sources chart"][/caption]

[caption id="attachment_1430" align="alignnone" width="300" caption="Top sources list"][/caption]

[caption id="attachment_1429" align="alignnone" width="300" caption="Top keywords"][/caption]

Peace out ;)

200 skydives and a long way to go

This Saturday - while coming back from the dropzone - i noticed that my last jump of the day had been my 200th. After realizing it, i started thinking about what it means and came to the conclusion that it means nothing. Think about it: that's only about 3 hours of training (each skydive is around 1 minute), diluted across endless times of waiting to jump. Now, in any other sport, you can easily practice much more frequently and more at a time. And you would still be far, far away from becoming a pro. Hell, even people with 30 hours of skydiving time would not be considered even remotely close to pro in any other sport, since it takes much more than that to master anything.

So, while it does make me feel good to have achieved almost half of one of my current skydiving goals (becoming an instructor) and fully accomplishing another one (have enough jumps to start practicing wingsuit flying) i have to conclude that there is still a loooong way to go to achieve perfection. In the meantime, one tries to have fun walking the path ;)

Blue skies.

[vimeo clip_id="25967294" width="500" height="380"]

OSX- Change time machine auto backup interval

The default time machine backup interval is every hour. Sometimes this can be really annoying so, if you find yourself in need to change this, here's how:

Navigate to /System/Library/LaunchDaemons and locate the file named com.apple.backupd-auto.plist.

Inside this file you will find the following content: <key>StartInterval</key> <integer>3600</integer> 3600 means hourly (60 minutes X 60 seconds). If you multiply by 4, for instance, and use that value (14400) you will have automatic backups every 4 hours instead. Or whatever interval you prefer. Happy backing up :)

NonUniqueObjectException- a different object with the same identifier value was already associated with the session

If you are developing in Swing and using hibernate you might - at some point in time - run into this exception: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session

What happened, you might ask? Well, turns out that when you close the session that created a given hibernate-managed object, this object becomes "detached" (meaning hibernate no longer has any control over it). So, when you attempt to save or update it in another session, hibernate will complain with that exception, because it can no longer tell which is the "true" version of the object.

The solution(s)? Look inside your code for places where you might be closing the session and take that out. That's the solution in the case where you are using a long session (one that spans the entirety of the application's life). In case you really want to close the session, you might consider using the session's merge() method, which basically merges the fields in both the attached and non-attached instances of the object, and performs an update.

Hope that saves someone half a day of debugging ;)

Is Bin Laden dead? I'll believe it when i see it.

Are you kidding me? His body buried in the sea? This is the most wanted person in the history of the world and they don't bring back the body to prove - without a shadow of a doubt - that he is truly dead? Give me a break.

I'll believe he is gone when i see a body, no matter what Obama says.

Pooping- you're doing it wrong

Ever found yourself sitting  in the toilet and, when it's that time to do some pushing, instinctively getting on your toes to help the process? Well, it turns out that there is a reason for that: Humans have an easier time pooping in a crouching position. So when you get on your toes you are just getting closer to that shape.

And - as it turns out - there are 6 other things we might be doing wrong all our lives. Live and learn :)

The guy that took one picture of himself for 6 years

Remember Noah Kalina, the guy who took a picture of his face for 6 and a half years? Well, he still continues to do it. I'm guessing he wants to have a complete record of what he looked like through all his life.

In his website you can see all the photos, by year. It's incredible that you can easily tell in which ones he was sick, just judging by his face :)

I really admire his strength of will, to be able to carry on with his project :)

Mitochondria regeneration method found. Wanna live forever?

Scientists have found a compound that creates new Mitochondria structures inside aging cells. This can lead to the reversal of cellular aging, the main reason why you die :)

As we age, our tissues' mitochondria start to get damaged (you can think of it as the tail of a long chord, that gets ripped progressively as you drag it through the floor). A 90 year old man's muscle tissue will have around 95% damaged mitochondria, as opposed to no damaged at all in a little kid. If we can stop this process, we might live forever :)

More technical juice in the original article.

Using Dropbox to automatically download torrents

Need to be able to remotely add torrents to your secure machine at home? Don't want to expose any ports to the world in order to accomplish that?

Solution: Use Dropbox and uTorrent.

How? Setup uTorrent to automatically download any torrent files found in your Dropbox folder (like the picture says). After that, any torrent files that you put in Dropbox - from any computer where you set it up - will begin to be downloaded. Oh, the joy :)