Skip to content

Instantly share code, notes, and snippets.

View msraju2009's full-sized avatar

Madhu msraju2009

  • Bangalore
View GitHub Profile
@msraju2009
msraju2009 / Jenkinsfile
Created October 27, 2020 17:11 — forked from JCotton1123/Jenkinsfile
Sample Jenkinsfile for Python project
pipeline {
options {
buildDiscarder(logRotator(numToKeepStr: '10')) // Retain history on the last 10 builds
ansiColor('xterm') // Enable colors in terminal
timestamps() // Append timestamps to each line
timeout(time: 20, unit: 'MINUTES') // Set a timeout on the total execution time of the job
}
agent {
// Run this job within a Docker container built using Dockerfile.build
// contained within your projects repository. This image should include
@msraju2009
msraju2009 / Jenkinsfile
Created August 9, 2020 07:26 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@msraju2009
msraju2009 / nexus-maven-repo-delete-artifacts.py
Created March 30, 2020 18:26 — forked from mrts/nexus-maven-repo-delete-artifacts.py
Nexus 3 Maven repo artifact deletion with Python
# See API docs at http://nexus-url/#admin/system/api
import requests
USERNAME = 'user'
PASSWORD = 'password'
NEXUS_BASE_URL = 'http://nexus-url/service/rest/beta'
REPOSITORY = 'some-project-snapshots'
GROUP_FILTER = 'com.some.group'
@msraju2009
msraju2009 / bdiff.py
Created August 13, 2019 03:55 — forked from jacobabrahamb4/bdiff.py
Display diff between two commits.
#!/usr/bin/env python
import sys, subprocess, os
TOOLS = ['bcompare', 'meld']
HEAD = 'HEAD'
TMP = '/tmp/'
execute = lambda command: subprocess.check_output(command)
which = lambda tool: execute(['which', tool]).strip()
@msraju2009
msraju2009 / KeyUtils.java
Created October 22, 2018 11:01 — forked from d-smith/KeyUtils.java
Read and write passwords to a Java keystore file
package keystuff;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.security.KeyStore;
public class KeyUtils {
public static FileInputStream getFileInputStreamFromArg(String filePath) throws FileNotFoundException {
@msraju2009
msraju2009 / XML_breaker.py
Created September 30, 2018 08:39 — forked from nicwolff/XML_breaker.py
Python script to break large XML files
import os
import sys
from xml.sax import parse
from xml.sax.saxutils import XMLGenerator
class CycleFile(object):
def __init__(self, filename):
self.basename, self.ext = os.path.splitext(filename)
self.index = 0
@msraju2009
msraju2009 / xml_split.py
Created September 30, 2018 08:29 — forked from benallard/xml_split.py
Small python script to split huge XML files into parts. It takes one or two parameters. The first is always the huge XML file, and the second the size of the wished chunks in Kb (default to 1Mb) (0 spilt wherever possible) The generated files are called like the original one with an index between the filename and the extension like that: bigxml.…
#!/usr/bin/env python
import os
import xml.parsers.expat
from xml.sax.saxutils import escape
from optparse import OptionParser
from math import log10
# How much data we process at a time
@msraju2009
msraju2009 / bash-cheatsheet.sh
Created September 16, 2018 07:11 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@msraju2009
msraju2009 / cli.docker.sh
Created September 16, 2018 07:10 — forked from LeCoupa/cli.docker.sh
Docker Cheatsheet + Tips & Tricks --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
docker build -t friendlyname . # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname # Same thing, but in detached mode
docker exec -it [container-id] bash # Enter a running container
docker ps # See a list of all running containers
docker stop <hash> # Gracefully stop the specified container
docker ps -a # See a list of all containers, even the ones not running
docker kill <hash> # Force shutdown of the specified container
docker rm <hash> # Remove the specified container from this machine
docker rm $(docker ps -a -q) # Remove all containers from this machine
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class