Archive

Articles taggués ‘Apple’

How to resize a VirtualBox 4+ hard disk (.vdi), the easy way [quick tip]

22/01/2022 Aucun commentaire

Source: WebUpd8.org

VirtualBox 4.0 got a very cool new feature that allows you to easily resize a hard disk in just a few seconds. Previously, you had to install Gparted to do this and the procedure was quite slow.

In VirtualBox 4.0+ (see how to install VirtualBox 4.0.x in Ubuntu), to resize a VirtualBox hard disk image (.VDI) firstly locate the folder where the .vdi you want to resize is located – this should be under ~/VirtualBox VMs or ~/.VirtualBox/HardDisks. Then open a terminal, navigate to that folder (“cd /FOLDER/PATH”) and run the following command to resize the .VDI:

VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB
Where YOUR_HARD_DISK.vdi is the VirtualBox hard disk you want to resize and SIZE_IN_MB is the new virtual hard disk size, in megabytes. For example, the following command will resize the VirtualBox hard disk called “natty.vdi” to 12000 megabytes:
VBoxManage modifyhd natty.vdi --resize 12000
That’s it! The process takes just a few seconds and you should now have a resized VirtualBox hard disk.

 

Monitor Network Connections in Mac OS X for Free with Private Eye

20/01/2022 Aucun commentaire

Source: OSXdaily

Private Eye is a free real-time network monitor app for Mac OS X that is extremely easy to use. Upon launching the app, you’ll start to see all open network connections by application and process, and you can then filter connections by app, monitor all open connections, or watch only incoming or outgoing transfer.

private-eye-network-connection-monitor-mac

Connections are reported by application, the time of the connection, and arguably the most useful, the IP address that is being connected to by the app, making it easy to see socket and routing data, letting you know exactly what app is communicating with what server or IP address, for both local and broader internet networks. If you have any interest in networking, privacy, security, or you just want to keep an eye on what apps are connecting to the internet and to where, you should download this app, but it’s also an amazingly useful tool for troubleshooting network problems and figuring out what is using the network.

 

Download and install Private Eye by putting it into your /Applications/ folder, then open PrivateEye to get started. The list of open network connections is easy to read, you’ll see a time stamp of the connection, the application name, and where the connection is going to by IP (or coming from, as determined by the arrow pointing left for in, or right for out).

private-eye-connections

Using the left side menu you can quickly break down connections to see them all, only show incoming transfers, outgoing connections, or display connections by specific application only. Apps are easy to identify in this list, as are daemons running in the background (like PubSubAgent), and command line processes belonging to the user are also visible (ssh, for example).

This is a simple yet powerful tool without the complexity or the learning curves related to compiling and using the command line tools lsof, watch, open_ports, or wireshark, and is therefore highly recommended for anyone who is interested in seeing this kind of information, whether it’s out of general curiosity, or to help troubleshoot and diagnose specific network activities.

Fixing Mac OSX File Permissions and ACLs From the Command Line

18/01/2022 Aucun commentaire

Recently the hard drive in my mac mini running Mac OSX Leopard (10.5) failed. Luckily I had time machine backing it up to an external USB disk. Now, since I had to replace the drive and rebuild my system anyway I figured, why not upgrade to Snow Leopard? Planning to just pull what I needed off the backup drive manually I went ahead with the upgrade. There aren’t too many files on this machine that I depend on. Just some ssh keys, gpg keys and random documents scattered about here and there. So I upgraded, installed my apps and copied my files from the backup. Everything was going smoothly until I tried to actually write to one of the files I copied from the backup drive. This is when I started getting permission errors.

Here’s what happened when I tried to update my ssh known_hosts file:

airbag:~ keith$ echo foo > .ssh/known_hosts 
-bash: .ssh/known_hosts: Permission denied

Huh? But I own this file…dont I?

airbag:~ keith$ id
uid=501(keith) gid=20(staff) groups=20(staff),402(com.apple.sharepoint.group.1),204(_developer),100(_lpoperator),98(_lpadmin),81(_appserveradm),80(admin),79(_appserverusr),61(localaccounts),12(everyone),401(com.apple.access_screensharing)

airbag:~ keith$ ls -al .ssh/known_hosts 
-rw-r--r--@ 1 keith 502 56140 Mar 25 2009 .ssh/known_hosts
I do own it… And so began much head scratching and man page reading.

Well, as it turns out I forgot to look at the file ACLs…

airbag:~ keith$ ls -le .ssh/known_hosts 
-rw-r--r--@ 1 keith 502 56140 Mar 25 2009 .ssh/known_hosts
 0: group:everyone deny write,delete,append,writeattr,writeextattr,chown

Well no wonder, the ACL is set to deny write,delete,append,writeattr,writeextattr and chown from everyone! Let’s get rid of that.

airbag:~ keith$ sudo chmod -N .ssh/known_hosts 
Password:

That ought to do it. The -N flag says get rid of all the ACL info on the file. You could also update this to be just right for your user or group but I’d rather use only the standard unix permissions.

airbag:~ keith$ ls -le .ssh/known_hosts 
-rw-r--r--@ 1 keith 502 56140 Mar 25 2009 .ssh/known_hosts

Seems to have removed all ACLs from the file. I wonder if we can write to it now…

airbag:~ keith$ echo foo >> .ssh/known_hosts 
airbag:~ keith$

And there you have it, the file is writable once again. Now its time to get some real work done!

Categories: Système Tags: , , , ,

Change & Set the Default crontab Editor

17/01/2022 Aucun commentaire


Most hardcore command line users and unix geeks love vi, but I prefer nano. If you want to change your default crontab editor to nano, here’s how to do this:

For a one time edit, launch the terminal and type:

EDITOR=nano crontab -e

If you want to set nano as your default editor in general, you use this command:

export EDITOR=nano

Now when you go to edit crontab, nano will be the default editor than vi. You can test this by typing:

crontab -e

Looking beyond Mac OS X, this should work in Linux as well.

Categories: Système Tags: , , , ,

Fix "This device isn't eligible for the requested build" Error in iTunes When Updating iOS

14/01/2022 Aucun commentaire

Source: osxdaily.com

 

If you're trying to update iOS to the latest version on an iPhone, iPad, or iPod touch and you get an error in iTunes saying:

The iOS Device "Device Name" could not be updated. This device isn't eligible for the requested build.

device-isnt-eligible-errorYou're encountering one the following problems: either you are using an old version of iTunes, you are using an incorrect version of the firmware for your device, or you have gs.apple.com re-routed in your hosts file.

If you know you're on the right iTunes and iOS version and you're familiar with editing a hosts file, just throw # in front of the "74.208.10.249 gs.apple.com" entry and you'll be good to go. If you have no idea what that means, read on and it'll be explained easily. First let's cover the iTunes and firmware aspect, then explain hosts changes. Try these in order, one of them will certainly fix the ineligible build error:

(1) Update iTunes

This is easy, just open iTunes and update to the latest version. This is required because the newest version of iOS require the newest versions of iTunes. Easy to resolve.

(2) use Proper iOS Firmware

The next thing you need to do is make sure you're using the proper IPSW firmware file for your iOS hardware. You can download any firmware files from these links:

A fair amount of confusion regarding IPSW seems to be in the difference between GSM and CDMA downloads in the USA this is easiest to determine based on the cellular provider: AT & T is GSM, Verizon is CDMA. If you're not sure what to do with an IPSW file, you can read our walkthrough ofhow to use them.

If you're certain you have the correct firmware file and you're still getting the "device isn't eligible" iTunes error, it's almost certainly a result of gs.apple.com being blocked in the hosts file.

(2) remove the Hosts Block

This usually comes from users who have jailbroken an iOS device at some point on their computer, or did the error 3194 fix, and as a result have a line in their hosts file blocking Apple's servers. There's two ways to fix this, the first is the easiest:

Easy: Using TinyUmbrella
TinyUmbrella prevents you from having to use the Terminal to edit system files, instead you can just launch the app and quit it.

After you've downloaded and installed TinyUmbrella, here's how to use it to remove a hosts block:

  • Open TinyUmbrella and click on the 'Advanced' button tab at the bottom
  • Uncheck the box next to "Set Hosts to Cydia on Exit"

Remove Hosts block to fix Device isn't eligible error

Now quit out of TinyUmbrella and the app will modify the hosts file in the process to remove the block, allowing you to connect to Apple's servers again. Before you try though, be sure to turn the iPhone, iPad, or iPod touch on and off again, and relaunch iTunes as well.

If you still run into problems, you may need to flush the DNS cache as well. Quit out of iTunes and open the Terminal in OS X Lion, then type:
dscacheutil - flushcache
Now relaunch iTunes and you'll be good.

Advanced: Manually Editing Hosts

  • Quit out of iTunes
  • Go to the hosts file. For Mac OS X this is located at: / etc/hosts or/private/etc/hosts and in Windows it is located at: c:windowssystem32driversetchosts
  • Open the hosts file with Administrative privileges so that changes can be made and saved (eg: sudo nano/etc/hosts)
  • Look for a line that resembles something like this:

74.208.10.249 gs.apple.com

  • Put a # in front of that to how it out, making it now look like this:

# 74.208.10.249 gs.apple.com

  • Save the hosts file
  • Flush DNS cache and restart iTunes

Whichever approach you took, this fixed the "eligible build" error and the iOS device will update as intended.

Categories: Non classé Tags: , ,