Wednesday, January 27, 2016

"I moved it" v.s. "I copied it"

http://www.experts-exchange.com/articles/12515/HOW-TO-Select-the-right-answer-to-I-Moved-It-or-I-Copied-It-in-VMware-vSphere-ESXi.html

I Moved It - should be used only, when you are manually moving a virtual machine between datastores, which includes moving to a new host and different datastore.

I Copied It - should be used when you want to COPY or CLONE a virtual machine, and used on the network at the same time as the original virtual machine.

Now that you have read, and hopefully understand the difference between "I Moved It" or "I Copied It" selections, I'll answer the question raised at the beginning

I've selected Copied, and now all My IP addresses have changed! Why?

As we've seen above, selecting "I Copied It" changes the uuid.bios and uuid.location values, which will force and generate a new MAC address. If you have been using DHCP (Dynamic Host Configuration Protocol) to supply IP Addresses to your computers on your LAN, your virtual machine will receive a new IP Address, after this change.

I hope this article helps you to understand the difference between "I Moved It" or "I Copied It" when you have moved or copied a virtual machine.

Friday, January 8, 2016

Compress on Mac using Terminal

If we right click the folder and then compress. The .zip may not be able to work across platforms (e.g., open it on Windows). We can use the terminal to compress files or folders.

http://coolestguidesontheplanet.com/how-to-compress-and-uncompress-files-and-folders-in-os-x-lion-10-7-using-terminal/

ZIP – Cross Platform

First up is ZIP one of the most commonly used compression techniques used across all platforms
To compress
zip -r archive_name.zip folder_to_compress
To extract
unzip archive_name.zip
If you want to make a zip without those invisible Mac resource files such as “_MACOSX” or “._Filename” and .ds store files, use the “-X” option in the command so:
zip -r -X archive_name.zip folder_to_compress

TAR.GZ – Cross Platform

Second up is TAR, an old favourite on Unix/Linux – you add the GZ for the compression – compresses tighter than zip
To compress
tar -zcvf archive_name.tar.gz folder_to_compress
To extract
tar -zxvf archive_name.tar.gz

TAR.BZ2 – Cross Platform

A variation on TAR GZ but with better compression than both tar.gz and zip.
To compress
tar -jcvf archive_name.tar.bz2 folder_to_compress
To extract
tar -jxvf archive_name.tar.bz2

GZ

Without the tar
To extract


gunzip archivename.gz

Thursday, January 7, 2016

Turn off ASLR

http://askubuntu.com/questions/318315/how-can-i-temporarily-disable-aslr-address-space-layout-randomization

According to an article How Effective is ASLR on Linux Systems?, you can configure ASLR in Linux using the /proc/sys/kernel/randomize_va_space interface.
The following values are supported:
  • 0 – No randomization. Everything is static.
  • 1 – Conservative randomization. Shared libraries, stack, mmap(), VDSO and heap are randomized.
  • 2 – Full randomization. In addition to elements listed in the previous point, memory managed through brk() is also randomized.
So, to disable it, run
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
and to enable it again, run
echo 2 | sudo tee /proc/sys/kernel/randomize_va_space
This won't survive a reboot, so you'll have to configure this in sysctl. Add a file /etc/sysctl.d/01-disable-aslr.conf containing:
kernel.randomize_va_space = 0
should permanently disable this.

http://www.2cto.com/os/201212/178306.html

If you use VIM or VI to change the value, it will have following error message:

 "/proc/sys/kernel/randomize_va_space" E667: Fsync failed
 Press ENTER or type command to continue

 Why:U cannot edit the  /proc files with  vi  . if u want 
 to change its value u can  echo to that file  like 
 echo "20000000" >   /proc/sys/kernel
======================================
 # echo 0 >/proc/sys/kernel/randomize_va_space 
 # more /proc/sys/kernel/randomize_va_space 
 0
=====================================