Importing colormaps from python (matplotlib) into Matlab on Macbook
- Download the PyColormap4Matlab library from the following link: https://www.mathworks.com/matlabcentral/fileexchange/68239-pycolormap4matlab
- Rename the package to PyColormap4Matlab,
- Copy & paste the new folder in your Documents as /Documents/MATLAB/PyColormap4Matlab,
- Open the MATLAB application and link the new folder PyColormap4Matlab to it using the "Home > Set Path" tab in the top menu. Next, click "Add Folder" and select /Documents/MATLAB/PyColormap4Matlab, then click on Open, Save, and Close.
- Install the “Matplotlib" library. To do so, enter the command "
pip3 install matplotlib
" in the terminal. For other options, check https://www.geeksforgeeks.org/how-to-install-matplotlib-on-macos/ - Now, you can import the colormaps from Matplotlib to MATLAB. The following MATLAB script imports the colormap Greys from Matplotlib to MATLAB. The name of the new colormap in MATLAB is cl_Greys:
# set the Python path
path_python = '/usr/bin/python3';
# importing Greys colormap from Matplotlib
cl_Greys = getPyPlot_cMap('Greys', [], [], path_python);
- Hint: to find the Python path (for variable "path_python") enter the "
which python3
" command in the terminal.
- For a list of Matplotlib colormaps, check the following link: https://matplotlib.org/stable/tutorials/colors/colormaps.html
- In the following pictures, prepared by Kamyar Mohseni, different classes of Matplotlib colormaps are compared together and also with MATLAB colormaps.
Set up CSU email on Apple Mail (Mac)
After setting up your Office 365 email account, you can add your email address to Apple Mail on your Mac. Then you can send and receive business emails from your phone. Alternatively, you can download Outlook 2016 and add your Office 365 email.
- Open Apple Mail and click Mail.
- Click Add Account.
- Select Exchange and click Continue.
- Enter your name, CSU email address and password.
- Click Sign In.
- Click Done (you can come back and edit these settings at any point).
- If Microsoft cannot verify your account, you will be asked to enter your details manually:
— User Name: your CSU email address
— Password: your CSU email password
— Internal URL: outlook.office365.com
— External URL: outlook.office365.com
— Domain: leave blank
- Click Sign In, your account will display and emails will start to load, this can take a few minutes. Test your Apple Mail by sending yourself an email from your Office 365 web portal and responding to it from Apple Mail.
Source: GoDaddy Help
How to Allow Apps from Anywhere in macOS Gatekeeper
- Quit out of System Preferences
- Open the Terminal app from the /Applications/Utilities/ folder and then enter the following command syntax:
sudo spctl --master-disable
- Hit return and authenticate with an admin password
- Relaunch System Preferences and go to “Security & Privacy” and the “General” tab. You will now see the "Anywhere" option under "Allow apps downloaded from:".
ATOM; a hackable text editor for the 21st Century
Atom is a text editor that's modern, approachable, yet hackable to the core—a tool you can customize to do anything but also use productively without ever touching a config file.
Download for Mac (For macOS 10.8 or later.)
Other platforms
Beta releases
How to delete ._ files in MAC
Problem:
How one can clean the ‘dot underbar‘ files or ‘Apple double‘ files?
Solution:
1) Open up the terminal application and enter the following command to merge & delete the files:$ dot_clean -m DIRECTORY_ADDRESS
DIRECTORY_ADDRESS is the address of the folder or the directory that you want to clean the ._ files.
If you want to delete all ._ files in your MAC just replace it with ‘./’.
2) or you can delete the files by entering the following command in the terminal:$ find DIRECTORY_ADDRESS -name ._\* -delete
How to empty file cache on Mac OS X
Problem:
How one can make free the allocated RAM to the file cache?
Solution:
Open up the terminal application and activity monitor. In terminal enter the command:$ sudo purge
If one checks the activity monitor it should show the reduction in RAM usage on the Mac and the file cache should be cleared.
Run gedit on Mac OS X Mavericks
1) Download the last version of gedit (gedit-3.2.6-3) from gnome.org for Mac OS X (Click here for direct download link).
2) Install gedit application.
To solve the problem of running gedit on Mac OS X Mavericks, we need to update the version of libxml2 packaged with gedit as follow:
3) use the command$ brew install libxml2
4) and then$ cp /usr/local/Cellar/libxml2/2.9.0/lib/libxml2.2.dylib /Applications/gedit.app/Contents/Resources/lib/
point: If in the last step, you get the error message
“cp: /usr/local/Cellar/libxml2/2.9.0/lib/libxml2.2.dylib: No such file or directory
”
you need to check the version of installed libxml2 on your system (here it is supposed to be 2.9.0) and change the version in cp command.
Problem with Mavericks Partition Mac: "Error: Live file system repair is not supported.”
Problem:
Running Disk Utility from the recovery partition, Repair Disk, yields the following error message:
"Error: Live file system repair is not supported.
”
Running Verify Disk yields the following error message:
“Error: The partition map needs to be repaired because there’s a problem with the EFI system partition’s file system.
”
Solution:
Just use internet recovery:
Reboot system > hold down the keys COMMAND + ALT (or option) + R
Search not working properly in mail (Mac OS X)
If there are problems with information in your mailboxes, you might see an alert message saying that Mail needs to repair your mailboxes by reindexing your messages for you.
At other times, you may want to reindex messages yourself—for example, when searching mailboxes using Subject, To, or From doesn’t return the correct results.
1) Quit Mail if it is open.
2) In ~/Library/Mail/V2/MailData
, delete any file that begins with “Envelope Index,” such as Envelope Index, Envelope Index-shm or Envelope Index-wal.
3) Your home Library folder is hidden by default. To display it, choose Finder > “Go to Folder” and then enter “~/Library”.
4) Then open Mail. Mail creates new Envelope Index files. This process may take a few minutes, depending on how many messages Mail is reindexing.
Install Dropbox via command line on Linux
The Dropbox daemon works fine on all 32-bit and 64-bit Linux servers. To install, run the following command in your Linux terminal.
32-bit:$ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf -
64-bit:$ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
Next, run the Dropbox daemon from the newly created .dropbox-dist folder.$ ~/.dropbox-dist/dropboxd
Tip:
If you're running Dropbox on your server for the first time, you'll be asked to copy and paste a link in a working browser to create a new account or add your server to an existing account. Once you do, your Dropbox folder will be created in your home directory. Download this CLI script to control Dropbox from the command line. For easy access, put a symlink to the script anywhere in your PATH.
Matlab loads, but "freezes" after taking Java update in Mac OS X
After taking the Java update via the App store, Matlab will launch and open the last file, however, it will freeze and don't open any file. This is a Java issue and reinstalling Matlab or a new user profile will not resolve.
Context
- Affects MATLAB 2012b and earlier, with the Java for OS X 2013-004 update
- The original update gives build 1.6.0_51-b11-456-10M4508
- This can be verified by running the command below in terminal and comparing the build
$ java -version
Good:
Java(TM) SE Runtime Environment (build 1.6.0_45-b06-451-11M4406)
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Bad:
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-456-10M4508)
SOLUTION
- Apple's update has been fixed, however, it is not being pushed via updates to clients already affected. It is now safe to update via the Appstore, Java for OS X 2013-004 is the package.
- If you are stuck on version 10M4508, you can manually update:
* for 10.7/10.8: http://support.apple.com/kb/DL1572
* for 10.6: http://support.apple.com/kb/DL1573
Installing XmGrace (Grace) on Mac OS X
(updated on June 9, 2016)
METHOD 1:
1) Install Xcode:$ xcode-select --install
2) Install open motif$ sudo port install openmotif
3) Install Xmgrace$ sudo port install grace
4) Open Xmgrace and enjoy!$ xmgrace
METHOD 2:
1) Install motif libraries. You can download binary from here:
http://www.ist.co.uk/downloads/motif_download.html
2) Grace download and install:$ cd Desktop
$ wget ftp://ftp.fu-berlin.de/unix/graphics/grace/src/grace5/grace-5.1.23.tar.gz
$ tar xzvf grace-5.1.23.tar.gz
$ cd grace-5.1.23
$ ./configure --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib --with-motif-library=-lXm --with-extra-incpath=/usr/OpenMotif/include:/usr/local/fftw-3.3.4/include --with-extra-ldpath=/usr/OpenMotif/lib:/usr/local/fftw-3.3.4/lib
$ make
$ sudo make install
$ echo "export PATH=$PATH:/usr/local/grace/bin" >> ~/.bashrc
$ source ~/.bashrc
$ xmgrace
Tips:
- on Mac OS X Lion, wget doesn't work. Use curl -O instead of wget.
- if in the last step, when you try to run xmgrace, you get the following error:$ xmgrace
Can't open display
Failed initializing GUI, exiting
you can try:$ DISPLAY=:0.0 xmgrace
if it doesn’t solve the problem, you need to open XQuartz and then enter the following command: $ DISPLAY=:0.0 xmgrace
Xmgr Grace application for Mac OS X & Mac OS X Lion
This is a very easy to use, open-source, X11 based, 2D plotting tool. For installation move the Grace application to the system /Applications folder for it to function correctly.
DOWNLOAD:
Binaries: Grace (PowerPC only),
Grace Lion, updated Jan. 2012
Grace updated Aug 2014.
Documentation: click here!