Posts

Showing posts with the label Macos

Brew Install Postgresql (upgrade) Error, Could Not Link - Dead Links To Old Non-existent Version

Answer : I had the similar problem but with another package. Turned out there had been a bunch of dead links pointing to the old version all other my file system. Here is what helped in my case: Run brew link <appname> (e.g. brew link postgress ); If completed successfully then you are golden, otherwise proceed with the next step; Take a look at the path in the error message (e.g. /usr/local/Cellar/postgresql/9.2.3/include/server ) transform the path by removing the Cellar/<app name>/<version> from it (e.g. /usr/local/include/server ) Find under that path all links referring to Cellar/<app name>/<version> and remove them; Goto step 1. Hope that helps brew update brew doctor is always first steps. to help finding files, update the files db sudo /usr/libexec/locate.updatedb this is similar to updatedb on ubuntu and you might want to alias it. then you may perform locate postgresql and learn more about where things are. Chanc...

Completely Uninstall PostgreSQL 9.0.4 From Mac OSX Lion?

Image
Answer : The following is the un-installation for PostgreSQL 9.1 installed using the EnterpriseDB installer. You most probably have to replace folder /9.1/ with your version number. If /Library/Postgresql/ doesn't exist then you probably installed PostgreSQL with a different method like homebrew or Postgres.app . To remove the EnterpriseDB One-Click install of PostgreSQL 9.1: Open a terminal window. Terminal is found in: Applications->Utilities->Terminal Run the uninstaller: sudo /Library/PostgreSQL/9.1/uninstall-postgresql.app/Contents/MacOS/installbuilder.sh If you installed with the Postgres Installer, you can do: open /Library/PostgreSQL/9.2/uninstall-postgresql.app It will ask for the administrator password and run the uninstaller. Remove the PostgreSQL and data folders. The Wizard will notify you that these were not removed. sudo rm -rf /Library/PostgreSQL Remove the ini file: sudo rm /etc/postgres-reg.ini Remove the PostgreSQL user using System Preferences -> U...

Create Multi Volume Archive On A Mac

Answer : You can split any file with the split command: split -b 2048m bigfile.tgz bigfile.tgz. And you will get: bigfile.tgz.aa bigfile.tgz.ab ... To combine them again: cat bigfile.tgz.* > bigfile.tgz It can also be used on Windows with copy /B Of course, this is not really a multi-part archive, just cutting any file to pieces. Multi-part archives are usually aware that they are part nb 5 is a series, include CRC verification for each file etc. But that is specific to the archive format that you want to use. Use programs like Keka (archiver for Mac OS X) WinZip Mac built-in Archiver in OS X plus Split & Concat / hjsplit for Windows, Linux, Macs. To split with the internal zip command on OS X, type this in a terminal: zip -s 1g BigFile6GB.zip BigFile6GB.iso Where 1g = split files in 1GB of maximum size. The result will be 6 files of 1GB each. Read man zip on terminal to see others options of split size with the internal zip command.

Apple - Alternative To Windows Snipping Tool For Mac OSX

Answer : There is now a blog entry about Taking Screenshots in a Snap . It's built into Mac OS. ⌘ + ⇧ + 3 captures the whole screen ⌘ + ⇧ + 4 captures a custom rectangle (click and drag over the screen region you want to capture) ⌘ + ⇧ + 4 then space captures a specific window (move the mouse cursor over the desired window, then click) Press esc to cancel. Screenshots are saved onto your Desktop and timestamped. Holding control in addition to any of the sequences above causes the image to be copied instead of saved to the desktop. By default the image format is png . However, you can change the format by typing in the Terminal : 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. The settings for the shortcuts in the system preferences are ...

Apple - Alternative To TotalTerminal That Works With El Capitan

Answer : If you're willing to disable System Integrity Protection to continue using TotalTerminal, you can do that. If not, the developer of TotalTerminal says the reason he stopped working on it is that he switched to iTerm 2, which he says "offers similar functionality to Visor and comparable features to build-in [sic] Terminal.app." I've never used either, but another question on this site explains how to set up iTerm to work in a similar manner.

Can't Use Mongo Command, Shows Command Not Found On Mac

Answer : You need to add the path to "mongo" to your terminal shell. export PATH=$PATH:/usr/local/mongodb/bin Did you do the last step with paths.d? If so, try restarting your terminals. Do you have a good reason for using 1.8.5? The current stable is 2.0.4, and it has many useful upgrades from 1.8.x You'll have to add the location of the Mongo binary to PATH. Follow the steps below in order to make the PATH variable permanent: Open Terminal and navigate to your user directory. Run touch ~/.bash_profile and then open ~/.bash_profile . In TextEdit, add export PATH="<mongo-directory>/bin:$PATH" (Keep the quote marks - related to white spaces). Save the .bash_profile file and Quit (Command + Q) Text Edit. Run source ~/.bash_profile . Run echo $PATH and check if the you see that the Mongo binary was added. (*) Notice that the PATH variable is now available only for the current terminal and not to processes that were already started...

Angular CLI Ng Command Not Found On Mac Os

Image
Answer : After days of googling and getting no help neither on here nor from @Angular github which is pretty much useless, was finally able to resolve the issue and get my angular ng command not found issue resolved following these steps: 1. Instal nvm Issue these 3 commands to install nvm. (Angular documented steps https://angular.io/guide/setup-local to setup your environment did not work for me). So I installed nvm like so: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash export NVM_DIR="/Users/your-user-name/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" After this, make sure you restart terminal and you should be able to issue nvm --version to see version of installed nvm. 2. Install node using nvm nvm install stable nvm install node 3. Finally, install angular npm install -g @angular/cli 4. Restart terminal Restart terminal and you should be able to use ng version to s...

Cannot Connect To The Docker Daemon On MacOS

Answer : On a supported Mac, run: brew install --cask docker Then launch the Docker app. Click next. It will ask for privileged access. Confirm. A whale icon should appear in the top bar. Click it and wait for "Docker is running" to appear. You should be able to run docker commands now: docker ps Because docker is a system-level package, you cannot install it using brew install , and must use --cask instead. Note: This solution only works for Macs whose CPUs support virtualization, which may not include old Macs. On macOS the docker binary is only a client and you cannot use it to run the docker daemon, because Docker daemon uses Linux-specific kernel features, therefore you can’t run Docker natively in OS X. So you have to install docker-machine in order to create VM and attach to it. Install docker-machine on macOS If you don't have docker-machine command yet, install it by using one of the following methods: Using Brew command: brew install dock...

Apple - Can I Manually Limit The %CPU Used By A Process?

Answer : cputhrottle is the tool you need. You can install it with Homebrew. You can monitor a series of processes by name by running the Bash script below. I'm not quite sure how to turn this into a login item since cputhrottle requires superuser permissions. Run it as a script, in an Automator workflow, whatever: # Get the Process/App names from Activity Monitor and put them here apps=("AppOne" "AppTwo" "AppThree") # Set the respective limits here limits={30 40 50) while true; do for app in ${apps}; do for limit in ${limits}; do for pid in $(pgrep ${app}); do sudo /path/to/cputhrottle ${pid} ${limit} done done done done [Edited] I've added a different version for this script (a bash script), which might be useful for people looking for limiting the CPU for multiple applications. This new script also allows you to specify a list containing the application name and the CPU limit for it. The main di...

Adb Command Not Found

Answer : In my case with Android Studio 1.1.0 path was this /Users/wzbozon/Library/Android/sdk/platform-tools Add the following to ~/.bash_profile export PATH=~/Library/Android/sdk/tools:$PATH export PATH=~/Library/Android/sdk/platform-tools:$PATH Is adb installed? To check, run the following command in Terminal: ~/Library/Android/sdk/platform-tools/adb If that prints output, skip these following install steps and go straight to the final Terminal command I list: Launch Android Studio Launch SDK Manager via Tools -> Android -> SDK Manager Check Android SDK Platform-Tools Run the following command on your Mac and restart your Terminal session: echo export "PATH=~/Library/Android/sdk/platform-tools:$PATH" >> ~/.bash_profile Note: If you've switched to zsh, the above command should use .zshenv rather than .bash_profile Make sure adb is in your user's $PATH variable. or You can try to locate it with whereis and run it wit...

Can't Update RubyGems

Answer : There is no need to take such drastic steps as completely rebuilding Ruby, reinstalling Rubygems from scratch or installing a version manager to solve this problem. There is simply a dependency cycle introduced by the release of hoe 2.3.0: rubygems-update 1.3.5 requires (among other things) hoe-seattlerb hoe-seattlerb requires hoe >= 2.3.0 hoe >= 2.3.0 requires rubygems >= 1.3.1 I wrote the blog post linked to by zipizap. To recap: If you've already tried to update, uninstall the latest rubygems-update first: sudo gem uninstall rubygems-update -v 1.3.5 Update to 1.3.0: sudo gem install rubygems-update -v 1.3.0 sudo update_rubygems Then update to latest: sudo gem update --system With the release of Rubygems 1.3.6, it looks like this problem may be gone. From the release notes: Development deps are no longer added to rubygems-update gem so older versions can update sucessfully. Oi - I feel your pain. I'll first ask the obvious; ...

Can I Install An Alternative Window Manager On Mac OS X?

Answer : Is there an alternative window manager for OS X (…)? It depends on what you define as window manager. If you mean the entire framework that draws the windows, then no. This has always been the Window Server in conjunction with Quartz. If you mean apps that enhance some of the window switching and layouting behavior, there are plenty of those, but none of them really replaces anything. Have a look at the following projects or tools if you want to tweak the window behavior, mostly with respect to resizing automatically: xnomad, a keyboard based open-source tiling window manager Slate, based on xnomad Spectacle, keyboard-controlled window moving and resizing TylerWM, like Spectacle SizeUp, same as Spectacle, but costs something Cinch, Windows-like Aero Snap resizing BetterTouchTool, mostly for mouse and trackpad gestures, but has window snapping Optimal Layout, Mizage, Moom, Window Magnet, etc. Can I move the "stoplight" icons from the left to...

Cannot Download, $GOPATH Not Set

Answer : [Update: as of Go 1.8, GOPATH defaults to $HOME/go , but you may still find this useful if you want to understand the GOPATH layout, customize it, etc.] The official Go site discusses GOPATH and how to lay out a workspace directory. export GOPATH="$HOME/your-workspace-dir/" -- run it in your shell, then add it to ~/.bashrc or equivalent so it will be set for you in the future. Go will install packages under src/ , bin/ , and pkg/ , subdirectories there. You'll want to put your own packages somewhere under $GOPATH/src , like $GOPATH/src/github.com/myusername/ if you want to publish to GitHub. You'll also probably want export PATH=$PATH:$GOPATH/bin in your .bashrc so you can run compiled programs under $GOPATH . Optionally, via Rob Pike, you can also set CDPATH so it's faster to cd to package dirs in bash: export CDPATH=.:$GOPATH/src/github.com:$GOPATH/src/golang.org/x means you can just type cd net/html instead of cd $GOPATH/src/golang....

An Application To Easily Pick A Color In Mac OS X And Get The Hex Value

Image
Answer : OS X comes with DigitalColor Meter: Applications > Utilities > DigitalColor Meter.app It has many options and preferences. command+shift+c will copy the color under the cursor to the clipboard in many different formats. The Mac OS X color picker is extensible. Use Hex Color Picker to add a tab that provides you the configured color in hexadecimal RGB. Just run e.g. TextEdit and press Cmd-Shift-C to open the color picker, or run your standalone program. An even more versatile color picker is Developer Color Picker with many different output formats, one of which is hexadecimal. This is easily done with AppleScript. A complete working example of code is available here.

Brew Install Mysql On MacOS

Answer : I think one can end up in this position with older versions of mysql already installed. I had the same problem and none of the above solutions worked for me. I fixed it thus: Used brew's remove & cleanup commands, unloaded the launchctl script, then deleted the mysql directory in /usr/local/var , deleted my existing /etc/my.cnf (leave that one up to you, should it apply) and launchctl plist Updated the string for the plist. Note also your alternate security script directory will be based on which version of MySQL you are installing. Step-by-step: brew remove mysql brew cleanup launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist sudo rm -rf /usr/local/var/mysql I then started from scratch: installed mysql with brew install mysql ran the commands brew suggested: (see note: below) unset TMPDIR mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)...

Apple - Can I Lower The Minimum Display Brightness? How?

Image
Answer : My recommendation is a hitherto-little known gem, called ScreenShade. There are several decent Mac software screen dimmers out there, of which I've found the ones whose dimming method is to apply an increasingly opaque black 'overlay' over the screen to be the most superior in appearance (providing much higher quality 'low blacks' than Shades which does its dimming via color profile/gamma level tweaking) and in doing so, also playing nice with famous color temperature regulating app, f.lux. The best examples in this group, are Shady (whose development has been abandoned by its dev and has a no better rogue clone in the Mac App Store), ScreenDimmer, Screen Shade, and Work at Night. (N.b. these last two, confusingly appear to be clones, by the same dev on the Mac App Store.) But if you're looking to more fully emulate the Mac's in-built hardware dimming in software, you're looking for an app that can have the dimming triggered via hotkey...

Can I Run Mac OS X As A Hyper-V Virtual Machine?

Answer : No. Hyper-V is very specific about supported OS's and the generic drivers are very Microsoft specific.

Cannot Find FileMerge (opendiff Tool) But I Have Xcode 4.6 Installed

Answer : FileMerge is located at within Xcode. From the command-line: cd /Applications/Xcode.app/Contents/Applications/ open . Go into that directory once it opens: Right-click on the app Choose "Make alias" Move that alias to your Applications directory You're all set. Strange. "XCode 4.5, where is FileMerge ?" suggests: The FileMerge that is bundled with Xcode 4.5 doesn't work as a standalone application. I tried compressing it from the application bundle. I was able to expand it to show the FileMerge app on the desktop. But when I tried to run it I got an error saying it couldn't be opened. Apple's developer downloads site has every version of Xcode. You could try trashing your current version of Xcode 4.5, downloading Xcode 4.5 from the developer downloads site, and see if FileMerge is there. If not, you can download Xcode 4.4 and see if that has FileMerge. Indeed, I downloaded a fresh new install o...

Apple - Can I Change The Default Mac App Store Install Folder?

Answer : Regarding Mac OS X File System Overview , it seems Apple enforcing the standard compliance for developer to follow their rules on application folder which are within /Applications or ~/Applications. The concern is to comply the way Mac App Store deliver the updates. if you not comfort enough to use default folder, yes you are still able to move the application which you had download from Mac App Store to another folder with two caveats: You will be required to enter an administrative password to move the app from the /Applications folder. If an update appears in the MAS for an installed app that has been moved you will get an error message about having apps installed from another account. To update the app you will have to Delete the app entirely and then install the updated app or Move the app back to the /Applications folder At this point there is no details on this (But I am sure there is a property or .plist) but in the meantime you can create a simple A...

Can't Attach Android Studio's Debugger To Android Process

Answer : So finally I got it working, by: Checking 'Show all processes' checkbox! BUT as you see in the question, checkbox was on at the beginning, so there were multiple issues. To summarize, these are other actions to be done: Kill all adb processes (use ps -x | grep adb and kill -9 [process id] ) adb start-server in terminal Reconnect device adb devices (to make sure device is connected successfully) Make sure Android DDMS Devices | logcat shows your app and only one device is listed. Check Show all processes checkbox. See screenshot I solved this way a. Closed Android Studio b. Did adb kill-server from a terminal. Also check the adb process in also killed from the Running processes window in PC c. Started Android Studio d. Android Studio tried to initialize adb again and back to work. It could be because the release build variant (which you can set in the Build-Variants section) has been chosen mistakenly, only debug-variant is debuggabl...