Jun
21
2017
0

Automate Git Repository Setup with Python & Fabric

I love Git.  I find Git to be an intuitive way to track many versions between many systems.  Now all my default config files and scripts utilize Git.  However, logging into a server and creating the Git repo, then cloning it is a number of steps that detracts from getting work done.  

This tutorial outlines a basic example of using Fabric(Python automation module) to automate the process of creating  a ‘mycode.git’ repository and cloning it.  This tutorial was written for Cent OS 6.5, but could be adapted for Ubuntu and Fedora.  Basic knowledge of Linux and Python 3 is required.

If you need help setting up Python3, pip, and Fabric on CentOS 6 please refer to my earlier tutorial: https://www.savelono.com/linux/how-to-install-python-3-and-pip-3-for-centos-6.html

Goals of this post:

  • Write Python/Fabric function to automate the Git setup process
  • Write Python/Fabric function to automate cloning Git repository on local host

(more…)

Jun
08
2017
0

How to Install and Configure Basic Git Server on CentOS 6

Git has changed my life.  I’m not exaggerating.  I work with a lot of ‘one off’ scripts (BASH, PHP, and Python).  They are spread out among systems and developed from my workstation and(sometimes) laptop.  I spent 15 years keeping multiple versions and copies of the same scripts spread between systems.  Looking back it seems Crazy!

While I’ve known about Git for years, but I had no idea how badly I needed it until I interviewed for a contract and the interviewer repeatedly mentioned Git as a crucial part of their development process.  I admitted to him that I didn’t use it, but I would set it up myself and answer his questions in the next interview.  I installed it and set out to learn the centralized Git workflow(similar to SVN; one master setup).  There are other workflows and I recommend taking a look at this post if you are curious: https://www.atlassian.com/git/tutorials/comparing-workflows  

Goals of this Post:

  • Install  and configure basic Git for centralized workflow

 

(more…)

Written by mattb in: Automation,Linux | Tags: , , , , ,
May
30
2017
4

How to Install Python 3 and pip 3 for CentOS 6

CentOS 6 doesn’t have native support for Python 3 and corresponding module management tool ‘pip’.  I prefer pip for managing my Python modules.  On CentOS 7 there is a specific yum package for pip(Python 2.7) and pip3(Python 3.4) respectively. However on COS 6 we must install the ‘epel repository’ to get Python 3.4 and there is no specific package for installing ‘pip 3’.  This tutorial is a friendly reminder for myself and others on how to install Python 3 and respective pip3 for CentOS 6.x.

Goals of this post:

  • install Python 3.4
  • install pip 3 for python 3
  • upgrade pip 3

(more…)

Written by mattb in: Linux,Scripts | Tags: , , , , ,
May
23
2017
0

Python Home Work – Online Coffee Shop

My friend is taking a Python course.  I’ve been doing the assignments for practice/fun while helping each other study.  The course has restrictions as to the data/code structures, but please post alternatives!  Thank you  and enjoy!

Assignment:

 

Assignment

“Create a program that determines the cost of sending out coffee.

The Konditorei coffee shop sells coffee at $10.50 a pound for their Jonestown Brew, and $16.95 for their Plymouth Jolt.  When the user places an order they will choose one of the two types of coffee, they will enter the number of pounds they are ordering. They will enter in their State. They will pick the Delivery method: Overnight, 2-Day or Standard. They will enter in their payment option: PayPal, Credit Card, Check.

You will display the Coffee type and number of pounds they have ordered, the Sub-Total (price * quantity), the Shipping & Handling Costs, Delivery Costs, the City and State it is being shipped to, the Delivery Method, the Payment type, The Tax and the Total. Format in US currency where appropriate.

The Tax Rate is 9% for Washington, California and Texas, 0% for Oregon or Florida, all other are 7%. The Tax Rate is applied to the Sub-Total. The delivery methods are Overnight ($20.00), 2-Day ($13.00), Standard ($0.00). For Payment options, Paypal has a 3% fee (of the Sub-Total), Credit Cards has a 5% fee (of the Sub-Total), and Checks have a 2% discount (of the Sub-Total),

You are required to use functions. One function to determine the Shipping & Handling costs, another function to determine the Tax and another to determine the Sub-Total.

Use a Try Except block to catch the program from blowing up.”

 

Click here to see my assignment.

Written by mattb in: Scripts | Tags: ,
Oct
16
2016
0

Lono the Cat taken by cancer (2002-2016)

Lono finally succumbed to feline lymphoma after a 2+ year battle.  In the coming weeks I’ll be adding post on his care and living with cancer.  He fought til the bitter end.  We love you Lono.

Written by mattb in: Uncategorized |
Jul
02
2015
1

UPDATE – Managing Multiple Interfaces with Fedora 21, libvirt, Qemu, NetworkManager

This post is an update to a previous post on using multiple interfaces(Ethernet cards) on the LAN, – utilizing RedHat’s popular virtualization tools – QEMU, KVM, libvirt, and virt-manager.  In this article I will demonstrate with Fedora 21, but this roughly applies to CentOS 7 as well.

I’ve resisted upgrading to recent versions of Fedora/CentOS for a long time.  The main reason is that I hate NetworkManager.  It does to much automatically; I much preferred the old ‘network’ daemon that could easily be manually set.  For instance if I create a Bridge(call it bridge1) interface assigned to my second Ethernet card(eth1) NetworkManager will automatically create a profile for each with automatic startup and DHCP enabled!  I don’t need or want a DHCP lease on either side of a bridged interface!  Among other issues are the creation of duplicate profiles when libvirt restarts.  So NetworkManger reports ‘bridge1’ & ‘bridge1’ in the NM start menu applet.

Ideally libvirt and NetworkManager would work hand in hand because Redhat sponsors both projects…

In this article we will describe the steps to allow you to connect two seperate NIC’s to a switch; assigning one of the NIC’s specifically to guest VM’s.

Goals of this post:

  • Set NetworkManager to ignore bridge and Ethernet device
  • enable systemd version of rc.local boot script to create bridge at boot
  • assign host to specific bridged Ethernet device

(more…)

Aug
04
2014
0

How to Provision Global Settings using Polycom 4.0 Firmware

vvx_310

Recently I’ve been tasked with figuring out how to provision Polycom phones on the 4.0 firmware.  I’ve resisted for some time because of our existing GUI and templates.  However, the time has come to make the transition.  This tutorial will cover how to create a custom settings file that used to make up sip.cfg.  We will define our own ‘global options’ config referenced from  00000000000-phone.cfg.

 

Goals of this Post:

  • Create custom global options for Polycom 4.0 firmware

 

(more…)

Written by mattb in: Asterisk,Asterisk Post,Linux | Tags: , ,
Jun
12
2014
0

Civilization V on Fedora 20

It’s a dream come true.  Civ V on Linux!!!!!!!!!!   Let me just say this: OMG, OMG, OMG, OMG….!  Okay, deep breath.

I love Civ, but my current situation only allows one computer, so I have to swap drives and boot Windows to play my most favorite of games.  It’s huge bummer, because it disrupts my work flow, but that’s all changed.  Steam is and Firaxis are incredibly wise to offer an “A” game to the small(but growing Desktop Linux community).  I’m playing a single player game and will report back soon!

Written by mattb in: Linux |
May
22
2014
0

Asterisk 1.8 T1 w/ PRI + analog fax

It’s been a while since I posted, so I want to come out swinging.  I recently put together a phone system for a medium office.  They have a standard T1 and a 4 port FXS Digium card.  The analog card is for a PA system and two fax machines.  This post is a quick tutorial with examples for installation.

Goals of this post:

  • Configure Digium T1 w/ PRI
  • Configure Analog card channels
  • Asterisk Dahdi setup

This tutorial assumes you have a somewhat recent working build of libpri, dahdi, and Asterisk.

(more…)

Jun
23
2013
0

Fedora 15, 16, 17, 18 missing system-config-network GUI – SOLVED

Recently Fedora has been a nightmare for me. Anyone that’s seen(the fairly new) GNOME 3 knows what I’m talking about.  Their design team must have dreamed up the next iteration of GNOME with only a tablet in mind.  The giant icons and dependency on keyboard shortcuts make it a must for a 7″ inch screen and a few swipes.

For daily use on desktop computers at work GNOME 3 is garbage though – everyone hates it. It’s barely better than the Windows 8 interface.  I’m sorry; yeah I went there, and I only say that because Microsoft jammed all those tiles and the desktop into the same freaking UI.  Even GNOME 3 designers missed that pit of snakes!

But happy days are here again! I have found(with some tweaking) the MATE Desktop offers a very similar but updated version of the GNOME 2 desktop I loved in Fedora 14.  One nagging problem is that I hate NetworkManager for server use.  It’s okay for laptops, but when I need to custom edit some interfaces for a Asterisk PBX or Virtual Server I want the good ol’ ‘system-config-network’ over a SSH -X session.  After a quick ‘yum install system-config-network’ I thought I was in business… only to discover that only the command line version was installed.  After a little googling I discovered a utility that could download the source package.  I rebuilt the package with ‘–with gui’ switch as suggested on a forum.  The result produced the ‘system-config-network-tui-1.6.10-1.fc18.noarch.rpm’.  I installed the packaged and the GUI works! This tutorial uses Fedora 18, but could be adapted for 15,16,17, and 19.

(more…)