VMware Creating RDMs from Locally Attached SATA Disks

LOGO1

I recently had to connect two 4TB sata disks to a server to provide some raw storage to the network. Going on past experiences I didn’t want to virtualise the disks but rather present them to the virtual machine guest as a raw device mapping (RDM).

You will need a separate datastore that is separate to the ones you are attaching. It will have to be VMFS5 to get around the 2TB limit with VMFS3.

Note: This is not supported by VMware to the best of my knowledge.

Procedure

  1. Start a SSH session to the VMware ESX host (or if on the physical server, drop to console)
  2. Run fdisk to see the disk layout.

vmware_esx_fdisk_list
  1. You will need to find the vml identifier, you need to match that to the drive.

VMware_ESX_ls_dev_disks

In my example, the two I am interested in are:

vml.01000000002020202020202020202020205a33303346325742535434303030

vml.01000000002020202020202020202020205a33303351523246535434303030

  1. Now browse to the VMFS5 datastore you will be creating the RDM’s

Browse to RDM location
  1. Best practise would be to create a folder for the RDM’s to sit in

  1. Create the RDM’s by running the vmkfstools command (use the vml. location that you found in previous steps)

VMware_ESX_vmkfstools_RDM
  1. Verify you have the files created

VMware_ESX_RDM
  1. Attach to virtual machine
VMware_Use_Exisiting_Virtual_DiskVMware Select RDMVMware_RDM_AttachedVMware RDM_Physcial_LUN

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.

Limit SSH connections geographically

linux-logo-300x300

There is a real security risk to leaving your shell connection ports exposed to the internet especially if you don’t ever intend on connecting from Zimbabwe as well as other random countries.

This can limit brute force attack exposure and also save valuable resources and bandwidth by rejecting a packets before a tcp handshake.

Install GeoIP

You will need to implement a database that can be queried locally that stores IP ranges to countries.

Query GeoIP database

The script

Past the following in:

Enable script

Lock down SSH

Setup a deny all for the ssh daemon

Add the following into the deny file

Enable the script in the allow ssh file

Add the following into the allow file

Testing

Test the script by inputting the script name and then an IP afterwards

Should output something like the following:

Update GeoIP

There is only one constant with the world and that is change, IP addresses are no exception.

Create a new file called update_geo.sh in /scripts

Add the following into the file

Change the script to execute

Edit the crontab

Paste the following at the bottom of the crontab

Adding Colour to Linux Bash Shell

linux-logo-300x300

If the standard black and grey makes you feel uninspired, you can change this by adding two lines to your .bashrc file in the users profile.

1. Edit the .bashrc file

2. Add the following lines

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.

Install MediaWiki on Apache with mySQL

MediaWiki Logo

From MediaWiki site: MediaWiki is a free software open source wiki package written in PHP, originally for use on Wikipedia.

I decided to give MediaWiki a try as a scripts repository so I thought I’d write a quick guide of how to install it on a Linux/Apache/mySQL server.

Assumptions

  • A fully qualified domain name with a host record pointing to a internet facing server
  • A fully working Linux server (my example is a Debian server)
  • Apache installed on the Linux server and listening on port 80
  • A preconfigured vhost
  • PHP installed
  • mySQL server installed

Installation

1. Download the compressed installation file

wget mediawiki

2. Extract the compressed archive

Extract MediaWiki

3. Copy files from mediawiki-1.23.5 folder to the root folder

MediaWiki CleanUp

4. Create mySQL Database

5.  Create mySQL Database user

6. Grant database permissions to database

7. Flush mySQL privileges

8. Log into the site eg:

http://wiki.example.com

MediaWiki Inital Screen

Click on “Complete the installation”

9. Select the languageMediaWiki Language

10. Click continueMediaWiki Welcome

11. Input all database information

MediaWiki Database Setup

12. Change settings to suit your database requirements

MediaWiki Database Settings

13. Input name of MediaWiki and desired credentials

MediaWiki Name and Credentials

14. Configure options for your MediaWiki

MediaWiki Options

15. Install MediaWikiMediaWiki Install

16. Installation completeMediaWiki Installation Finished

17. Download and copy the LocalSettings.php file to the root of the MediaWiki installationMediaWiki LocalSettings

18. Browse to your MediaWiki installation and log in

Example: http://wiki.example.com

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.

Browse websites in a Linux terminal

linux-logo-300x300

I stumbled upon a package that allows the user to browse websites in a terminal, I thought I’d spin up a VM and try this for myself…

Installing W3M

This is very simple, requires one package (two if you want images displayed in Xterm)

Browsing

Now this isn’t going to look pretty as it’s in a terminal but it will work

w3m

w3m google.com

Navigation

You can use the arrow keys to navigate to the section you want or use the mouse to click on the particular area.

shift+ b = Take you back a page

shift + u = Gives you a URL prompt

Shift + h = Help menu

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.