Tuesday, September 12, 2017

Setting up thin volume steps


Thin LVM creation steps:


# Creating Virtual disk(loop device) using testlvm file
dd if=/dev/zero of=/root/testlvm.img bs=1024 count=600000

# Link the file created to loop device
losetup /dev/loop1 /root/testlvm.img

   To verify:
   losetup -a


#  Make disk as lvm disk
pvcreate /dev/loop1

Note: use #pvdisplay, #pvscan for physical volume information.

# Create volume group
vgcreate test_VG /dev/loop1

Note: - use vgs, vgdisplay for info .

#  Create a thin LV pool
lvcreate -L 600M -T test_VG/mythinpool

Note: #lvdisplay test_VG or #lvs test_VG for verify

#  Create thin logical volume (LV) out of  LV pool created
lvcreate -V1000MG -T test_VG/mythinpool -n thinvolume

Note: #lvdisplay test_VG or #lvs test_VG for verify.
Note, -V is virtual size and it is more than size mentioned above.

#  Format the LV
mkfs.ext4 /dev/test_VG/thinvolume

# Mount the LV
mount /dev/test_VG/thinvolume /mnt

Refer:
man 7 lvmthin
man 8 lvm
man 8 losetup


Friday, August 18, 2017

s2i scripts override in OpenShift

This  post is about how to override s2i scripts in application source repo. itself.

This way we can avoid to build the builder image again (which is where the build scripts usually present).

Add .s2i/bin/<all your build scripts> in github repo.

Example: https://github.com/SaravanaStorageNetwork/tests2i/

Then you can build like this:
s2i build https://github.com/SaravanaStorageNetwork/tests2i.git nginx-centos7 nginx-centos7-s2i-testing     

Where,
- nginx-centos7 is the builder image already built.
- nginx-centos7-s2i-testing  is the output image.
- https://github.com/SaravanaStorageNetwork/tests2i.git  - repo. having all source files and here it includes .s2i/bin build scripts too.


Note:
1.
if the source is in local directory, you need to specify build scripts using -s option as below:
s2i  build --pull-policy=never --loglevel=2 file:///root/template/s2i-using-s3/examples/nginx-centos7/test/test-app nginx-centos7 nginx-centos7-testapp     -s  file:///root/template/s2i-using-s3/examples/nginx-centos7/test/.s2i/bin/

2.
Ensure LABEL io.openshift.s2i.scripts-url= is removed from builder image Dockerfile.

Friday, August 4, 2017

How long the process is running ?


How long the process is running ?

ps -o etime= -p  <pid of process>



Example:
# ps -o etime= -p 15245
      00:26

Where 15245 is PID of the process we want to check.
it's running for past 26 seconds.

Wednesday, August 2, 2017

thunderbird tip - avoid double spacing


While using Thunderbird mail client, it uses "Double space" instead of single space ( not sure how I ended up like this).

The issue is selecting paragraph as default..if you select "Body text" it will be single space.

To make this default, carry out below:

  1. Go to the main Thunderbird window and select the following from the menu bar -Tools > Options > Composition > General tab,
  2. Uncheck the box that says "when using paragraph format, pressing the enter key creates a new paragraph'.

Monday, July 31, 2017

Get notification at specific time






Run below command in your terminal :

echo ' notify-send "Meeting with Munusamy in 5 minutes" ' | at 1:25PM



echo 'notify-send "Get your tea!"' | at now + 3 minutes

echo 'notify-send "Meeting in 1 hour with the big boss!"' | at 1pm tomorrow 



Commands used:
notify-send [OPTION...] <SUMMARY> [BODY] - create a notification

at and batch read commands from standard  input  or  a  specified  file
       which are to be executed at a later time, using /bin/sh.


source: https://superuser.com/questions/38654/pop-up-notification-when-time-reaches-400pm