<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://camarreal.dedyn.io/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://camarreal.dedyn.io/feed.php">
        <title>dokucama - scripting:python_scripts</title>
        <description></description>
        <link>https://camarreal.dedyn.io/</link>
        <image rdf:resource="https://camarreal.dedyn.io/lib/exe/fetch.php?media=wiki:logo.png" />
       <dc:date>2026-05-01T16:17:05+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:checkpoint.py&amp;rev=1698935895&amp;do=diff"/>
                <rdf:li rdf:resource="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:f5-exaple1.py&amp;rev=1698935895&amp;do=diff"/>
                <rdf:li rdf:resource="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:interactive_entry.py&amp;rev=1698935895&amp;do=diff"/>
                <rdf:li rdf:resource="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:mail_countdown.py&amp;rev=1698935895&amp;do=diff"/>
                <rdf:li rdf:resource="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:paramiko_ssh1.py&amp;rev=1698935895&amp;do=diff"/>
                <rdf:li rdf:resource="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:regex0.py&amp;rev=1698935895&amp;do=diff"/>
                <rdf:li rdf:resource="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:regex1.py&amp;rev=1698935895&amp;do=diff"/>
                <rdf:li rdf:resource="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:sql_database_f5_to_a10_1.py&amp;rev=1698935895&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://camarreal.dedyn.io/lib/exe/fetch.php?media=wiki:logo.png">
        <title>dokucama</title>
        <link>https://camarreal.dedyn.io/</link>
        <url>https://camarreal.dedyn.io/lib/exe/fetch.php?media=wiki:logo.png</url>
    </image>
    <item rdf:about="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:checkpoint.py&amp;rev=1698935895&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-11-02T14:38:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>checkpoint.py</title>
        <link>https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:checkpoint.py&amp;rev=1698935895&amp;do=diff</link>
        <description>import sys
import subprocess
import time
import pexpect
import smtplib


#while dblock is 1 script will fail



dblock = 1
CPTMGMT = &#039;10.30.165.21&#039;
cpstat_output = &#039;set a true value so script fails if ssh does not run&#039;
pushpolicy_output = &#039;set a value here so i know nothing got set at the end&#039;
CPSTATCMD = &#039;cpstat&#039;
PPCMD = &#039;fwm load -p firewall -m MKTX_DC03 DC03CPTFW&#039;



#or this, this is the mail alert in case we have any problems pushing policy
def mail_alert_push(ipaddr,message):
        SERVE…</description>
    </item>
    <item rdf:about="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:f5-exaple1.py&amp;rev=1698935895&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-11-02T14:38:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>f5-exaple1.py</title>
        <link>https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:f5-exaple1.py&amp;rev=1698935895&amp;do=diff</link>
        <description>from bigsuds import BIGIP
b = BIGIP(hostname=&#039;172.16.48.136&#039;, username=&#039;admin&#039;, password=&#039;admin&#039;)
b.LocalLB.Pool.create_v2(
        pool_names = [&#039;Python-Pool&#039;],
        lb_methods = [&#039;LB_METHOD_ROUND_ROBIN&#039;],
        members = [[
                {&#039;address&#039;: &#039;10.1.213.233&#039;, &#039;port&#039;: &#039;80&#039;},
                {&#039;address&#039;: &#039;10.1.213.234&#039;, &#039;port&#039;: &#039;80&#039;},
                {&#039;address&#039;: &#039;10.1.213.235&#039;, &#039;port&#039;: &#039;80&#039;}]])</description>
    </item>
    <item rdf:about="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:interactive_entry.py&amp;rev=1698935895&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-11-02T14:38:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>interactive_entry.py</title>
        <link>https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:interactive_entry.py&amp;rev=1698935895&amp;do=diff</link>
        <description>__author__ = &#039;jotasancent&#039;
import sys
import io
import subprocess


def query_yes_no(question, default=&quot;yes&quot;):
    &quot;&quot;&quot;Ask a yes/no question via raw_input() and return their answer.

    &quot;question&quot; is a string that is presented to the user.
    &quot;default&quot; is the presumed answer if the user just hits &lt;Enter&gt;.
        It must be &quot;yes&quot; (the default), &quot;no&quot; or None (meaning
        an answer is required of the user).

    The &quot;answer&quot; return value is True for &quot;yes&quot; or False for &quot;no&quot;.
    &quot;&quot;&quot;
    valid …</description>
    </item>
    <item rdf:about="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:mail_countdown.py&amp;rev=1698935895&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-11-02T14:38:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>mail_countdown.py</title>
        <link>https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:mail_countdown.py&amp;rev=1698935895&amp;do=diff</link>
        <description>#!/usr/bin/env python
import smtplib
import datetime

def main():
    delta = datetime.datetime(2016, 10, 2, 13, 00, 00) - datetime.datetime.now()
    sender = &#039;jaimesantos23@gmail.com&#039;
    receivers = [&#039;jaimesantos23@gmail.com&#039;]
    message = &quot;&quot;&quot;From: From Person &lt;from@fromdomain.com&gt;
To: To Person &lt;to@todomain.com&gt;
Subject: You have %s days and %s seconds for the 400-101 exam!

Appointment
Sunday, October 2, 2016
Start Time: 01:00 PM BST
Location
Work4u Global LTD
Radial House, 2nd floor (Hali…</description>
    </item>
    <item rdf:about="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:paramiko_ssh1.py&amp;rev=1698935895&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-11-02T14:38:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>paramiko_ssh1.py</title>
        <link>https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:paramiko_ssh1.py&amp;rev=1698935895&amp;do=diff</link>
        <description>#import the neccessary modules

import time
import sys
import getpass
import paramiko

#setup the variables used in the script 
 
ip = &#039;10.10.10.1&#039;
username = &quot;cisco&quot;
password = getpass.getpass()

#Execute the main part of the code
  
remote_conn_pre = paramiko.SSHClient()  
remote_conn_pre.set_missing_host_key_policy(paramiko.AutoAddPolicy())
remote_conn_pre.connect(ip, username=username, password=password)
print &quot;SSH connection established to 10.10.10.1&quot;
remote_conn = remote_conn_pre.invoke_sh…</description>
    </item>
    <item rdf:about="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:regex0.py&amp;rev=1698935895&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-11-02T14:38:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>regex0.py</title>
        <link>https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:regex0.py&amp;rev=1698935895&amp;do=diff</link>
        <description>import re
import os
import StringIO
import psycopg2

#DSN = &quot;dbname=pnegron&quot;

file = &#039;/Users/pnegron/Desktop/SCRIPT-TESTING/R1.cfg&#039;

test = open(file,&#039;r&#039;)

text = test.read()

test.close()

text1 = re.search(r&#039;NAME:\s\D(.+)\D.*DESCR:\s(.*)&#039;, text)
print text1.group(1).strip(&#039; \&quot;,&#039;)
#text2 = re.search(r&#039;(SN:\s)([0-9].*)&#039;, text)
#text3 = re.findall(r&#039;(NAME:\s.*)(DESCR:\s.*)&#039;, text)
#text4 = re.findall(r&#039;(SN:)\s([0-9].)&#039;, text)
#text5 = re.search(r&#039;Chassis&#039;, text)
#print text1.group(1)
#print text1…</description>
    </item>
    <item rdf:about="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:regex1.py&amp;rev=1698935895&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-11-02T14:38:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>regex1.py</title>
        <link>https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:regex1.py&amp;rev=1698935895&amp;do=diff</link>
        <description>import re
import os
import StringIO
import psycopg2
import simplejson as json

DSN = &quot;dbname=pnegron&quot;

file = &#039;/Users/pnegron/Desktop/SCRIPT-TESTING/R1.cfg&#039;

test = open(file,&#039;r&#039;)

text = test.read()

test.close()

text3 = re.search(r&#039;NAME:\s\D([a-zA-Z]*).*\n.*SN:\s([0-9]*)&#039;, text)

#print text
#print text3.groups
print text3.group(1)
print text3.group(2)



#print &quot;Opening connection using dsn:&quot;, DSN
#conn = psycopg2.connect(DSN)
#print &quot;Encoding for this connection is&quot;, conn.encoding

#curs = …</description>
    </item>
    <item rdf:about="https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:sql_database_f5_to_a10_1.py&amp;rev=1698935895&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2023-11-02T14:38:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>sql_database_f5_to_a10_1.py</title>
        <link>https://camarreal.dedyn.io/doku.php?id=scripting:python_scripts:sql_database_f5_to_a10_1.py&amp;rev=1698935895&amp;do=diff</link>
        <description>## don&#039;t modify anything below this line (except for experimenting)

import sys
import os
import psycopg2
import openpyxl

DSN = &quot;dbname=pnegron&quot;

print &quot;Opening connection using dsn:&quot;, DSN
conn = psycopg2.connect(DSN)
print &quot;Encoding for this connection is&quot;, conn.encoding

curs = conn.cursor()
try:
    curs.execute(&quot;CREATE TABLE cisco_devices (device text, Serial_No text)&quot;)
except:
    conn.rollback()
    curs.execute(&quot;DROP TABLE cisco_devices&quot;)
    curs.execute(&quot;CREATE TABLE cisco_devices (dev…</description>
    </item>
</rdf:RDF>
