unix

How to Securely Wipe the Free Space on Your Mac

Securely Wipe the Free Space on Your Mac Using the Command Line
Before wiping the free space on your Mac using the command line, back up your data.

Once you’ve backed up your data, open the Terminal app from the Applications > Utilities folder.

Then, type the following command at the prompt and press Enter.

diskutil secureErase freespace 4 /Volumes/Macintosh\ HD
Make sure you include “freespace” in the command. This indicates you are only erasing the free space on the drive and not the entire drive.

Log in with an SSH private key on Linux and Mac

This example demonstrates how to use a private key to log in to a Linux server by using a private key by using a Terminal session on OS X. However, you can follow the same process to use a private key when using any terminal software on Linux.

Note: For information about using SSH private keys on Windows operating systems, see Logging in with an SSH Private Key on Windows.

Prerequisites
To complete this process, you need the following software applications:

Mac show hidden files

The long way to show hidden Mac OS X files is as follows:
Open Terminal found in Finder > Applications > Utilities.
In Terminal, paste the following: defaults write com.apple.finder AppleShowAllFiles YES.
Press return.
Hold the 'Option/alt' key, then right click on the Finder icon in the dock and click Relaunch.

swappiness

What is swappiness and how do I change it?

The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.

swappiness can have a value of between 0 and 100

swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible

daemon

a background process that handles requests for services such as print spooling and file transfers, and is dormant when not required.

Frustrating quota error

Everywhere I look for the answer to this I find incomplete threads with no resolution. If cPanel support would like to jump in I will be glad to follow instructions to figure this out.

I've got a Linode VPS running Centos 6.2 and current cPanel Release (WHM 11.30.6 (build 3) CENTOS 6.2 i686 xenpv on server). My cPanel error log is filled with this:

Code:

Fix for file system quotas /dev/root symlink breaks

Last Updated on Saturday, 27 April 2013 03:22pm Written by spunky Saturday, 27 April 2013 03:22pm

This is a solution to a confusing problem when performing quota checks on CentOS 6.x using Linode/Xen.

When you try quotacheck you get this error:
Copy Code

root@server [~]# quotacheck -a
quotacheck: Cannot stat() mounted device /dev/root: No such file or directory

In troubleshooting the solution, you should check to see if “/dev/root” exists:
Copy Code

ll /dev/root

Disable Root SSH Login on Linux

One of the biggest security holes you could open on your server is to allow directly logging in as root through ssh, because any cracker can attempt to brute force your root password and potentially get access to your system if they can figure out your password.

It’s much better to have a separate account that you regularly use and simply sudo to root when necessary. Before we begin, you should make sure that you have a regular user account and that you can su or sudo to root from it.

How to Create a Tar GZip File from the Command Line

You’re probably familiar with making your own zip files if you’ve ever needed to transfer a group of files or if you’re managing your own backups outside of Time Machine. Using the GUI zip tools are easy and user friendly, but if you want some more advanced options with better compression you can turn to the command line to make a tar and gzip archive. The syntax will be the same in Mac OS X as it is in Linux.
Creating a Tar GZip Archive Bundle

From the command line (/Applications/Terminal/), use the following syntax:

tar -cvzf tarballname.tar.gz itemtocompress