DIY Pest Control for less than $50 a year

DIY Pest Control

I live in the Sacramento valley of California. It gets pretty hot here so we get lots of bugs. We have lots of Cockroaches that take over in the summer.

I recently bought a house that was unoccupied for a few months. I really wanted to make sure to get rid of the bugs but did not have a lot of money.

I deiced to get an all purpose bug spray and a sprayer. After doing some research online I found most thing sold in stores are pretty much useless.

I went with the chemical that is part of the Pyrethroid family. It is safer then most chemicals and it will kills insects very fast.

I went and got the off brand Demand CS as it was slightly cheaper and the same active ingredient which is Lambda-Cyhalothrin.

You will need a sprayer to mix the water and cyzmic-cs together. I just bought a cheap one gallon sprayer at Home Depot. Only use the sprayer for this one task. They are less then ten bucks just buy a dedicated one.

Now you need to figure out your mixture rate. Refer to the bottle of what ever you bought. Make sure to follow what it says. For a clean out treatment it recommend .8fl oz to 1 gallon of water.

1st : Fill the sprayer half way with water.
2nd: Pour .8fl oz of cysmic-cs or whatever else into the sprayer and close the lid.
3rd: Put the lid on and shake the crap out of it.
4th: Fill sprayer to 1 gallon mark and shake again.

Now you are ready to starting spraying.

Indoor Application

As the house was currently empty I was going to spray inside as well. Since then I have limited my spraying to outside.

Inside you want to do what is called a “crack and crevice application” this is fancy speak for you can spray in cracks. Do not go around coating the whole floor. Spray underneath baseboards and around cabinets toilets etc.

The Garage is important!!! For me I need to spray heavily in the garage as it was major infection point.

Outside Application

Outdoor application is important.

We want to create a barrier so the pest can not enter the house. The easiest way to do this is to spray a perimeter line around the house.

Take the sprayer and making a sweeping motion 6 inches up the foundation/side of the house then 6 inches down on the ground. You want about a foot of spray that is touching your house and the ground next to it.

The idea is that anything that gets within 6 inches of the house or touches the house will be effected.

The next step is to spray around windows and anything that goes into our out of the house. Cable wires water pipes etc. Remember we want a barrier of spray anywhere it is possible to enter the house.

Below is a link to quick video that walks through the steps.


This stuff can be a little scary. I was not living in the house at the time I did the first spray. When I came back three days later it was like a Genocide occurred. The garage was a kill zone. It took me about thirty minutes to sweep up all the dead cockroaches. I lost count out over 150. It is was incredible and scary to see how well this stuff works.

For the next few days you might see cockroaches during the day. This is because they are dying. You will want to at least repeat the outdoor treatment about every 3 months. Do not spray if it has rained recently or will shortly after.

This is the same stuff Terminix and other companies use for Residential treatments. With the sprayer total cost was less than $40. This is less than one visit form Terminix. I can get about 8 treatments out of one bottle.

If you are willing to spend 30 mins everything 3 months you can get rid of most bugs for the price of dinner.

ServiceNow SaltStack Integration OpenVPN REST Part 2

Part 2 of 2 (

Following up on my previous post I will be covering the SaltStack side of the Integration.

The first thing to do was figure out a way to capture the username from the end user in Snow and send that to SaltStack.

I used a REST API to do this.

I installed Salt-API and put in the following settings into the master config file.

port: pick a port number
host: hostname
ssl_crt: /etc/ssl/private/cert.pem #path to ssl key
ssl_key: /etc/ssl/private/key.pem
webhook_disable_auth: True #set this to false if you want auth enabled
webhook_url: /hook . # allows a webhook

Then the next step is to create a reactor file. This tells salt what to do when something is sent to webhook via a REST api.
Place the following config at this path /etc/salt/master.d/reactor.conf

It will look something like this:


– salt/netapi/hook/open_vpn_reset:
– /srv/reactor/open_vpn_phone_reset.sls

When something is sent to link of ipofsaltserver:portnumber/webhooklink it will render the sls of open_vpn_reset.sls

Now you need to create the open vpn rest sls file. The one I created is below.

{% set postdata = data.get(‘post’,{}) %} # This allows you to receive the data sent to salt api and use it
– tgt: ‘connect’
– args:
– cmd: ./sacli –user {{postdata.username}} –lock 0 GoogleAuthLock
– cwd: /usr/local/openvpn_as/scripts

The trick to this sls is that when the data is sent to the webhook you pass a var called user with username. Salt will take this var and place it in postdata.username and the it will render.

This will allow end users to run this script without contacting operations to run the script for them.

ServiceNow SaltStack Integration with OpenVPN with REST

This part 1 of 2 articles to view the second article click the following link (

We use SaltStack to manage various things on our servers. Also use OpenVpn with Google Authenticator for two factor on login. We use ServiceNow for our ticketing system.

This works pretty well. Until someone gets a new phone and they need a new QR code. We have quick script that resets this.

The old workflow was end user submits a ticket asking for the account to be reset. I run the script and then tell them to re join the phone.

This is fine but do I really need to run the script myself? This gave me the idea of using self service in ServiceNow to automate this task.

The first thing I did was to create a very simple record producer that has the caller’s name and a username variable.  For caller it is a reference variable to sys_user table. If you put the following default value in it will auto sync the caller with the user who is viewing the record.


More info regarding record producers can be found at the link below:

So once I decided that I wanted to do this, I need to figure out how to build it.

Both ServiceNow and SaltStack have REST API’s. This is how I will integrate both services.

ServiceNow Rest API documentation:!/rest_api_doc?v=kingston&id=c_TableAPI

SaltStack REST API documentation:!/rest_api_doc?v=kingston&id=c_TableAPI

After that I needed a way to get ServiceNow which is hosted in AWS to talk with the SaltStack server that is hosted behind firewalls in our VMware stack.

For this ServiceNow provides a MID server to help with this. Refer to my other blog post link below regarding the MID server.

ServiceNow MID Server in Docker

The I had to create a scripted REST API in ServiceNow. I set the URL endpoint to webhook url I created in SaltStack. (I will show the SaltStack side of things in my next post). Then set the HTTP headers and query parameters using the outbound rest message in ServiceNow.

Once this is created I need to add the code to my record producer to send out the username variable to SaltStack via the REST API.

The Record Producer code  is below. Feel free to use or edit to your liking.

var username1 = producer.username + ” “;

try {

var r = new sn_ws.RESTMessageV2(‘Salt Open VPN’, ‘OpenVPn’);
r.setStringParameterNoEscape(‘var’, ”);
var body = {‘username’: username1};
var bodyText = JSON.stringify(body);
//override authentication profile
//authentication type =’basic’/ ‘oauth2’
//r.setAuthentication(authentication type, profile name);

//set a MID server name if one wants to run the message on MID
r.setMIDServer(‘dev mid’);

//if the message is configured to communicate through ECC queue, either
//by setting a MID server or calling executeAsync, one needs to set skip_sensor
//to true. Otherwise, one may get an intermittent error that the response body is null
//r.setEccParameter(‘skip_sensor’, true);

var response = r.execute();
var httpStatus = response.getStatusCode();
catch(ex) {
var message = ex.getMessage();

ServiceNow MID Server in Docker

ServiceNow requires a MID server when you want to interact with resources behind firewalls. I wanted to allow my end users to reset there Open VPN Google Auth code using self service. Due to this I needed to install a MID server to reach our servers. I put this Docker to make things easier.

Below is a link for a quick explanation of SN Mid server:

It is a simple Java application. I did not want to install it on bare metal. We use docker here at work. So a good reason to use docker.

I found the following git repo that had mid server in Docker. Only problem was that it was out of date and using Ubuntu for it is base image.

So I tweaked a few things changed base image to Centos.

The next issue is that the download file for the installation changes for each ServiceNow update.

So I created a dockerhub account and created a build linked to my repo. When I update the Wget url and push the code to master, a job in docker cloud is fired off via webhook. This auto builds the docker image.

This was very helpful but I still had one more issue.  My prod SN instance is usually a version or two behind dev. I would need to use a different docker image for Prod.

My solution was to create another git branch and create a separate docker cloud build. This way I could have prod and dev branch. Depending on which branch I update it will build a different docker image.

My github and docker image links are below. Feel free to use it, fork it whatever:

Hello welcome to my blog.

This is just a place for me to put random things I am working on.

My name is James and I work as a System Administrators.

I like to mess around with ServiceNow and automation at work.

When I get home I like to cook, make beer and do other random things. When I am not having fun I am usually fixing my new to me old house or working on my girlfriends car.