Posts

Showing posts with the label mac

Install memcached in Mac OS El Capitan

The easiest way to install memcached is to use homebrew package installer: $ brew install memcached This locates memcached in /usr/local/opt/memcached/bin/ Starting memcached (by default at port 11211 or with -p port_number): $ memcached -p 9000 To have launchd start memcached now and restart at login: $ brew services start memcached To change the default ram size (64mb) used by memcached use -m option: $ memcached -m 128  -p 9000 Lastly, run memcached as a daemon with -d: $ memcached -d -p 9000

Install compass in Mac Os El Capitan

So, $ sudo gem install compass is not working? Do you have ruby installed? If not install it using brew: $ sudo brew install ruby  First try updating your gem version: $ sudo gem update --system Then try again installing compass: $ sudo gem install compass Oh... now you get a: Fetching: compass-1.0.3.gem (100%) ERROR:  While executing gem ... (Errno::EPERM)     Operation not permitted - /usr/bin/compass Run the following: $ sudo gem install -n /usr/local/bin compass Done.

How to turn on "three finger drag" on Mac Os X

From the Apple menu, choose System Preferences.  Click the Accessibility icon.  Choose Mouse & Trackpad from the options on the left.  Click Trackpad Options.  Place a checkmark next to "Enable dragging."  From the related pop-up menu, choose “three finger drag” so there's a checkmark next to it.  Click OK.

Installing matplotlib under Mountain Lion

Follow this steps in order: [carpincho@MacBook-2]$ pip install numpy [carpincho@MacBook-2]$ pip install -e git+https://github.com/scipy/scipy#egg=scipy-dev [carpincho@MacBook-2]$ pip install git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib-dev source and a link to an explanation why numpy and matplotlib can't be installed using pip straightforward

Swig compiling issues Mac Os Lion

One problem that happened to me, was the fact that working under a virtualenv with an specific python version as one can expect, works with ONLY that python version. So if you try to import a module compiled with one version different with the one you are running, will no work. The exception message: Fatal Python error: Interpreter not initialized (version mismatch?) Abort trap: 6 How we can solve this issue? First, knowing which python version are we running and of course, compile the module to THAT version. Below are some examples of how to compile a module to 2.6 or 2.7 (which is Mac Os Lion python default version) To use python default version just type the following: $ swig -python example.i $ cc -c `python-config --cflags` example.c example_wrap.c $ cc -bundle `python-config --ldflags` example.o example_wrap.o -o _example.so If you run: $ python-config --ldflags the output is: -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework...

Swig Tutorial example Mac Os Lion

This tutorial is based on Leopard Tutorial but still works, thou some warnings. First, we create an example.c file with this content: /* File : example.c */ #include <time.h> double My_variable = 10.0; int fact(int n) { if (n Second, we create the interface between C and Python with the following file: /* example.i */ %module example %{ /* Put header files here or function declarations like below */ extern double My_variable; extern int fact(int n); extern int my_mod(int x, int y); extern char *get_time(); %} extern double My_variable; extern int fact(int n); extern int my_mod(int x, int y); extern char *get_time(); Now that we have all the source files we need, we compile them in this way: $ swig -python example.i $ cc -c `python-config --cflags` example.c example_wrap.c $ cc -bundle `python-config --ldflags` example.o example_wrap.o -o _example.so if you have problems with this step check this other post So, everything looks nice, but how do we use ...

timeit example

An example of how to time a statement >>> import numpy as np >>> arr1 = np.random.randint(0,1600,(3000,3000)) >>> timeit arr1.argmin() 10 loops, best of 3: 34.2 ms per loop Tested under Mac Lion Os proc i7 and Python 2.7.1 r271:86832

Using wget to download a page and browse it locally

Run:  [carpincho@bender]$ wget -r --convert-links url What the arguments do: -r (its the same using --recursive)   Turn on recursive retrieving.   The default maximum depth is 5. -k (its the same using --convert-links) After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content, such as embedded images, links to style sheets, hyperlinks to non-HTML content, etc. url (obvious :P) Note: You can run it under any Unix based Os or under Mac Os previouly installing it with macports

Alternative to istat menu

Image
MenuMeters is  a set of CPU, memory, disk, and network monitoring tools for Mac OS X. Although there are numerous other programs which do the same thing, none had quite the feature set I was looking for. Most were windows that sat in a corner or on the desktop, which are inevitably obscured by document windows on a laptop's small screen.  MenuMeters at the topmenu Requirements: Mac OS X 10.4 or later (10.7 supported) PowerPC or Intel based Macintosh (Universal Binary) Website

How to create symbolic link in Mac Os Lion

ln -s <absolute_path> <name_of_link>

Show hidden files in Mac Os Lion

Open Terminal and run: $ defaults write com.apple.Finder AppleShowAllFiles YES Relaunch Finder (hold alt key and right click on Finder, then Relaunch) To hide this files again run in Terminal: $ defaults write com.apple.Finder AppleShowAllFiles NO and also relaunch Finder as above. source

How to uninstall XCode4 from Mac OS X Lion

So i had an old version of XCode on my computer, and i tried upgrading it with the new mac app store, and it didn’t work. I wanted to uninstall it and then reinstall it using the app store, but they of course don’t have an option to UNINSTALL apps using the app store Google tells me to just delete the app and then you can click ‘install’ again on the purchases tab in the app store, but since this is xcode, you can’t just drag an application to the trash. You have to run a command using Terminal. So, open terminal and type: sudo /Developer/Library/uninstall-devtools –mode=all The directory MIGHT be different, but for me it installed it to /Developer . Anyway, it should list all the packages and then say it deleted them. I restarted my mac just to be safe. THEN, if it STILL says that xcode is installed, you need to delete the installer from /Applications (different from the Applications folder in your home folder). Go Macintosh HD/Applications and there should be a file called ...

Set (or change ) the hostname - Mac Os Lion

Open " System Preferences " Click on " Sharing " icon Edit the field " Computer Name " with your new hostname Actually this is very useful, because now you can see your device listed in the DHCP list at the router configuration.

My own scheme color for ninja ide! :)

{     "keyword": "#228b22",     "operator": "#242424",     "brace": "#228b22",     "definition": "#6495ed",     "string": "#ff8c00",     "string2": "#838b83",     "comment": "#8b8878",     "properObject": "#8b0a50",     "numbers": "#ff4500",     "spaces": "#000000",     "extras": "#ffff00",     "editor-background": "#eeeee0",     "editor-selection-color": "#ebc79e",     "editor-selection-background": "#8b8878",     "editor-text": "#242424",     "current-line": "#6ca6Cf",     "selected-word": "#a2cd5a",     "fold-area": "white",     "fold-arrow": "darkGray" } Ninja-Ide Homepage!

Delete all the "Thumbs.db" files - Mac Os Lion

First, find out how many of them you have, by running this command: find . -iname "Thumbs.db" And just run the following command in the base folder from where to erase them: find . -iname "Thumbs.db" -delete source

ExposƩ Mac Os X like in Ubuntu 11.04

This effect can be done using compiz! First, install Compiz Settings Manager from the repositories Under " Filter ", filter by the keyword "scale" Finally, select " Scale " and in the " Binding " tab, assing a method to " Iniciate Windows Picker " (with the monitor icon). For example: " BottomRight "

How to download Iphone's photos - Mac Os X Snow Leopard

We can use Preview Import function, File -> Import Image

Fix file permissions in Mac OS X

A few days ago I copied a bunch of files/folders from an external NTFS formatted hard drive to my MacBook. The files where copied ok, but the permissions where messed up. How did I fix them? With this simple command: $ chmod -Rv u=rwx,g=rx,o=r username path_to_base_folder It recursively goes through all files and folders and fix their permissions. Source!

Sync iPhone apps with iTunes without deleting them

Warning: This is only for  apps! Music and other things will not be saved! Question I have a few apps on my iPhone, and would like to sync them with iTunes without erasing them from my phone. Is this possible without downloading them all again? Answer   secondary click the iPod/iPhone on the left  click "transfer purchases"   Afterwards, you can sync, and "everything" will be erased and rewritten to the Device. source

Read and Write NTFS partition under Snow Leopard

This is experimental, and known to be unstable, use at your own risk. You need to modify /etc/fstab file to mount NTFS partitions for read and write. First, uninstall NTFS-3G/Paragon if installed. Open Terminal run diskutil info /Volumes/volume_name and copy the Volume UUID. Backup /etc/fstab if you have it (shouldn't be there in a default install).  Run sudo vim /etc/fstab and write: UUID=paste_the_uuid_here none ntfs rw or LABEL=volume_name none ntfs rw (if you don't have UUID for the disk). Repeat for other NTFS partitions. Restart your system. Thats all! source (great web)