• The Job Title Generator for Information Technology

    gandalf_new1Right now its a toss up between “Server Warlock” or “Linux Wizard” for the next printing of my business card.

    http://www.sisense.com/title-generator/information-technology/

  • Redhat Satellite 5: How to Clone Security Errata to a Software Channel

    space_dogFirst check to see if the errata is available to your local satellite server. To accomplish this log into your organizations satellite server and click on the “Errata” tab. Then on the left side of the page click on “Advanced Search”.

    In the search box enter the RHSA number (Redhat Security Advisory Number) for the errata that you want to clone/update. In this example I am searching for RHSA-2014:1924, which is a Thunderbird security update.

    If your search does not return any results, you will need to manually sync your local Satellite Server with Redhat.To accomplish this you need to ssh into your local satellite server and run the command shown below. Note that this does not update any packages/errata. This does update the list of availbile packages/errata.

    /usr/bin/satellite-sync
    [root@myserver ~]# satellite-sync –email
    10:08:09 Red Hat Satellite – live synchronization
    10:08:09 url: https://satellite.rhn.redhat.com
    10:08:09 debug/output level: 1
    ….truncated….

    Once you are able to locate the specific fix in via “Erratum Search” you may proceed to the next step. In this example, as I stated above, I am searching for RHSA-2014:1924.

    clone_erratta

    Now that our local Satellite server is aware of our specific errata, click on “Clone Errata” on the left side of the page. Search the page “Errata Management” for the specific fix that you want to apply. Note that the “Errata Management” page does have built in search functionality — don’t ask me why — so you must search using your browser’s own page search function.

    clone_thunderbird

    Once you have located the correct Security Advisory, put a check in the box and spend about 5 minutes scrolling down to the bottom of the page. Stop when your arm is tired, or once you locate the “Clone Errata” button. Obviously you want to click this.

    Note that your newly added and updated errata/package may not become immediatley availible to install. You nay need to run the following commands to refresh/reload your repos.

    #yum clean all

    Then check for updates with the command below.

    #yum check-update

  • How to Reset Cisco Catalyst 3750 Back to Factory Defaults

    Need to reset your Cisco Catalyst 3750 back to the factory default settings?

    Have you forgotten your password? Well you have come to the right place. Note that I am assuming that you have already established a console connection to the switch using a Cisco serial cable (rollover cable).

    First you need to power down the switch. Once the switch is powered off, hold down the mode button, and power the switch on. The switch will boot up and you should see the switch prompt as shown below.

    Connect-1

    Now type flash_init. Your output should be similar to what you see below

    switch: flash_init
    Initializing Flash…
    flashfs[0]: 547 files, 19 directories
    flashfs[0]: 0 orphaned files, 0 orphaned directories
    flashfs[0]: Total bytes: 32514048
    flashfs[0]: Bytes used: 15487488
    flashfs[0]: Bytes available: 17026560
    flashfs[0]: flashfs fsck took 11 seconds.
    …done Initializing Flash.

    Check out the contents of flash and locate config.text and vlan.dat (if it exists).

    switch: dir flash:
    Directory of flash:/
    
    2  -rwx  564       <date>               vlan.dat
    3  -rwx  1914      <date>               private-config.text
    5  drwx  192       <date>               c2960-lanbasek9-mz.122-58.SE2
    6  -rwx  3096      <date>               multiple-fs
    7  -rwx  2289      <date>               config.text

    Now delete the vlan.dat and config.text.

    switch: del flash:config.text
    Are you sure you want to delete "flash:config.text" (y/n)?y
    File "flash:config.text" deleted
    
    switch: del flash:vlan.dat
    Are you sure you want to delete "flash:vlan.dat" (y/n)?y
    File "flash:vlan.dat" deleted

    Note that you can also just rename the config.text and vlan.dat if you are not certain that you want to delete them.

    switch: rename flash:config.text flash:config.old

    Now type boot, to reboot the switch. Once the switch is rebooted you will see the System Configuration Dialog, and will have the opportunity “to enter the initial configuration dialog”.

  • Getting Started With Puppet: How to Write Your First Module

    1361349665_puppet-logoThis post will walk you through the process of writing your first, albeit, a very simple Puppet module. Nothing fancy here, that can come later once we get the basics down.

    Before we get started let’s take a minute to go through a couple of prerequisites.

    First, we will assume that you are doing your work some sort of Linux workstation or server. Second, we will assume that you have already installed and configured a Puppet Master and a Puppet Client. In this particular case, I am working on my Fedora 20 desktop. It serves as both my master and client. Last, we are assuming that have a basic site.pp and are able to run the Puppet agent without issue or error.

    Now lets get down to the meat and potato. Note we are working with opensource Puppet, not Puppet Enterprise.

    First lets change directory to our Puppet module directory.

    #cd /etc/puppet/modules/

    Now lets create a basic manifest from a template, to do this we need to generate a module. Our very simple module is going to be called harden-cron. Run the command below to generate our bare-bones module

    #puppet module generate harden-cron

    Now that our module has been generated lets change directories once again. This time we need to change to the manifests directory in our newly created module.

    #cd harden-cron/manifests/ && vim init.pp

    Now we need to edit our manifest. This is, more or less, our playbook. It defines what “work” puppet needs to do.

    Our end goal is to create a manifest that will ensure that /etc/cron.allow exists, is owned by root, and has specific file permissions. We also need to make sure that /etc/cron.deny does not exist. In order to accomplish this we use the simple code shown below. Note that we have defined our class has “harden-cron”. This is the same name that we used when creating our module above.

    [code language=”css”]

    class harden-cron {

    file {"/etc/cron.deny":
    ensure => absent,
    }

    file {"/etc/cron.allow":
    ensure => present,
    owner => "root",
    group => "root",
    mode => "600"
    }
    }

    [/code]

    Now we need to test our syntax and make sure that we have not made any errors. Use the command below to accomplish this. No output from the script below means that you do not have any syntax errors.

    #puppet parser validate init.pp

    Excellent, so now we have a new module, but its not going to do anything for us until we declare it in our site.pp. So lets change directories and do a bit of editing

    # cd /etc/puppet/manifests/ && vi site.pp

    (more…)

  • Working with Git — How to Clone and Fork a Git Repository

    git_squid_catSo as I have stated before, I am still very new to Git. I know just enough to do a few basic tasks, but nothing much more advanced than that.

    Thankfully, the process of cloning a remote Git repository is actually rather simple once you know what you are doing. Forking a repo is just as easy. Again, once you know what you are doing. Below I am going to walk you through the steps in a very simple and easy to understand way.

    Cloning a Remote Repository

    First lets change to a directory that we want to use as a landing zone when we download — or more accurately — clone a remote repo.

    #cd /root && mkdir git

    Now using the remote git URL, lets clone the fatmin github master repo @ https://github.com/Fatmin/general.git. Note that the destination of general.git name of our remote repo.

    #git clone https://github.com/Fatmin/general.git

    This creates the directory “general” which contains all the downloaded files, scripts, and code that we have previously checked in to our github repo. This command also initializes our pwd as a Git repo… no need to run Git init.

    Forking a Remote Repository

    Now lets say that we want to make a fork of the fatmin master repo. For example, lets say that we are working on a new puppet module and want to be able to test it out and then push to a new branch that we have decided to call testing.

    First we need to create a new local branch. We accomplish this with the command below. As stated above, our branch is called testing.

    #git checkout -b testing

    Now lets grab our puppet module, script, file, code, what have you, and move it into our pwd of /root/git.

    Note that even though our file is now located inside our cloned and branched repo, we need to tell Git to add it to the repo with the command below. This command will add any new files or directories in our newly created local repository.

    #git add .

    Now we need to commit the changes in our local repo. Here we are adding a comment along with our commit. Then we are pushing our changes back up to the remote origin (https://github.com/Fatmin/general.git) into a new branch called testing.

    #git commit -m “pushing scripts to testing branch” && git push origin testing

    Once we are happy with our changes, or whatever, we can then log into github and approve the merge between our master branch and our testing branch.

  • How to Add a Static Route on the ASUS RT-AC66U

    ASUS_RT-AC66U_newsBased on the popularity of my previous ASUS RT-AC66U post regarding SNMP, I have decided to put together a simple post on how to configure static routing on the home router known as the Dark Knight.

    In my humble abode, the RT-AC66U is the core of my home network, providing DHCP and Wireless to a plethora of devices. However, I am also running a small home lab which I need to be able to access from my home desktop. Hence the need for static routes.

    Specifically, my home lab hosts the following networks; 10.1.0.0/24, 10.2.0.0/24, 10.3.0.0/24. The IP address of my ASUS RT-AC66U is the default one of 192.168.0.1. My desktop is on the 192.168.0.0/24 network.

    In order for me to access my lab from my desktop (and from the rest of my home network), I need to tell my ASUS how to route traffic destined for my 10. networks.

    In order to accomplish this, we first need to navigate to LAN on the left pane, and then selecting the Route tab.

    static_routes_asus_rt-AC66u

    As shown in the screenshot above, we first need to select the “YES” radio button to “Enable Static Routes”. Next we enter a network ip (or static ip — if that’s what we are up to) into the “Network/Host IP “field. Then we enter our netmask into the field that is not surprisingly labeled “Netmask”. In my case my netmask is 255.255.255.0.

    Now we move on to the field labeled “Gateway”. Here we need to enter what the next network hop for that a packet that is needs to route to our lab network. In my environment, this is 192.168.0.11, which is another router.

    Then select “LAN” from the drop down as all our traffic will route to the internal LAN only, and not out to the internet or WAN. Now click the plus sign to add your new route.

    Now when a packet destined for one of my lab networks outlined above hits my ASUS router, it will be forwarded to 192.168.0.11, which is my lab router.

    Note that you can also add static routes via the busybox command line, however I am not going to go into that today. Its simple enough to add them in the WebUI.

  • Getting Started With Git and Github on Fedora

    Git-Icon-1788C

    This post is going to be a very simple overview of the steps that you need to follow to get started with Git and Github on Fedora. Nothing fancy here at all, just the basics of what you need to know so that you can get up and running with pushing and pulling code. Note that these instructions assume that you have installed the Git client already, and that you are running a Linux based desktop distro with the KDE desktop environment (yes, I know that’s redundant).

    Creating Your First Repository

    So this is a pretty simple process. First you are going to want to navigate to https://github.com in your browser. Once there you need to go ahead and create a free account. Create a Username and Password.

    github_singup

    Once you have completed the steps required to create a new account, and have chosen your account type (free – right?) you then need to create a New Repository. Just click on the green button on the right hand side of the page. You will need to choose a name for your new repository. Select “Initialize this repository with a README” to seed your repo so that you can perform your first clone procedure.

    create_new_repo

    Since we are down to the business of keeping things simple, let’s say that you have created the user Fatmin, and that the repository that you created is called test. This would have created the repository at the following URL – –https://github.com/Fatmin/test.git.

    (more…)