Showing posts with label commandline. Show all posts
Showing posts with label commandline. Show all posts
Tuesday, July 2, 2013
OSX Cmd: Reschedule Time Machine Backups
If you want to change the interval of Time Machine backups simply enter the following command into your Terminal:
sudo defaults write/System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 1800
900 = 15 minutes
1800 = 30 minutes
3600 = 1 hour
Tuesday, April 9, 2013
OSX Cmd: Getting Rid of "Open With" duplicates
You right-click icon in the Finder, choose "Open With", and a submenu pops up with an absurd number of duplicate entries.
The duplicate entries in the "Open With" submenu are caused by some corruption of the Launch Services database. The lsregister command, which is buried many layers under the /System/Library folder, will rebuild the database if you invoke it with the right options.
Here’s a on how to fix it (and you can add to your .bashrc):
# Quick way to rebuild the Launch Services database and get rid
# of duplicates in the Open With submenu.
alias fixopenwith='/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user'
Now you can get rid of the duplicates from the Terminal by running:
fixopenwith
You may need to follow that up with a:
killall Finder
OSX Cmd: Customize Mission Control To Show Only Windows From Current Desktop Space
To get Mission Control to only show you open windows from the current Desktop Space, type or paste the following into your Terminal:
defaults write com.apple.dock wvous-show-windows-in-other-spaces -bool FALSE
Then, restart the Dock process, which also controls the Mission Control process:
killall Dock
Now you’ll only see windows from the currently active Desktop Space when you activate Mission Control.
NOTE: Return it back:
defaults write com.apple.dock wvous-show-windows-in-other-spaces -bool TRUE
killall Dock
defaults write com.apple.dock wvous-show-windows-in-other-spaces -bool FALSE
Then, restart the Dock process, which also controls the Mission Control process:
killall Dock
Now you’ll only see windows from the currently active Desktop Space when you activate Mission Control.
NOTE: Return it back:
defaults write com.apple.dock wvous-show-windows-in-other-spaces -bool TRUE
killall Dock
Sunday, June 17, 2012
Want Colorful Command Line Shell For Your Mac OS X??
I always wanted to have colorful shell just like RedHat Enterprise Linux on my Mac OS X. It was not easy to configure it until a new command line shell from Ridiculous Fish (@ridiculous_fish) came in.
FISH - Friendly Interactive SHell
The new fish is a POSIX command line shell with delightful, intuitive features like autosuggestions, 256 color syntax highlighting, web based configuration, and lots more. Best of all, these features just work, out of the box. No arcane syntax, no twiddling obscure knobs.
- Download fish here.
- Just install fishfish.pkg
- Open Terminal
- Edit /etc/shells as root. Run: sudo vi /etc/shells
- Add the line (if missing): /usr/local/bin/fish
- To set FISH as as default shell for desire user, Login to desire user shell. Then run: chsh -s /usr/local/bin/fish
Some useful FISH command:
fish_config
Interactively set your color from the web. list FISH functions and variables. Also to see FISH command history.
fish_update_completions
Update man-page completions
Monday, February 11, 2008
OSX Cmd: Change Your Shell
Mac OS X Leopard root shell default is, /bin/sh. My favourite is /bin/bash. Tried to change from /bin/sh to /bin/bash by editing /etc/passwd but it's not working. When su to root either via terminal or SSH remotely it's still used /etc/sh. Search for usermod command to change shell, as I always doing with others *NIX , but so far I couldn't find either usermod, useradd and userdel command on Mac OS X Leopard at all. Dang!!! Almost a week like a mad cat tried to figure out, at last found chsh command.
The chsh utility allows editing of the user database information associated with user or, by default, the current user. Type in below command to change your shell.
$ sudo chsh root
It will prompt you for password. Just put in your password.
Changing shell for root.
Password for root:
# Changing user information for root.
# Use "passwd" to change the password.
##
# Open Directory: /Local/Default
##
Login: root
Uid [#]: 0
Gid [# or name]: 0
Generated uid: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000
Home directory: /var/root
Shell: /bin/sh
Full Name: System Administrator
Office Location:
Office Phone:
Home Phone:
Issue below command to check root default shell, it should return you /bin/bash.
Password for root:
Then it will open up vi with below information. Move to 'Shell:/bin/sh line', and then press I to enter insert mode. Delete sh and replace it with bash. Then press , enter :wq and press to save file and quit.
# Changing user information for root.
# Use "passwd" to change the password.
##
# Open Directory: /Local/Default
##
Login: root
Uid [#]: 0
Gid [# or name]: 0
Generated uid: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000
Home directory: /var/root
Shell: /bin/sh
Full Name: System Administrator
Office Location:
Office Phone:
Home Phone:
Issue below command to check root default shell, it should return you /bin/bash.
$ sudo echo $SHELL
Password:
/bin/bash
Password:
/bin/bash
Saturday, February 2, 2008
OSX Cmd: Copy & Burn DVD/CD
I would like to copy DVD/CD image on Mac OS X. I don't want to install something like Toast since it's also install other craps that I don't need. Disk Utility comes with Mac OS X doesn't create ISO images. It's only can burn it. Tried to find out if there another way to do this on Mac OS X (Leopard in my case) without need installation others application. I found below useful command.
Copy DVD/CD
Typical way to duplicate DVD/CD is to make an ISO image. ISO9600 compliant bit-wise copy of content of an optical disc that allow it to be used on any operating system. You can burn this ISO image to any number of disk and use them anywhere, on any machine.
On Mac OS X, an ISO image can be create using hdiutil command. Below command will automaticaly create .iso file name Photo2008.iso on current directory.
hdiutil makehybrid -o {image_name} {image_source}
Copy DVD/CD
Typical way to duplicate DVD/CD is to make an ISO image. ISO9600 compliant bit-wise copy of content of an optical disc that allow it to be used on any operating system. You can burn this ISO image to any number of disk and use them anywhere, on any machine.
On Mac OS X, an ISO image can be create using hdiutil command. Below command will automaticaly create .iso file name Photo2008.iso on current directory.
hdiutil makehybrid -o {image_name} {image_source}
eg: hdiutil makehybrid -o Photo2008 /Volume/Photo2008
Note: /Volume/Photo2008 is a DVD
You can also use additional options below.
hdiutil makehybrid -o {image_name} {image_source}[filesystem] -verbose
[filesystem]
Option: -hfs, -iso, -joliet, -udf
-verbose
To see all the operation details.
Burn DVD/CD
Following command to burns the image created to available optical media and verifies the burn.
hdiutil burn {image_source}
eg: hdiutil burn Photo2008.iso
You can also use additional options below.
hdiutil burn {image_source} -speed [x_speed] -testburn -noeject -noverifyburn -verbose
-speed
[x_speed] option: 1, 2, 3 ...., 8, max. This depend how many CPU your DVD/CD drive have. If specified 4, means the drive will be instructed burn at "4x speed". If no -speed specified "max" is the default speed.
-testburn
Don't turn on laser (laser defaults to on).
-noeject
Do not eject disc after burning. The default is to eject the disc.
-noverifyburn
Do not verify disc contents after burn. The default is to verify.
-verbose
To see all the operation details.
Note: /Volume/Photo2008 is a DVD
You can also use additional options below.
hdiutil makehybrid -o {image_name} {image_source}
Option: -hfs, -iso, -joliet, -udf
-verbose
To see all the operation details.
Burn DVD/CD
Following command to burns the image created to available optical media and verifies the burn.
hdiutil burn {image_source}
eg: hdiutil burn Photo2008.iso
You can also use additional options below.
hdiutil burn {image_source}
-speed
-testburn
Don't turn on laser (laser defaults to on).
-noeject
Do not eject disc after burning. The default is to eject the disc.
-noverifyburn
Do not verify disc contents after burn. The default is to verify.
-verbose
To see all the operation details.
Subscribe to:
Posts (Atom)
