Category Archives: Tips & Tricks
#VMware Fusion : Fix Ubuntu Linux “Host SMBus controller not enabled!” [UPDATED]
Ubuntu guest instances in VMware sometimes come up with the boot error message:
piix4_smbus 0000:00:007.3: Host SMBus controller not enabled!
This error is being caused because VMware doesn’t actually provide that level interface for CPU access, but Ubuntu try to load the kernel module anyway.
How to fix it:
-
sudo nano /etc/modprobe.d/blacklist.conf
- add the line:
blacklist i2c-piix4
- reboot
NOTE: for older versions use blacklist i2c_piix4
instead.
NOTE: it works both in VMWare Fusion 5 and 6, and Ubuntu LTS 12.04 and 14.04
#WP7 : LG Optimus 7 Unlock + Interop Unlock + Root Tools
If you want install XAP files without a developer account you can do it by modifying some registry keys:
- First go to MFG and follow the path 7.Engineer Menu > 6.Other Settings > Edit Registry
- Set the following fields:
- Select ROOT_PATH: HKEY_LOCAL_MACHINE
- Input SUB_PATH: Comm\Security\LVMod
- Input KEY and Select data type: DeveloperUnlockState DWORD
- Input data: 1
- Click Set button
To avoid Zune undo to default settings:
- Go to MFG and follow the path 7.Engineer Menu > 6.Other Settings > Edit Registry
- Set the following fields:
- Select ROOT_PATH: HKEY_LOCAL_MACHINE
- Input SUB_PATH: Software\Microsoft\DeviceReg
- Input KEY and Select data type: PortalUrlProd DWORD
- Input data: leave this field empty
- Click Set button
- Go to MFG and follow the path 7.Engineer Menu > 6.Other Settings > Edit Registry
- Set the following fields:
- Select ROOT_PATH: HKEY_LOCAL_MACHINE
- Input SUB_PATH: Software\Microsoft\DeviceReg
- Input KEY and Select data type: PortalUrlInt DWORD
- Input data: leave this field empty
- Click Set button
From now on your device is unlocked in developer mode, but you cannot install homebrew apps that modify registry keys. You need Interop Unlock:
- Go to MFG and follow the path 7.Engineer Menu > 6.Other Settings > Edit Registry
- Set the following fields:
- Select ROOT_PATH: HKEY_LOCAL_MACHINE
- Input SUB_PATH: Software\Microsoft\DeviceReg\Install
- Input KEY and Select data type: MaxUnsignedApp DWORD
- Input data: 300
- Click Set button
NOTE1: if you want install very nasty apps then you need WP7 Root Tools.
NOTE2: Unlock & Interop Unlock works on WP7 Tango too.
NOTE3: to lock device again set DeveloperUnlockState to 0 (zero).
#MacOSX : Make your Mac a Wireless Network Bridge
Sometimes you need to extend wireless field; you can do it transforming your Mac as a Wireless Network Bridge.
Why your Mac? Maybe a new shining Mac Book Pro? Well, let’s say your city has been hit by a big earthquake, so you had to leave your house, but your wireless network still works. Mobile Network won’t work due to excessive overhead but you can still access internet to contact your friends and family. Sharing your internet connection give this chance also to many other people (this has been happened to me recently).
First you need a Switch or a Router or a Wireless Access Point and Ethernet cables.
Then:
- Connect your mac to your wireless network
- Connect Switch / Router / Wireless Access Point to Mac Ethernet port
- Go to System Preferences -> Sharing
- Check Internet Sharing
- Share your connection from: Wi-Fi
- To computers using: Ethernet and Bluetooth PAN
- Let DHCP enabled
NOTE: this way you can connect to internet while you can maintain a secure distance from damaged buildings.
#MacOSX : Subversion Server
You know, Mac OS X is a UNIX system based on FreeBSD, so you can do a lot of NERD things out of the box.
This time you will learn how to setup a Subversion Server:
- Open Terminal app
- Type:
mkdir -p /Library/Subversion/Repository
cd /Library/Subversion/Repository
svnadmin create myproject - Great! Now that you have created the first repository, you need to configure it; type:
vim /Library/Subversion/Repository/myproject/conf/svnserve.conf
You’ll see ### commented lines. The lines with the single “#” comment marks are the ones we need to edit. You’ll want to remove the comments (#) and customize these settings to suit your project’s needs:
- password-db : this specify text file that stores the usernames and passwords of authorized users for your repository. Unless otherwise specified, it will be assumed that this file is stored in your projects “conf” directory. When you create your repository a “passwd” file is created by default.
- realm : realm tells clients what they are connecting to. It’s recommended you customize this to something like <Project Name> Subversion Repository.
- anon-access : this directive indicates what anonymous users are allowed to do with your repository. You should set it to none.
- auth-access : determines what permission level authorized users will have. In almost every case this will be set to write.
- Now you must edit password-db file; you can add as many users to your repository(s) as you want. Add at least one user for yourself so that you can begin committing to your repository:
vim /Library/Subversion/Repository/myproject/conf/passwd
- Next you need to change permissions on the Repository directory so that svnserveis permitted to make changes to the files stored there:
sudo chown -R root:admin /Library/Subversion/Repository
sudo chmod -R ug+rwX,o= /Library/Subversion/Repository
- Start Subversion Server:
svnserve -d -r /Library/Subversion/Repository
- Check if it works:
cd
mkdir project
cd project
svn checkout --username <user> --password <user_password> svn://localhost/myproject
- If it works you should have myproject directory in Repository. Well Done.
NOTE1: /Library/Subversion/Repository
is just an appropriate example for Repository, but you can choose every other location.
NOTE2: in svnserve.conf and passwd files remove every white spaces at the beginning of non empty lines or it will not work.
NOTE3: if you want allow users to connect from internet you should set port forwarding on TCP port 3690 (svn default).
NOTE4: check Subversion Complete Reference for more info.
#MacOSX : Change Launchpad Background
If you do not like default background of Launchpad you can easily change it:
- Go to Launchpad
- Hit Ctrl + Alt + Cmd + B
- Hit more if you want
That’s All. 🙂
#MacOSX : Add Dock Spacing using OnyX
Onyx is a powerfull App which does a lot of things. You can tweak user interface too; what we want to do is adding invisible spaces in the dock.
- Start Onyx and enter your administrator password
- Go to Parameters tab
- Choose Dock tab
- Click on the buttons at the bottom: Applications or Others
- OnyX will now reboot the Dock
This is how it look like:
#MacOSX [*NIX]: MAC Address Spoofing
MAC Address is a unique identifier of 48 bits assigned to network interfaces.
This Address is unique in the world, so it does identify you, everywhere.
From a Security & Privacy perspective this is not good at all!!!
How to modify it:
- Open Terminal app.
- Type:
sudo ifconfig [en0-en1] ether [MAC Address]
- where you can choose en0 for wired ethernet interface or en1 for airport interface
- MAC Address is something like FF:FF:FF:FF:FF:FF
where there are 6 groups of 2 exadecimal symbols separated by colons (:)
- Insert your Administrator password.
- Go to Network System Preferences, select active interface and push Advanced… button.
- In TCP/IP tab click on Renew DHCP Lease button.
- You should now see your new MAC Address in Hardware tab.
NOTE: you can set Configure: Manually in Hardware tab to manually set MAC Address and avoid using Terminal.
NOTE2: if you do not renew DHCP Lease you may loose network connectivity.
NOTE3: if you have set MAC Address through Terminal it will be restored to it own default after reboot or shutdown.
NOTE4: some Hotels or private Acces Point use MAC Filtering to prevent abuse of their network. The changing of MAC Address allow you circumviate this kind of restrictions (see MAC Spoofing). This is NOT legitimate, so if you are not an evil user and you need emergency network access, try to set your MAC Address to FF:FF:FF:FF:FF:FF (could not work of course). This way System Administrator will readily understand what is going on. 😉
#MacOSX : Display EDID [UPDATED]
EDID (Extended Display Identification Data) enables Mac OS X to know what kind of monitor is connected to it.
Why are we interested in it? If we know the exact model of LCD connected to our mac we can retrieve who is the manufacter of the panel (which often it is not the brand under the monitor is sold) and its properties (like response time, contrast and brightness) as Apple doesn’t specify they in its own products.
So here we go:
- Open Terminal app.
- Type (see this comment):
ioreg -lw0 | grep IODisplayEDID | sed "/[^<]*</s///" | xxd -p -r | strings -6
ioreg -lw0 -r -c "IODisplayConnect" -n "display0" -d 2 | grep IODisplayEDID | sed "/[^<]*</s///" | xxd -p -r | strings -6
- Second line is what we are looking for.
NOTE: if you are interested in how this work, you can type in Terminal (but be ready for a full NERD immersion):
man bash
man ioreg
man grep
man sed
man xxd
man strings
Don’t say i haven’t Warned you! 😀
#MacOSX : System Preferences Archives Pane
Mac OS X support zip & unzip files natively, but you can’t find how to configure it in System Preferences.
Archives Pane exists but it is not installed by default, so you must install it first:
- Go to (Shift-Command-G):
/System/Library/CoreServices/Archive Utility.app/Contents/Resources/
- Double-click on Archives.prefPane
- Insert your admin password
- From now on you have Archives pane in System Preferences
NOTE: it works on Mac OS X Lion, Snow Leopard and Leopard.
#MacOSX : Taking Screenshots
You will be surprised but even without stamp key on the keyboard you can take screenshots whitout 3rd party apps! 😀
There are several keyboard combinations that can be used to take screenshots in Mac OS X. The SystemUIServer process handles these commands.
- Command-Shift-3: take a screenshot of the screen, and save it as a file on the desktop.
- Command-Shift-4, then select an area: take a screenshot of an area and save it as a file on the desktop.
- Command-Shift-4, then space, then click a window: take a screenshot of a window and save it as a file on the desktop.
- Command-Control-Shift-3: take a screenshot of the screen, and save it to the clipboard.
- Command-Control-Shift-4, then select an area: take a screenshot of an area and save it to the clipboard.
- Command-Control-Shift-4, then space, then click a window: take a screenshot of a window and save it to the clipboar.
From Mac OS X Leopard and later, the following keys can be held down while selecting an area (via Command-Shift-4 or Command-Control-Shift-4):
- Space: to lock the size of the selected region and instead move it when the mouse moves.
- Shift: to resize only one edge of the selected region.
- Option: to resize the selected region with its center as the anchor point.
NOTE: different versions of Mac OS X have different formats for screenshots.
NOTE2: in Mac OS X 10.4 and later, the default screenshot format can be changed, by opening Terminal app and typing :
defaults write com.apple.screencapture type image_format
killall SystemUIServer
Where image_format is one of jpg, tiff, pdf, png, bmp or pict (among others). If you omit the second line, you will need to log out and in again for the change to take effect.
#MacOSX : Quick Look
Quick Look is a powerfull feature of Mac OS X which is activated when hitting space after file(s) selection; let’s see why:
- Multiformat Support: can open an amusing number of file format including, but not limited to:
PDFs, HTML, QuickTime readable media, plain text and RTF text documents, Apple Keynote, Pages and Numbers, ODF documents, Microsoft Word, Excel, and PowerPoint files (including OOXML), RAW camera images. - Plugins: support for additional formats can be achieved via use of 3rd party plug-ins.
- Index Sheet: if you select multiple files before activating Quick Look, you’ll just be shown a preview of the first file. Clicking Index Sheet is just like using exposé, only with the previews rather than windows.
- Slideshow Mode: when using Quick Look on multiple images, there is a play button at the bottom to start a slideshow.
- Zooming: if you activate Quick Look on an image, hold down the Option key and you will notice that the cursor changes to a magnifying glass. Now, using the scroll wheel you can zoom in and out.
- Keyboard Navigation: while you are previewing a file with Quick Look, you can still use the keyboard to navigate to other files. In column view this is easily done with the arrow keys. In the other views, use Cmd-DOWN and Cmd-UP to go into and out of folders.
- Trashed Files: can preview trashed files without moving them out.
NOTE1: Quick Look has been introduced in Mac OS X Leopard and it is still present in Mac OS X Lion.
NOTE2: Quick Look is just enough to prefer Mac OS X over Windows! 😛
#MacOSX : Disable Hibernation & SSD Tweaks
SSD are based on NAND Flash which have limited writes life. Currently 25nm chips support 3000-5000 cycles then they become read only.
This limitation makes very important avoid unneeded writes on the disk.
Moreover power save technologies can give some trouble (of course on SandForce controllers).
So this are some steps to Tweak your host system to give you the best experience:
- Turn off hibernation. To do this, open terminal app and type:
sudo pmset -a hibernatemode 0
Enter admin password and let’s do it the magic.
This will prevent GB of writes every time you close the lid of your notebook. - Remove unused hibernation file to free up as much space as your RAM:
sudo rm /var/vm/sleepimage
- Open System Preferences and go to Energy Saver, than uncheck
Put the hard disk(s) to sleep when possible
both on Battery and Power Adapter tabs.
This will prevent disk freezes and beachballs. - If you have a SATA 2 interface and a Nvidia chipset on your Mac, check to have 3 Gbps Negotiated Link Speed.
Go to Serial-ATA section in System Information app to take a look of your disk(s).
This will ensure optimal performance of SSD.
NOTE: there are more Hacks, like enabling TRIM for non Apple supported SSDs but they give more troubles that other therefore I advice against to engage in similar enterprises.
NOTE 2: WARNING!!! Apple MacBook Air and MacBook Pro Update 2.0 seems to change the way “safesleep” is handled. If you currently have safesleep disabled in order to free up the drive space required by the sleep image, this will cause it to come back and even setting hibernatemode = 0
won’t change it. Quick untested FIX:
cd /var/vm
sudo rm sleepimage
sudo ln -s /dev/null sleepimage
#WP7 : Enable Hidden MFG Menu
This hidden menu will give you super NERD power so, here we go!!! 😀
- Open telephone and call ##634#.
- MFG use a password to enter in secret menu. Type 277634#*# and click ENTER.
- Enjoy and remember: “From great Power comes great Responsibilities”.
NOTE: you don’t need this steps every time, from now on you’ll have a MFG app in the list! 😉
#WP7 Connector: ERROR 8000ffff
You have a Mac.
You have WP7 Connector 2.0.1 or above.
You can’t check for updates because it fails with such error…doh! 😦
Don’t worry!!!
- Turn on wifi
- Shut down the phone (with WiFi ON)
- Power on the phone (insert PIN if needed)
- Reconnect to WP7 Connector and check for updates, it should work now 😉