Tuesday, December 4, 2018

VM issues on copying


dracut --regenerate-all --force


Virtual create vboxnet0 on mac os
VBoxManage hostonlyif create

Extending disk size of vmware disk

  1. Power off the virtual machine.
  2. Edit the virtual machine settings and extend the virtual disk size. For more information, see Increasing the size of a virtual disk (1004047).
  3. Power on the virtual machine.
  4. Identify the device name, which is by default /dev/sda, and confirm the new size by running the command:

    # fdisk -l
  5. Create a new primary partition:
    1. Run the command:

      # fdisk /dev/sda (depending the results of the step 4)
    2. Press p to print the partition table to identify the number of partitions. By default, there are 2: sda1 and sda2.
    3. Press n to create a new primary partition.
    4. Press p for primary.
    5. Press 3 for the partition number, depending on the output of the partition table print.
    6. Press Enter two times.
    7. Press t to change the system's partition ID.
    8. Press 3 to select the newly creation partition.
    9. Type 8e to change the Hex Code of the partition for Linux LVM.
    10. Press w to write the changes to the partition table.
  6. Restart the virtual machine.
  7. Run this command to verify that the changes were saved to the partition table and that the new partition has an 8e type:

    # fdisk -l
  8. Run this command to convert the new partition to a physical volume:

    Note: The number for the sda can change depending on system setup. Use the sda number that was created in step 5.

    # pvcreate /dev/sda3
  9. Run this command to extend the physical volume:

    # vgextend VolGroup00 /dev/sda3

    Note: To determine which volume group to extend, use the command vgdisplay.
  10. Run this command to verify how many physical extents are available to the Volume Group:

    # vgdisplay VolGroup00 | grep "Free"
  11. Run the following command to extend the Logical Volume:

    # lvextend -L+#G /dev/VolGroup00/LogVol00

    Where # is the number of Free space in GB available as per the previous command. Use the full number output from Step 10 including any decimals.

    Note: To determine which logical volume to extend, use the command lvdisplay.
  12. Run the following command to expand the ext3 filesystem online, inside of the Logical Volume:

    # ext2online /dev/VolGroup00/LogVol00

    Notes:
    • Use resize2fs instead of ext2online if it is not a Red Hat virtual machine.
    • By default, Red Hat and CentOS 7 use the XFS file system you can grow the file system by running the xfs_growfs command.
  13. Run the following command to verify that the / filesystem has the new space available:

    # df -h /


The OP stated that he was using the XFS filesystem. The tool resize2fs works with ext2, ext3 and ext4 only.
There's a similar tool available for the XFS filesytem called xfs_growfs. You'll most likely have to install it first
sudo yum install xfsprogs.x86_64 --assumeyes
then mount your filesystem
sudo mount -t xfs /dev/sdf /vol
now you can extend the filesystem
sudo xfs_growfs /vol
df -h should now show more available space
I hope this helped :)
Tip: ext4 filesystem is the recommended filesystem for EBS volumes ( for the future )

Monday, April 3, 2017

Print full string in gdb

To print full string in gdb run the following in gdb

set print elements 0

Tuesday, May 31, 2016

Unix utilities

Rename all files which contain rc to deployment

ls * | sed -e 'p;s/rc/deployment/' | xargs -n2 mv

Monday, December 14, 2015

Deleting docker images based on condition or filter

I posted about deleting docker containers and deleting images.Sometimes we need to clean only some images based on a condition.

I am adding to commands to delete untagged images.You can grep on any value you like.

#Deleting untagged images
docker rmi $(docker images | grep none | awk '{print $3}')

Saturday, December 12, 2015

Difference between role and cookbook in chef

A role may be made up of one of more cookbooks whereas cookbook is a single entity made up of recipes.

So roles can be used to simplify run lists.
Instead of providing a run list with all the cookbooks a role can be provided.

{
 run_list : [
    "role[test]"
 ]
}

can be used instead of
{
 run_list : [
    "recipe[test1]",
    "recipe[test2]",
    "recipe[test3]"
 ]
}

Difference between ADD and COPY in docker

The commands for deleting the containers and images are
The major difference is that ADD can do more than COPY:
  • ADD allows the source to be an URL
  • Also If the  parameter of ADD is an archive in a recognised compression format, it will be unpacked

Friday, December 11, 2015

Remove docker images and containers

When we use docker we end up running a lot of containers and creating a lot of images

The commands for deleting the containers and images are

#docker stop all containers
docker stop $(docker ps -a -q)

#docker remove all containers
docker rm $(docker ps -a -q)

#docker remove all images
docker rmi $(docker images -q)

Wednesday, September 23, 2015

Getting started with UNIX - Basic commands


List of basic commands of unix

reboot - Immediately stops all running processes, shuts down the system, then reboots.
sudo - Runs commands as root, which means no limitations due to permissions.

shutdown - Stops all running processes and shuts down the system.
Parameters can be specified to issue a delayed shutdown or a shutdown at a particular time.

date - Prints out the current system date and time.
Specified parameters can change the format of the output.

df - Reports the disk space usage for the file system.
hostname - Displays the name of the current host system.
ps - Displays information about all of the processes currently running on the system.
du - Disk usage
ps - List running processes

To know the process id of a process running
 ps -elf | grep process_name
 ps -fA | grep process_name

| -> pipe character is very useful for redirecting output of one command to other
 grep is used to find the pattern

To create a file
 cat filename
 touch filename

To search something in a file
 grep -i thing_to_be_searched filename

To search something across directories
 grep -rn pattern_to_be_searched directory_starting_from_where_search_to_be_started 

To view processes along with the memory they are consuming run
 top
Ctrl + M will sort in decreasing order of memory consumption

chmod / chown - Changes the access permissions of one or more files (chmod) or
changes the ownership of a particular file to a new user (
chown).
Only users with permission or ownership of a file can change that file’s permissions or ownership.

chown owner_name filename
chmod 755 filename  

Here 7 is the permission for owner
5 and 5 for group and others respectively

7 - xrw
5 - xr
2-r
4-x
1-w

Access permissions are of three types
 x Execute permissions (4)
 r Read permission (2)
 w write permissions (1)

Aur linux has concept of owner, group and others.

Owner is the owner of the file
Every file or directory belong to a group
And third is others(not owner and not belonging to the group of the file)

Permissions are in the order Owner permissions Group permissions  others permissions

Wednesday, February 12, 2014

How to know the hostname of your system

Here is a step by step guide on how to achieve this

1) Press Windows + R and type cmd then press Enter or search for cmd by pressing Windows key

2) In the command prompt type hostname and you will get your the hostname of the system














Enjoy :)

Tuesday, February 11, 2014

How to set an animated .gif as the desktop background

Many a times we want to do something different like making the laptop/system background using a gif image

GIF (Graphics interface format)
The Graphics Interchange Format (better known by its acronym GIF/ˈdʒɪf/ or /ˈɡɪf/) is a bitmap image format that was introduced by CompuServe in 1987[1] and has since come into widespread usage on the World Wide Web due to its wide support and portability

A sample gif is shown below















See this utility
Bonix Desktop Wallpaper Changer

BioniX Wallpaper Changer is the world's famous wallpaper changer that allows you to fully take control over your desktop. It is the choice of millions of users all over the world and winner of multiple awards from renowned reviewers and critics.

Use and give comments regarding the post.

Enjoy

Download Flappy bird apk and cheat

After a few days the app became a mystery to solve and created a sensation the epic game was removed from the play store.The app became a sudden hit after some 8 months after it's official launch in May-2013 and it's first update in Sep-2013

Here are some of the screenshots of flappy bird game





Since it has been removed from the play store the download link is provided below
https://adf.ly/dQLOC

Also if you find the scoring difficult you can download flappy bird cheat from here
https://adf.ly/dQLWV

Please provide suggestions,if any more apk are needed

Happy gaming

Sunday, February 9, 2014

Getting the MAC address on your Windows 7 system

What to do when we want to know the MAC address of a system????

Here is a step by step guide on how to achieve this

1) Press Windows + R and type cmd then press Enter or search for cmd by pressing Windows key

2) In the command prompt type getmac and you will get your mac id








Alternatively you can enter ipconfig /all and get the mac address

Monday, November 11, 2013

How to disable CD Drive auto eject

Most of the people have problems due to their CD Drive eject button as it is very sensitive and is triggered very easily due to it's poitioning. It gets triggered often while putting it in a bag, carrying it from one room to another.

I have found a program which is freely available which locks the CD Drive eject button and retains it even after sleep.

 It is freely available at http://sourceforge.net/p/lockcd/wiki/Home/




Words from the developer

LockCD program disables CD-ROM's eject button. It runs in the system tray and identifies itself by a red icon, which drops a menu on the right mouse click or shows Main UI on the left click. LockCD can also be accessed from the Explorer Context Menu by right-clicking on the CD-ROM icon.
This application was written after giving up on finding a properly functioning software that would lock CD-ROM's eject button on my Lenovo T520 laptop, which i hit quite frequently. The main problem with the software available on the internet is that it doesn't retain the lock state after Sleep/Hibernation/Resume.
This application is based on .Net 4.0 framework, so make sure its runtime is installed on your PC.
Send your feedback to: lockcdfeedback@gmail.com
Current version of LockCD is 1.2


Tuesday, January 17, 2012

Printer Friendly version of a web page

Friends few months back i posted a link to save a webpage into pdf format http://manuthegem.blogspot.com/2011/09/save-web-pages-in-pdfformat.

However it prints a web poage cluttered with web ads hence affects the reading adversely.So we got a webpage which saves a page in pdf format after removing all the ads from the webpages.You can try it at
http://www.printwhatyoulike.com/

printwhatyoulike website


Just type the url in the box shown above and you will get a clutter free webpage in pdf format.Hope you like it

Saturday, January 14, 2012

Enable administrator account in Windows Vista

To enable administrator account in Vista to get rid of annoying UAC(User Account Control)
The steps are:

*Click on start menu
* Type "cmd" on search bar
* Select cmd, right click and select "Run as Administrator" option
* Now in cmd prompt
    type: 'net user administrator /active:yes',
    then press enter
Now you have activated the admin account.

To disable

* Just type: 'net user administrator /active:no'
* press enter

Saturday, September 24, 2011

Save web pages in PDF Format

If you’re looking for a quick way to save a webpage for offline viewing, then I suggest checking out PDFmyURL. Just go to http://pdfmyurl.com/, and put the address of the site you want to save in the box…






Just click on the P button on the right hand side and get the pdf file of the desired web page
or if you want a pdf convertor on your machine then download software dopdf from the given link
http://www.dopdf.com/download.php

Saturday, April 23, 2011

How to download google chrome offline Installer

Just follow the link below
http://www.google.com/chrome/eula.html?standalone=1&hl=en

This will take u to a page as shown below

Clicking on the Accept and Install button takes you to the next screen




Just save the file and then install it from the downloaded location


However, the Offline installer has a pitfall.Google installs a service called Google Updater Service if you install Chrome online. However, if you install it using the offline installer, the update service might not be installed. This means, your Google Chrome will not update automatically.You have to update it manually

Friday, April 15, 2011

System Restore using SAFE MODE with command prompt

When system is not able to boot properly then to restore system proceed as following


Select safe mode with command prompt as shown in the image

For Windows Xp 
enter 
%systemroot%\system32\restore\rstrui.exe and selectEnter.


For Windows 7 and Vista
Just enter rstrui.exe and press enter


After it the system will start to work properly

Wednesday, April 13, 2011

Know how long your computer is ON

For Windows Vista and Windows 7
Open Taskmgr(Press Cntrl+Alt+Delete or Cntrl+Shift+Esc)
Click on the Performance Tab
On the right side under System see Up Time
For Windows Xp
Open Command Prompt(Windows +R then write cmd and press enter)
Write systeminfo and press enter
See the up time