rss
email
twitter
facebook

iops OSX check

To determine the number of IOPS being utilized by Mac OS X, proceed with opening the Terminal App from / Applications / Utilities. Then proceed to type the following commands:
  • mount
    • This will determine which disk to get the IOPS data on, in this example, since I want to view the IOPS on the iSCSI Target, the disk target name is /dev/disk1s2
  • iostat –d disk1 1
    • “iostat” is the name of the program used to gather IOPS data
    • “-d” will display device utilization
    • “disk1″ is the disk that is to be examined
    • “1” is the interval, meaning, report every 1 second

KNOW YOUR INTERNET BROWSER SHORTCUTS

There are dozens of different shortcut keys that can be used with Internet browsers. Below are a few of our top suggested Internet browser shortcuts.
- Pressing Alt + D in any major Internet browser will move the cursor into the address bar. This is a great way to quickly enter an Internet address without having to click the mouse cursor in the address bar.
- Hold down the Ctrl key and press the + or - to increase and decrease the size of text.
- Press the backspace key or hold down the Alt key + left arrow to go back a page.
- Press F5 to refresh or reload a web page.
- Press F11 to make the Internet browser screen full screen. Press F11 again to return back to the normal view.
- Press Ctrl + B to open your Internet bookmarks.
- Press Ctrl + F to open the find box in the browser to search for text within the web page you're looking at.

WINDOWS KEY AND THE ARROW KEYS


729-windows-key-wallpaper-1600x1200-customity.jpg
Pressing the Windows key and Left or Right arrow keys will dock the window your viewing to the left or right-hand side of the screen. Pressing the Windows key and the Up arrow will maximize a window and pressing the Windows key and the Down arrow will resize and then minimize the window.
Use Shift: To stretch a window vertically, press the Windows key + Shift + the Up arrow. If you have multiple monitors use the Windows key + Shift + the Left or Right arrow keys to move the window to another monitor.

BOOT EFI MEDIA

if your system has an EFI she'll and you want to boot from a shell to attached media, here is how.
1: Make sure the media with. EFI compatible OS is connected  to the system.
image.jpg
2: Boot to a EFI shell
3: # map -r (this will remap and display all attached media) 
4:  change location to the drive that contains your target OS. This ca be done by typing the name and partition number of the required mount. For example; # FS0: 
5: # ls to see the directory's contents
6: # cd to /EFI/boot  
7: this directory will contain 1 or more boot.efi files. Run the version you need by typing its name and extension 
TIP: EFI shells support tab completion 

MacBook Air Recovery

How to Restore a MacBook

There are lots of reasons to restore a laptop. The sale of a system, a fresh start, or the recovery from a Hard Drive issue, to name a few.

Macs running OS X Lion and newer versions of OS X include a recovery mode boot-up option. You can boot into the recovery environment, also known as “Lion Recovery,” by using a special key combination while your Mac is booting up. You can restore your MacBook Air to its factory default state using this mode; the MacBook Air downloads the required data from Apple and reinstalls Mac OS X on your computer. You can also restore your Mac from a Time Machine backup.

Step 1: Enter recovery Mode

Press the “Command” and “R” keys on your keyboard at the same time and hold them down until the Apple logo appears. A “Mac OS X Utilities” window appears after the Apple logo. If you don’t see the window, try restarting your MacBook Air and pressing the “Command” and “R” keys earlier in the boot process.

Step 2: Wifi

Connect to a wireless network by clicking the “Wi-Fi” icon at the top-right corner of your screen, selecting your wireless network and providing its password.

Step 3: Install

Click “Reinstall Mac OS X” in the Mac OS X Utilities window and click “Continue.”

Step 4: Choose your drive

Select your Mac’s internal hard drive by clicking it in the list that appears and click “Install.”

Step 6: Authenticate

Type your Apple ID and password for the Mac App Store into the boxes to confirm your eligibility. Your Mac downloads about 4 gigabytes of data from the Internet and restores Mac OS X to its original state.



If you do not see your Drive

If your Mac's hard drive isn't visible during the installation process, you will need to format the hard drive. (WARNING: THIS WILL ERASE THE DRVE)

Step 1: Disk utility

If the Installer is running, quit it and exit to the OSX Utilities Screen. Click Disk Utilities. 

Step 2: Format Drive

Select your drive from the column on the left. Next select the Partition dutton on the right. Under Volume Scheme, choose One Partition, the hit the apply button in the bottom right.

Step 3: Continue the restore

When the partitioning is complete, quit disk utility, and continue your OS restore.




Internet recover w/out Recovery Partition

If your hard drive has had a serious issue, been improperly formatted, or is brand new, you might not have a recovery partition.



Step 1: Boot

Boot the system holding down command + R

Step 2: Wifi

When the system boots, the middle of the screen will have a dropdown that will allow you to connect to the internet wirelessly. Do so.

Step 3: Restore

Follow the prompts and the system will download and configure the recovery environment. 



How to import bookmarks from Chrome to Safari

  1. Select 'Bookmark Manager' in Chrome
  2. Click Organize
  3. Select 'Export Bookmarks'
  4. Select File/Import Bookmarks in Safari

Here is a Chrome page about it:


excuteable shell scripts in OSX

How do I make this file.sh executable via double click?:

By default, *.sh files are opened in a text editor (Xcode or TextEdit). To create a shell script that will execute in Terminal when you open it, name it with the “command” extension, e.g., file.command. By default, these are sent to Terminal, which will execute the file as a shell script.
You will also need to ensure the file is executable, e.g.:
chmod +x file.command

How to make a Mavericks ISO

I've found a number of websites with instructions on creating a bootable USB for installing Mavericks, but an ISO is much more useful in my ESXi environment. Of course there's a 101+ ways to do this, the only requirement for this solution is a command line. You'll of course need to adjust the paths if necessary/desired.


# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app

# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Mavericks

# Increase the sparse bundle capacity to accommodate the packages
hdiutil resize -size 8g /tmp/Mavericks.sparseimage

# Mount the sparse bundle for package addition
hdiutil attach /tmp/Mavericks.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build

# Remove Package link and replace with actual files
rm /Volumes/install_build/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/install_build/System/Installation/

# Unmount the installer image
hdiutil detach /Volumes/install_app

# Unmount the sparse bundle
hdiutil detach /Volumes/install_build

# Resize the partition in the sparse bundle to remove any free space
hdiutil resize -size `hdiutil resize -limits /tmp/Mavericks.sparseimage | tail -n 1 | awk '{ print $1 }'`b /tmp/Mavericks.sparseimage

# Convert the sparse bundle to ISO/CD master
hdiutil convert /tmp/Mavericks.sparseimage -format UDTO -o /tmp/Mavericks

# Remove the sparse bundle
rm /tmp/Mavericks.sparseimage

# Rename the ISO and move it to the desktop
mv /tmp/Mavericks.cdr ~/Desktop/Mavericks.iso

OSX: Disable Dashboard

Disabling dashboard will save wasted memory on your Mac.

Disable Dashboard: type the following into Terminal
defaults write com.apple.dashboard mcx-disabled -boolean YES
Reload the Dock:
killall Dock

Enabling Dashboard: type the following into Terminal
defaults write com.apple.dashboard mcx-disabled -boolean NO
Reload the Dock:
killall Dock


Linux: List specific hardware components

Situation: You would like to list all the installed hardware of a specific type in your computer.

Solution: lspci | grep -i Keyword

Examples:
1) lspci | grep -i Intel
2) lspci | grep -i Ethernet
3) lspci | grep -i Apple

The lspci command will list out all the PCI based hardware components.
The grep command will filter the results based on the keyword you provide
The -i modifier tells grep to ignore upper and lower cases so ethernet and Ethernet are the same.

Infinite loop IO test

I needed to test a system's disk stability so I made this script. It will copy the contents from one HD to the HD in question infinitely.


while true
do
echo "Today's date is $(date)"
        dd if=/dev/sdc of=/dev/sda
done


When you are done, just quit out of it.




OSX: Listing Disks in Terminal


To list all mounted drives and their accompanying partitions from the Terminal, type the following:

diskutil list

Linux: no password for root

Here is now to setup root to have no password. This is NOT recommended for normal use systems.

1) $ cd /etc/
2) $ vi passwd
3) Remove "x" from the root line
4) :wq! to save and quit
5)$ pwconv

This will remove the root password, aka SUPER unsecure.

Linux: Disk Duplication

To make an EXACT copy of one disk to another is easy with the command $ DD. This command will do a block by block copy of one source to another, partitions and all.


Here is what you need to do:

1) $ fdisk -l to see your drives
2) $ dd if=/path_to_your_source_drive/ of=/path_to_your_target_drive/ bs=4096k
      if = input file
     of = output file
     bs = block size
                  example: $ dd if=/dev/sdb of=/dev/sdc bs=4096k

Fixed: Images not showing up in Gmail


When you open new messages, some images may not show, or have links rather than the pics. 
To view them do the following:
  1. Sign in to Gmail.
  2. Open the message.
  3. Click Display images below in the green box above your message. Or, if you'd like to always view images from a particular sender, click Always display images from sender@domain.com instead.

Internet Explorer users: Your browser1 settings may prevent images that are being sent through HTTP from being shown within messages.
You may need to adjust Internet Explorer's mixed content settings to view images sent through HTTP by following the steps below. Please note to be cautious of enabling displays of HTTP content, as some sites may have risky or malicious content that the browser setting is trying to protect you from.
  1. Access Internet Explorer's Tools menu.
  2. Select 'Internet Options' and click the 'Security' tab.
  3. Select 'Custom level.'
  4. In the 'Display mixed content' section, select the 'Prompt' radio button so you can make the choice on a case by case basis.
Next time Internet Explorer pops up the warning about mixed content, you can choose whether or not you want the content that wasn't delivered via HTTP to be displayed. Browsers like Mozilla Firefox and Google Chrome may default to not showing you a pop-up in these cases, but will put a warning icon in the browser window as a notification of the non-HTTPS content that the site may contain.

Linux: Add a user to the sudo list

  1. Launch a terminal with root access.
  2. Type visudo (to open and edit the list)
  3. Scroll to the bottom of the sudoers list.
  4. After the line reading: root ALL=(ALL) ALL,   Type: user ALL=(ALL) ALL (put the username for "user")
  5. Now press Ctrl+X and press Y when promted to save

How to boot to the CLI in Fedora 17

A few versions back, Fedora stopped using the initab file. Here is the new method to set Fedora 17 to boot to a CLI rather than a GUI.

1) Remove the default.target, run the following command
# rm -f /etc/systemd/system/default.target

2) Set the system to boot into CLI, run the following command
#  ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

3) Reboot

Linux: Manually Create Ethernet Ports

If you add a ethernet port to a Linux system and ifconfig doesn't show it, (ex: A usb ethernet device is plugged in ), this is how to create it by hand.

1) Connect the ethernet device.

2) In the CLI type lspci and look for your new device. you can use grep to narrow the list of devices
      EX:   # lspci | grep -i Ethernet

3) After you confirm its listed, cd to /etc/sysconfig/network-scripts and do a ls

4) cp  ifcfg-ethXX (where XX is the number of a network connect you want to clone) to ifcfg-eth?? (where ?? is the next number higher in the list of ifcg-eth's)

5) vi to your newly created ifcfg-eth?? file and remove the MAC and UUID lines.

6) Next rename the name of the port to match the file name then type :wq to write and quit.

7) at this point you can restart or type service network restart, then you are done.

How to change root's password using single user mode

If you somehow loose access to the root user you can quickly reset the password by rebooting to single user mode and running passwd. Here is how.

1) Reboot, and when GRUB is presenting the menu list (you might need to press ESC first), follow those instructions:
  • use the arrows to select the boot entry you want to modify.
  • press e to edit the entry
  • use the arrows to go to kernel line
  • press e to edit this entry
  • at the end of the line add the word single
  • press ESC to go back to the parent menu
  • press b to boot this kernel
2) You will now have root access. Type passwd and define a new root password.

3) Reboot and you are done.

Install Mountain Lion (OSX 10.8) on Multible Macs Without Buying Additional Copies

After you have purchased Mountain Lion in the Appstore 1 time, you get unlimited downloads and installs.

To install it on another computer the official way, simply create a new admin account on the computer and sign in to iTunes using an account that has already purchased Mountain Lion. Proceed with the install, then delete the created admin account when done.

SSH to your mac over iCloud

First you need to get your back to my mac account number. In terminal type the following:

dns-sd -E
 
The final nine digit number is your account number.

Make sure remote login is enabled in system prefs on the target computer.

To ssh in type the following:

ssh -2 -6 username@computer-name.[account number].members.btmm.icloud.com
  
If you don’t want to hard code your Back To My Mac address into your .ssh/config 
you can get it dynamically using this line:
echo show Setup:/Network/BackToMyMac | scutil | sed -n 's/.* : *\(.*\).$/\1/p'
 
Another way to SSH into another Mac using iCloud’s IPv6 network: in 
Terminal, choose ‘New Remote Connection’ from the Shell menu, or whack  +  + K. 

Broken SMB Sharing in Lion Server

I was not able to connect in any way form a windows XP box to a SMB (samba) share hosted on a 10.7 Server. /private/var/log/krb5kdc/kdc.log   showed the following:

2011-10-10T16:57:56 digest-request: init request
2011-10-10T16:57:56 digest-request: init return domain: BUILTIN server: IMGQA-DB
2011-10-10T16:57:56 digest-request: uid=0
2011-10-10T16:57:56 digest-request: user=IMGQA-DB\\qtqa
2011-10-10T16:57:56 NTLM domain not configured
2011-10-10T16:57:56 digest-request: kdc failed with 36150275 proto=unknown
2011-10-10T16:57:56 digest-request: guest failed with 22 proto=ntlmv1-with-v2-session

Here is the fix to this known bug:

sudo serveradmin stop smb

wait a few seconds

sudo serveradmin start smb

If you wish to scrip this you can do the following:

sudo su -
cd /System/Library/LaunchDaemons

cat > com.smb.restart_smb.plist <<@@EOF
    Label
    com.smb.restart_smb
    ProgramArguments
   
        /bin/bash
        -c
        sleep 60;serveradmin stop smb;sleep 5;serveradmin start smb
   
    RunAtLoad
   
@@EOF

launchctl load com.smb.restart_smb.plist

Enable debug mode in disk utillity


There're several reasons why you want to enable the debug mode in disk utility. The primary of which is to be able to see and manipulate all of the partitions currently installed on your drives.  Here's how you do it:

1. Open up terminal and type the following: sudo defaults write com.apple.DiskUtility DUDebugMenuEnabled 1

2. Restart Disk Utility if its open.

3. You now how the debug drop down menu


Keep in mind that editing hidden partitions may not be a good idea in most situations. The GUID partition scheme that OS X uses always will have a hidden 200MB "EFI" partition as the first partition on the drive (s1), which is used to manage the drive and its partitions in systems with EFI firmware (which is what all Intel Macs use). Beyond this, the OS X 10.7 Recovery partition is also required for managing the new version of FileVault, so if you edit this partition on a FileVault-enabled volume then you may break the encryption keys stored on it and not be able to boot your system or read any data from it.

Audible.com Files not syncing

I recently rebuilt my Mac and copied out my iTunes folder to an external and back onto the newly rebuilt computer.

 I didn't want to migrate my keychain db for more of a "clean slate" experience. Everything works great the only exception was I'm a huge consumer of audible.com audiobooks and they didn't want to sync to my iPhone anymore.

The message I was getting was my computer was not authorized to play these files so they would not sync my iPhone. The solution was easy, all you have to do is double-click on an audible file inside iTunes and it will prompt you to reenter your audible.com or now Amazon.com authentication credentials once that's done everything works.

Embedded system info in the background.


Here’s what you do:
  • Install GeekTool
  • Paste the following ruby code into a text file and save it somewhere like ~/scripts or ~/Library/Scripts as sys_info.rb:
@user = `whoami`
@system = `scutil --get ComputerName`
@ip = (`ifconfig en0 | grep netmask`).split
@vers = (`sw_vers | grep ProductVersion`).split
@hw_info = `system_profiler`
@up = (`uptime`).split(',')
if @vers[1].include?('10.5')
  @hw_name = 'Processor Name'
  @hw_speed = 'Processor Speed'
else
  @hw_name = 'CPU Type'
  @hw_speed = 'CPU Speed'
end
puts "User: #{@user}"
puts "Computer: #{@system}"
puts "IP: #{@ip[1]}"
puts "OS Version: #{@vers[1]}"
puts @hw_info.grep(/#{@hw_name}/).to_s.strip
puts @hw_info.grep(/#{@hw_speed}/)[0].to_s.strip
puts @hw_info.grep(/Memory:/)[0].to_s.strip
puts "Uptime: #{@up[0].strip}"

  • In the Command box, enter: ruby ~/scripts/sys_info.rb (change to your path and file name)Open the GeekTool preference pane and add a new entry. Select Shell from the pop-up menu.
  • Set the refresh for 300
  • Now you should see a box somewhere on your desktop and it should have 8 lines of juicy info.
  • Play with the other tabs to set the font style and background.
  • You can drag and resize the box to wherever you like.
I know this works on OS X Tiger and Leopard and it should work fine on Panther. BTW – GeekTool works great on Leopard.
If you have any suggestions, changes or additions to this, please share.

BGinfo

BGInfo is and awesome little goodie cooked by the guys over at Microsoft.
How many times have you walked up to a system in your office and needed to click through several diagnostic windows to remind yourself of important aspects of its configuration, such as its name, IP address, or operating system version? If you manage multiple computers you probably need BGInfo. It automatically displays relevant information about a Windows computer on the desktop's background, such as the computer name, IP address, service pack version, and more. You can edit any field as well as the font and background colors, and can place it in your startup folder so that it runs every boot, or even configure it to display as the background for the logon screen.
Because BGInfo simply writes a new desktop bitmap and exits, you don't have to worry about it consuming system resources or interfering with other applications.
The deploy I have of this is as follows:

BGInfo runs on a server. I use a .bat file placed in the all users startup folder, to remotely run the app. This way at login, your background is refreshed.

The .bat file contains the following:

@ECHO OFF
\\servername\sharename\BGInfoFolder\BGInfo.exe \\servername\sharename\BGInfoFolder\bginfo.bgi /timer:0 /NOLICPROMPT

When you configure BGInfo.exe with the options you want, it will save a .bgi file in the same folder. This is your config template, and changes you wish to make, do so by launching the .bgi with BGInfo.

How to create a Windows 8 installer on USB

Many netbooks and low-profile laptops are ditching the optical drive in favor of portability, which means that installing Windows 8 via a burned DVD is inconvenient at best. Luckily you can easily do it with an 8GB or larger USB stick.



  1. Download the USB creator from the Microsoft Store
  2. Pick your version of windows, 64, or 32 bit from Microsoft's Site
  3. Be sure to grab the product key from the same page
  4. Format your USB device to FAT32 (be sure you have at least 5 gigs free)
  5. Install and launch the USB creator
  6. Browse to the downloaded Win8.iso file, pick your USB device from the list and click start.

For a more in depth how to Ghacks have a good tutorial. The entire process should take 20 min, depending on your internet speed.

Enjoy!

Windows Driver locations



The Windows default driver storage folder is determined by the DevicePath value in the:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion 


registry key. This storage folder is usually WINDOWS\inf. 

Batch file rename script

Here is a script I put together to do batch file renames. Its written in Ruby and works on all platforms.

You can download it here


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

#Batch file rename/move script 

Dir.chdir '/Users/username/Pictures/'
# sets destination folder

pic_names = Dir['/Users/username/Downloads/*.{jpg,JPG}']
# sets source folder

puts 'What would you like to call this batch?'
batch_name = gets.chomp

puts
print'Downloading ' +pic_names.length.to_s+' files: '
# this is the counter. 

pic_number = 1

pic_names.each do |name|
  
  new_name = if pic_number <10
    batch_name + '0' + pic_number.to_s + '.jpg'
  else
    batch_name + pic_number.to_s + '.jpg'
  end
  
  if File.exist?(new_name) == false
    print ' .' # this is the progress bar
  else
    puts 'Error: ' + new_name + ' already exists'
    exit
  end

  File.rename name, new_name
# renames the pictures

  pic_number = pic_number +1
#counter increment

end

puts
puts 'Done bitches!

Script to convert .pages files to .pdf

Open Script Editor, copy the script into it, and save as an application.  Drag and drop files you want to convert onto the application icon.


Saves converted files to Desktop.


Open this Scriplet in your Editor:

on open theFiles
   tell application "Pages"
       repeat with aFile in theFiles
           open aFile
           set docName to name of front document
           -- Remove .pages extension.           set prevTIDs to AppleScript's text item delimiters
           set AppleScript's text item delimiters to ".pages"
           -- Add .pdf extension.           set docName to first text item of docName & ".pdf"
           set AppleScript's text item delimiters to prevTIDs
           -- Save file to Desktop.           set docPathAndName to (path to desktop as string) & docName
           save front document as "SLDocumentTypePDF" in docPathAndName
           close front document
       end repeat
   end tell
end open