This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Exports Issues from a specified repository to a CSV file and creates corresponding tickets in JIRA. | |
Uses basic authentication (Github username + password) to retrieve Issues | |
from a repository that username has access to. Supports Github API v3. | |
Use the following gist as config for this script: https://gist.github.com/atharvai/16996fbb73442f8a1cfb5bffb11c412e | |
""" | |
import csv | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from jira.client import JIRA | |
import argparse | |
import jira.client | |
parser = argparse.ArgumentParser(description='Automation Jira cards') | |
parser.add_argument('--key', help='add jira API key') | |
parser.add_argument('--email', help='Your Jira email') | |
parser.add_argument('--server', help='Your server URL', required=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jira import JIRA | |
import click | |
ISSUE_SUMMARY = "TEST SUMMARY from kittoh" | |
ISSUE_DESCRIPTION = """TEST | |
1. | |
2. | |
3. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
import sys | |
import argparse | |
import json | |
import netrc | |
import textwrap | |
import urllib.parse | |
import urllib.request | |
import urllib.error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% cat scripts/script_jira.py | |
-------------------------------- | |
import os | |
from jira import JIRA | |
def create_ticket(): | |
try: | |
jira_connection = JIRA(basic_auth=(os.environ['JIRA_EMAIL'], os.environ['JIRA_TOKEN']), server=os.environ['JIRA_SERVER_URL']) | |
issue_dict = { | |
'project': {'key': os.environ['JIRA_ORG_ID']}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_to_current_spring(self): | |
res = self.jira.sprints(437) | |
#print(dir(res[0])) | |
#print(res[0].state) | |
for sprint in res: | |
if sprint.state == "ACTIVE": | |
print(isinstance(sprint.id,int)) | |
print(self.new_issue.key) | |
res = self.jira.add_issues_to_sprint(sprint_id=sprint.id,issue_keys=[self.new_issue.key]) | |
print(res) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ComputerName = "New Name" | |
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname" | |
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname" | |
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\Computername" -name "Computername" -value $ComputerName | |
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername" -name "Computername" -value $ComputerName | |
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname" -value $ComputerName | |
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname" -value $ComputerName | |
Set-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -name "AltDefaultDomainName" -value $ComputerName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -ex | |
command_exists() { | |
command -v "$@" > /dev/null 2>&1 | |
} | |
user="$(id -un 2>/dev/null || true)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[Parameter(Mandatory=$true)][string]$zip, | |
[string]$dir = "$HOME\Python" | |
) | |
if (Test-Path $dir) { | |
Remove-Item $dir | |
} | |
New-Item -Path $dir -ItemType Directory -Force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Match] | |
Name = wg0 | |
[Network] | |
Address = 172.16.0.2/32 | |
Address = fd01:5ca1:ab1e:8012:3456:789a:bcde:f012/128 | |
[Route] | |
Gateway = 0.0.0.0 | |
Table = 51820 |