Showing posts with label osx. Show all posts
Showing posts with label osx. Show all posts

Monday, March 14, 2016

OSX - Disabling Spindump and VM Compressor 

In case you need to do so. 

If you do, you'll know why. I'm not spending a lot of time getting into the why's and why-not's.  

Just putting this note here, for reference: 


VM Compressor: 
# nvram boot-args="vm_compressor=1" 
--reboot-- 

Check mode: 
# sysctl -a vm.compressor_mode vm.compressor_mode: 1 

------------------------ 

Spindump: 
# cd /usr/sbin/ 
# mv spindump spindump.bak 
# ln -s /usr/bin/true /usr/sbin/spindump 
# launchctl unload -w /System/Library/LaunchDaemons/com.apple.spindump.plist

Tuesday, December 02, 2014

Mac OS X Mavericks and Yosemite running out of memory "fix"

Silly Mac OSX.

Clean up memory cache easily this way:

Add the following entry in your root's crontab:
# Clean up memory
30 * * * * /usr/sbin/purge &

Use at your own risk, but I have not had issues with it.

If you don't know how to update your root crontab, well, then you have no business running this. Use some 3rd party graphical app or something to clean up.

FYI: Some people are having issue with Chrome and Flash and other programs not "letting go" of reserved memory, after use. This will help alleviate the issue. Developers are arguing over it's use, claiming memory management is just fine in OS X 10 Mavericks and later. I beg to differ as I have seen memory run out several times myself with using Chrome web browser and it not letting resources go.

You can read more about it, here:
http://osxdaily.com/2013/11/14/use-purge-command-os-x-mavericks/

Tuesday, April 01, 2014

OSX Mavericks client AD Binding. Little "gotcha's" to look out for.

Make sure your OSX client is using the same time server (NTP) as the AD server(s) else you will get an error, such as:

"Unable to add server
Node name wasn't found
(2000)"

Also helpful is having the OSX client machine already in the DNS that the AD uses (Forward and reverse).

You're welcome. 

Monday, September 30, 2013

Recover a file with LSOF....

Just a quick and dirty of how to recover a file in LSOF.



lsof (List Open Files) is a *nix tool that will show open files and network connections. Of course, it's also available for OS X.
You can recover deleted files with it.
If you have ever deleted a file by mistake you can recover the deleted file. 
For example, to recover a missing messages log used by Syslog you can search for it via this command:
bash:~  lsof | grep messages
You should see something similar to:
syslogd   15328      root    2w      REG              253,2   1419873               983175 /var/log/messages.5 (deleted)
You want to find what is marked as deleted in parenthesis.  The process (15328) still has the file open. Without this process keeping the file open we would have lost the file permanently. This is important. Once the process stops, you won't be able to trace the file this way, so avoid rebooting or stopping the process entirely, until after you've recovered the lost file.

We can view the missing info by looking inside the proc filesystem, the process id (15328), and in the file descriptor (fd). The fd is found in the 4th entry, above (2w in this example):
bash:~  cat /proc/15328/fd/2
This outputs the contents the deleted messages.5 file. As you can see, the data is still there. Now, just redirect the contents back to /var/log/messages.5:
bash:~  cat /proc/15328/fd/2 > /var/log/messages.5
That's all there is to it. You have recovered the file with all the data back to its original location. You should also restart the process, writing to the file(s) recovered.
This is just one of many examples of how lsof can be very useful. Be sure to check out the Man pages and other docs.

Thursday, July 19, 2012

Virtualbox r18 blah...

I've been running Oracle's VirtualBox, instead of VMware, for some time now. I liked the "free" aspect of it, along with it's availability to almost everything I run as a host OS (Solaris, Linux and yes, even Windows, on occasion).


The latest upgrade (on the windows side) is a piece of work (POS, in other words) as upgrading, was a bear.


If it fails to upgrade and you get the odd (MSI not found error) when upgrading from r16 to r18, here's a fix that may work for you (did for me):


(Stolen from https://forums.virtualbox.org/viewtopic.php?f=6&t=45536&sid=a10eb1d37e85adc7b814470463b4b314&start=15)


After trying everything and having made sure that all certificates were in order and that all drivers could be installed perfectly fine, I finally found a solution for this problem that worked for me. It had nothing to do with the driver certificates, and all to do with the driver verification done by the installer.


To install VirtualBox with that error, do the following:


  1. Download the Orca MSI editor. http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&sqi=2&ved=0CFUQFjAA&url=http%3A%2F%2Fwww.technipages.com%2Fdownload-orca-msi-editor.html&ei=zxcIUIuiFePs2QWWm5DeBA&usg=AFQjCNGXxLvTAxxEIQiKhNrV3gWCn_paVg
  2. Start "cmd.exe" via the Start->Run and navigate to the directory you put your setup.exe.
  3. Execute "VirtualBox-4.1.16-78094-Win.exe -x"; adjust this to whatever version of Virtualbox you wish to install.
  4. The installer will tell you where it has extracted the files to. Go there and move them somewhere more accessible.
  5. Start Orca
  6. Open the MSI file for your platform that you've just extracted & copied. In my case this is "VirtualBox-4.1.16-r78094-MultiArch_amd64.msi"
  7. Enter the table "InstallExecuteSequence"
  8. Drop the row "MsiProcessDrivers"
  9. Save the MSI file.
  10. Verify that the MSI file's modified-date has changed (for some reason Orca sometimes does not save the file)
  11. Run the changed MSI.


After that, the install should work perfectly fine and ask you whether you really do want to install the drivers, even though they're not WHQL certified. Say yes to them all and enjoy using VirtualBox.


Orca MSI Editor: 
http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&sqi=2&ved=0CFUQFjAA&url=http%3A%2F%2Fwww.technipages.com%2Fdownload-orca-msi-editor.html&ei=zxcIUIuiFePs2QWWm5DeBA&usg=AFQjCNGXxLvTAxxEIQiKhNrV3gWCn_paVg



Oracle VirtualBox:
http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html

Friday, May 09, 2008

Mac OSX Leopard & Xnest" OMG-WTF-LOL!

Why, oh why, has my Xnest gone away when upgraded to OSX 10.5? Not that I enjoy running X remotely, from my servers, but on occasion, it's required (thanks, stoopid Oracle and your sh*tty install routine).

If you want/need Xnest on your OSX Leopard desktop, you can accomplish it, this way:

First: Get Xcode: http://developer.apple.com/tools/download/

Second: install MacPorts: http://svn.macports.org/repository/macports/downloads/MacPorts-1.5.0/

Third: Install git, and development tools:

(from teminal window)
sudo port install pkgconfig automake autoconf libtool git-core
Install X.org libraries: (45 minutes)

(from terminal window)
sudo port install xorg-proto xorg-libX11 xorg-libxkbfile xorg-libXfont xorg-libfontenc

Forth: Get X server source from git and build it: see instructions on X.org wiki.

Fifth: Run configure as follows, NOT as how stated on X.org wikki:
./configure --prefix=/usr/X11 --enable-xnest=yes --with-mesa-source=`pwd`/../Mesa-6.5.2

Sixth: Continue with the rest of the source instructions as directed in the wiki page.

Seventh: Copy the new Xquartz binary over, then copy the Xnest binary as well:
sudo cp hw/xnest/Xnest /usr/X11/bin/

Eighth: Copy the manpage:
sudo cp hw/xnest/Xnest.1 /usr/share/man/man1/

That's it. Good luck. I suggest backing up, before doing the above.

Saturday, September 09, 2006

How to restart the OSX Desktop...

Without loging out and back in.

Useful for when desktop "freezes" or you have artifacts (see Macbook) and don't want to kill off background processes.

1. Open up term app

2. ps -aux|grep Graphics

3. Find the following:
windowse 52 0.9 5.6 915688 57592 ?? Ss 11:02AM 0:20.62 /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/WindowServer -daemon

4. then HUP the found process:
sudo kill -HUP 52

52 is the process id tht I found. Yours will be different.

This will restart the GUI, logging you out, but at least you won't have to reboot the whole machine.