Skip to content

Instantly share code, notes, and snippets.

View govindsh's full-sized avatar

Srikkanth Govindaraajan govindsh

View GitHub Profile
@govindsh
govindsh / loading_image.html
Created August 1, 2017 23:58
Snippet to display loading image on button click
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<h1>Demo for displaying a loading image on button click</h1>
<div id="loading" style="display:none;">
<center>
@govindsh
govindsh / jenkins_modify_jobs.py
Last active September 6, 2018 14:04
Python script to modify jenkins jobs using requests module
# I wrote this program after several attempts to work with jenkinsapi and python-jenkins packages.
# This script got the job done without any issues.
import requests
import sys
jenkins_host = "localhost:8080"
jenkins_user = "admin"
jenkins_api = "z01c688ffc46511f7e8dd95014ggaf05"
# Check command line args
@govindsh
govindsh / db_init_sqlite.py
Created August 1, 2017 03:59
Python script to create a sqlite DB and table entries
import sqlite3 as lite
import sys
conn = lite.connect('blog_posts.db')
# This will be called only the first time to create the table by running "python db_init_sqlite.py create"
def create_table():
with conn:
cursor = conn.cursor()
cursor.execute("CREATE TABLE posts (date TEXT, title TEXT PRIMARY KEY, content TEXT);")
@govindsh
govindsh / ssh_run_command.py
Created July 31, 2017 19:47
Restart Apache web server on a remote host when getting a ConnectionError
# Python imports
import requests
from requests import exceptions
import paramiko
import os
import time
# Note: Remember to add environment variable PASSWORD in bash_profile and source it.
# Local variables