![]() ![]() Do you have enough disk space for applications, movies, photos, the OS X and more…? It’s even worse if you’re low on memory too, because your computer may not have enough disk space to use as virtual memory, thus compounding the problem. It’s much more cost-effective to upgrade memory once you’ve bought your Mac, but note that the new Retina Display models cannot be upgraded because the memory is soldered onto the motherboard and cannot be removed.Īpple states that 8 GB of disk space is needed to install Mountain Lion, however if you’re running out of space then you might notice a significant slowdown in the general performance of your Mac. One last tip – don’t buy memory modules from Apple because their prices are extortionate compared with companies like Crucial. Insufficient memory will cause your Mac to use “virtual memory” on the disk which is slowĪ lack of RAM isn’t limited to Mountain Lion only – whatever version of OS X you’re running, it’s advisable to install as much memory as possible as an after-market upgrade, or worst case buy your new Mac with lots of RAM to begin with. Memory upgrades are surprisingly easy to do and mean that your Mac won’t need to use hard disk space as “virtual memory”, thus ensuring everything is running optimally and speedily. Stdin, stdout, stderr = ssh.RAM prices are now as cheap as chips, so 4GB should be the absolute minimum to have installed – however 8 GB or even 16 GB (on the newer Retina Display Macs) is definitely recommended if you can afford it. Ssh.connect(‘10.0.1.200′, username=’leospaul’, password=credential) Here my full script (“leospaul” is my user account on the server):Ĭredential = keyring.get_password(‘pattongeekt’, ‘leospaul’) Should I substitute “set_missing_host_key_policy” too? :) The first line with a reply is the “type(stdin)”-line, and the reply is “”. And there you have it, a way to glance at the free memory on your remote server just by looking at your desktop. You can also resize the box so that the output is spaced correctly. Other options include setting the frequency with which the script is run. In the preferences panel, give it a name and then in the command dialogue box, enter: From the preferences pane, drag the shell icon onto the desktop, where ever you want it to display. To display the output on your desktop, install GeekTool, go to system preferences and select the GeekTool preferences. > t_password('example_keychain', 'user', 'example_password') In order for this to work, you need to set the password in the keychain from the python interpreter first: ![]() # this will display the output formated for GeekTool # read each line of the free -m command for pretty printing in the next step Stdin, stdout, stderr = ssh.exec_command('free -m') Ssh.connect('', username='your_username', ![]() Ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # set the ssh client, and force it to accept new/unknown host keys. # retrieve your ssh credential from your keychain.Ĭredential = keyring.get_password('example_keychain', 'user') (Easiest way to do this is with easy_install or pip.) Paramiko is a python ssh client, and keyring allows python programs to interact with the built-in keychain of your OS. For this script to work, you need the paramiko and keyring python libraries installed. ![]() I did this with a simple python script that is called by GeekTool on a regular schedule. In order to show memory usage, you just need a script to ssh to your server, run a quick shell script to check free -m, and then return the results as standard output. I use it to monitor my server’s memory load, and also to show my todo list using Todo.txt, a lightweight CLI todo list manager: GeekTool is a nifty little program that allows one to run shell scripts and have the output display on your OSX desktop. Once I figured out the minimum ram I could get away with on my setup (turned out to be 600MB), I wanted to keep track of memory usage at a glance without having to ssh from the terminal.Įnter GeekTool. In the process of moving everything onto the virtual machine, and nailing down my resource needs, I spent a lot of time on a secure shell monitoring the server with top for memory spikes. I use a multisite wordpress installation to manage all of my courses, and a number of other virtual presences, hosted on a VPS at dreamhost. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |