How to mount a directory from Windows to VirtualBox?  

Wednesday, December 18, 2013

Pre-requisite:
You must have installed the "Guest Additions" before you can configure this drive mounting.


1. From the Devices menu, choose Shared Folders… and add any folder or drive. Make sure that the Make Permanent checkbox is ticked. For example, add C:\VirtualBox with the name VirtualBox.  
2.  Create the directory to mount the shared folder on:
      - mkdir /home/alexy/shared
3.  Mount the directory
      - sudo mount -t vboxsf VirtualBox /home/alexy/shared
4.  To mount this every time linux boots, edit the file /etc/rc.local and put the following line at the start:  
     - sudo mount -t vboxsf Linux /home/alexy/shared
     


AddThis Social Bookmark Button
Email this post


Run a Process in the Foreground or the Background  

Sunday, November 11, 2012

To run a process in the background:
[command]  &

To suspend a foreground process and place it in the background, use the following steps:

  1. Press CTRL+Z
  2. Enter: bg 

To bring this background process to the foreground again,
  1. enter: fg

AddThis Social Bookmark Button
Email this post


How to customize BASH profile?  

If you wanted to customize your .profile, .bashrc or .bash_profile, visit this link, awesome references:

http://stefaanlippens.net/my_bashrc_aliases_profile_and_other_stuff

or

http://www.linuxfromscratch.org/blfs/view/6.3/postlfs/profile.html


Changing directory colors:
http://www.geekgumbo.com/2011/11/04/changing-the-directory-color-in-the-bash-shell/


AddThis Social Bookmark Button
Email this post


How to use vlookup for microsoft Excel?  

Monday, July 2, 2012

Wondering how to use vlookup to search for a value?

Scenario 1:
Search a target cell to find out the existance from another column.


In the example above, we use the formula

=VLOOKUP(D3,B:B,1,FALSE)

we are searching cell D3 ('C') against column B (B:B), if exist, return value from B#, FALSE is to find exact match.


Scenario 2:
Search a target cell E8 ('D') against column B8:C10, if exist, return the value from column C.

=abs(h8-f8) to get the differences. ABS value of 0 means E9 value of 5 equivalent to B9 value of 5.


AddThis Social Bookmark Button
Email this post


How to customize PS1 prompt in BASH?  

Monday, October 18, 2010

Edit your .bashrc

export PS1="[\u@\w]\n>"

output:
[ubuntu@~/temp]
>



Relevant info: http://www.understudy.net/custom.html#Korn

AddThis Social Bookmark Button
Email this post


How to customize PS1 prompt in KSH?  

eg:

>[/current/dir] >
>
>I'd like it to be:
>[/current/dir]

edit your .profile

export PS1=[`hostname`:'$PWD]^V^J
>'
where ^V is control-V and ^J is control-J to accomplish this.

AddThis Social Bookmark Button
Email this post


How to replace ^M in unix to nothing?  

Monday, May 3, 2010

If you saw a lot of ^M character in your code, reason being is ^M is the character in DOS if you create the file in Windows.

If you transfer the DOS file into unix, you will see lots of ^M in your file and it is very irritating indeed.

You can do a simple magic in vi by

:%s/[crtl-v ctrl-m//g

meaning,
%s - substitute
[ctrl-v ctrl-m] - create the ^M character
// - empty
g - replace globally

AddThis Social Bookmark Button
Email this post


Design by Amanda @ Blogger Buster