Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Friday 29 September 2017

Working with PuppetLabs Using Vagrant


While working as DevOps Engineer one of the tools by definition that we use more, often is Puppet. Guess most people will think that you are 100% expert, which is not always the case. So, I need to create this post and track record of my own experiments with Puppet and (PuppetLabs + Vagrant)

You might as what is Vagrant ?
==> "Vagrant is an open-source software product for building and maintaining portable virtual software development environments, e.g. for VirtualBox, Hyper-V, Docker, VMware, and AWS. ... Vagrant simplifies the necessary software configuration management in order to increase development productivity. " read more here: https://www.vagrantup.com/intro/index.html

The initial indentation was to gain better understanding puppet file structure. So, I decided to use Puppetlabs for this ...
















So, basically. I did create installed

  • Installed Vagrant
  • Used the Vagrant init command to pull the puppetlabs ubuntu VM
  • Which created a file "Vagrantfile"
  • created a dir puppetlabs


And then started the Setup, so here are the Logs ..

Tdls-Air:puppetlabs psalms91$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'puppetlabs/ubuntu-16.04-32-puppet' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: 1.0.0
==> default: Loading metadata for box 'puppetlabs/ubuntu-16.04-32-puppet'
    default: URL: https://vagrantcloud.com/puppetlabs/ubuntu-16.04-32-puppet
==> default: Adding box 'puppetlabs/ubuntu-16.04-32-puppet' (v1.0.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-16.04-32-puppet/versions/1.0.0/providers/virtualbox.box
==> default: Successfully added box 'puppetlabs/ubuntu-16.04-32-puppet' (v1.0.0) for 'virtualbox'!
==> default: Importing base box 'puppetlabs/ubuntu-16.04-32-puppet'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'puppetlabs/ubuntu-16.04-32-puppet' is up to date...
==> default: Setting the name of the VM: puppetlabs_default_1506687306250_65705
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 5.0.20
    default: VirtualBox Version: 5.1
==> default: Mounting shared folders...
    default: /vagrant => /Users/psalms91/Vagrant_VM/puppetlabs
Tdls-Air:puppetlabs psalms91$

Tdls-Air:puppetlabs psalms91$ vagrant ssh

Welcome to Ubuntu 16.04 LTS (GNU/Linux 4.4.0-21-generic i686)

 * Documentation:  https://help.ubuntu.com/

vagrant@localhost:~$

After this I have my Puppet Labs VM running ... After this point was easy, I just needed to goo into the puppet installation dir and look into the dir structure.


done.. :-)

Tuesday 21 May 2013

How to Code in Python 3 metaprogramming!

Some of the most significant changes in Python 3 are related to metaprogramming. In this tutorial, I'll cover decorators, class decorators, descriptors, and metaclasses. However, the focus will be on idioms and examples that are only....


Friday 29 March 2013

XAMPP: Another web server daemon with SSL is already running

This is a peculiar error you will get if you run XAMPP in LINUX.



Assumption: XAMPP is unzipped @ /opt/ folder.

If you get the error "XAMPP: Another web server daemon with SSL is already running" when you run "./lampp start". Simply follow the steps below to get rid of this error:

1. Open the file /opt/lampp/etc/httpd.conf
2. Search the "Listen 80" and change it to some other port (e.g. Listen 2145)  (Line No. 40)
3. Open the file /opt/lampp/etc/extra/httpd-ssl.conf
4. Search the "Listen 443" and change it to some other port (e.g. Listen 16443) (Line No. 39)
5. Open the file "/opt/lampp/lampp"
6. Search for the port "testport 80" and replace it to "testport 2145". Also change the "testport 443" to "testport 16443". (Happens to be the Line No. 197, 214)
7. Now go and run "/opt/lampp/lampp start". (It should work now).




Hope this Helps :-)

Friday 12 October 2012

md5sum.exe introduction


After you download all the Shorten (.shn) files for a particular disc or show, you want to verify that the files are not corrupted or otherwise unusable before you burn them to disc or host them on your file server. We do this by checking the downloaded Shorten (.shn) files against an .md5 file. An .md5 is a simple text file that contains a "fingerprint" of each Shorten file.


When you perform an md5 check, you are comparing the fingerprint from the files you downloaded to the fingerprint of the files on the server you downloaded from. If the md5's (fingerprints) match, you have an uncorrupted Shorten file.



 md5sum.exe - 48KB         88170 Downloads since 9/29/00



  • Windows 95/98/Me: Download md5sum.exe to c:\windows\command

  • Windows NT/2000: Download md5sum.exe to your c:\winnt\system32
  •  

    Open an MS-DOS window and go to the directory of the show you want to check. When you are in that directory, type:
    md5sum -c [filename].md5
     
    You must insert the name of the .md5 file [without the brackets]. Below is an example of a successful md5sum check:
     
     
    On the other hand, if a track does not pass the md5check, you will see the following:
    If any Shorten files do not pass the .md5 check, you should delete the offending file(s), and try re-downloading. Then run the .md5 check again. The file(s) should now pass the .md5 check.

    If the same files fail an .md5 check more than twice, you should contact the FTP Siteop you downloaded the files from and let them know what tracks are giving you a problem. They may be hosting a corrupted track without knowing it.

    Open an MS-DOS window and go to the directory of the show you want to create an .md5 file for. When you are in that directory, type:

    md5sum *.shn > [filename].md5
     
    NOTE: You must insert the name of the .md5 file [without the brackets]. Example:
     
    md5sum *.shn > ph94-06-26d1.md5

    An .md5 file will be created and placed in that directory. Please remember to adhere the etree.org naming scheme when naming .md5 files!

    Please remember to always .md5 check your Shorten files before burning!
      

    Special thanks to bruce@gridpoint.com and the PCP community for compiling this special version of md5sum. Documentation and graphics by Mike Wren.


     

    Sunday 7 October 2012

    Code - breaking ( PHP programming ) Warming up

    For some time I've developing stuff in PHP .. Like experimenting stuff Its a very interesting language
    to experiment with .. As it is the same with Java, Python, PHP, C++ and Ruby&Rails ....


    Today, I felt like talking about php .. One, think there is one important think to say to anyone willing to learn and programm in PHP, for you to run and develop php on your computer, its  necessary to have a server running on the machine that will be used to develop and write the php code ..


    It might sound quite complicated but its very simple ...To setup a server on your own computer just download Xampp for Windows, LAMP for Linux, or MAMP for Mac OS (Apple).

    After your download it and install it and run properly the server you will able to see you php files via-localhost on your browser. This post isn't about how to install your server and run the localhost .. But I can explain it on another post .. For now, lets just focus on PHP coding.

     The simple and first thing on any programming language is the

     "Hello World"

     "
    <html>
    <head>
    <title> Test PHP </title>
    </head>
    <body>
    <?php
    echo " Hello World ! ";
    ?>"
    </body>
    </html>
    "
    That's it simple ....

    O Browser will see somethink like this;


    Mastering Docker Minified Systems: A Step-by-Step Guide with Real Use Cases

    Introduction Docker is a powerful platform for developing, shipping, and running applications. Minified Docker systems are optimized for siz...