If you have browsed any python projects on Github or elsewhere, you have probably noticed a file called requirements.txt This requirements.txt file is used for specifying what python packages are required to run the project you are looking at. Typically the requirements.txt file is located in the root directory of your project. If you open a requirements.txt file, you will see something that looks simiar to this: pyOpenSSL==0.13.1 pyparsing==2.0.1 python-dateutil==1.5 pytz==2013.7 scipy==0.13.0b1 six==1.4.1 virtualenv==16.3.0 Notice Read more […]Read More
In a previous article, we talked about objects and classes, and how they can help you better organize your code. The SOLID principles of Object Oriented Design are a set of principles you can follow to make better use of objects and classes. These principles are not rules. They are more guidelines to try to stick to while developing your applications. As you become more familiar with these principles, you will find that there are times when it makes sense to follow these principles. And Read more […]
In languages like C, you have Switch statements allowing you to evaluate the input, then have a few options for the output. Switch statements are used in place of a series of if/else statements in order to make your code more readable. Case statements can also have better performance than a traditional if/else setup. This is because if you have a bunch of if statements, the system will have to evaluate all of the if statements at the time of execution. However, with a case statement, it is Read more […]
Adding Network printers to a print server can be cumbersome when doing it through the GUI. For that reason, you may want to attempt to do it via a CLI interface. In this article I describe the Powershell commands for adding a TCP port for a TCP printer. As well as how to bulk create the TCP printer ports using a Powershell For loop.SyntaxThe syntax for adding the TCP print port via powershell is as follows:Add-PrinterPort -Name “ip_IPAddress” -PrinterHostAddress IPAddressExamplesHere is an example Read more […]
A common task in any programming language is Reading and Writing files. Below are a couple of functions that can be used for these purposes, along with descriptions of their use. Be sure to import java.io for these functions to work.
This article will describe how you can send emails pragmatically using the Java programming language. The example below includes a function you can use for easily sending emails from your Java application. Prerequisites If you have not already, be sure you download and install the latest Java Development Kit (JDK). You can find the download here. unfortunately the javax.mail libraries are not included in the Java JDK, so you will have to download them separately. The java mail library can Read more […]
Scripting is a very useful skill which will save any Sysadmin a lot of time. Who wants to go to every device in their environment and perform the same task over and over again? In this posting I will cover a few basics for those getting started in scripting.