Skip to content

Instantly share code, notes, and snippets.

View zodman's full-sized avatar
🤗
Code wins arguments!

Andres Vargas zodman

🤗
Code wins arguments!
View GitHub Profile
#!/bin/bash
# This bash script use the Bamboo REST API in order to trigger a plan tests and wait for it to finish and get a result (failed or success).
# It should have a timeoput and should return success or failure
#This triggers the plan
#set -x
EXECUTEPLAN=$(curl -H "Authorization: Bearer ${bamboo.BEARER_SECRET}" -X POST -d "stage&executeAllStages" https://bamboo.coke.com/rest/api/latest/queue/CDSGLB-CDSDEPDCL.json)
echo "output of plan: "
import requests
import argparse
import os
import time
import pprint
import sys
base_token = os.environ.get("bamboo_BAMBOO_TOKEN")
TOKEN = os.environ.get("BAMBOO_TOKEN", base_token)
@zodman
zodman / importer.py
Created October 3, 2019 13:53
small script to fetch all canadian companies who issued LMIA
mport rows
from collections import OrderedDict
from rows import fields, Table
import tqdm
files = [
("2017Q2-Q1","Descargas/2017Q2_Positive_Employer_EN.csv"),
("2017Q3","Descargas/2017Q3_Positive_Employer-EN.csv"),
("2017Q4","Descargas/2017Q4_Positive_Employer-EN.csv"),
("2018Q1","Descargas/2018Q1_Positive_Employer_EN.csv"),
@zodman
zodman / hrtool.py
Last active August 22, 2019 07:09 — forked from miratcan/hrtool.py
A python script to run hackerrank answers on your local. Just run it in the sample test cases folder that you downloaded from hackerrank.
import re
import glob
import subprocess
from os.path import exists
from sys import exit
INPUT_FOLDER = 'input/'
OUTPUT_FOLDER = 'output/'
@zodman
zodman / calc.py
Created May 23, 2019 21:55
calculate days
import sys
import humanize
hrs = int(sys.argv[1])
days = round(hrs/8.0,1)
weeks = round(hrs/40.0,1)
month= round(days/20.0,1)
print("total days: {}".format( humanize.fractional(days)))
print("total weeks: {}".format(humanize.fractional(weeks)))
@zodman
zodman / gist:c81f343d01435388d9264aa14fa5d638
Created February 8, 2019 19:03 — forked from sdoro/gist:4291961
restart OpenVPN server in CLI pfsense
echo "<?php include('openvpn.inc'); openvpn_resync_all();?>" | php -q
@zodman
zodman / Steps to Obtain Client Secret.md
Created October 4, 2018 00:27 — forked from darthShadow/Steps to Obtain Client Secret.md
Mega Account Creator. Handles registration using megareg. Handles verification using Google Client API.
  1. Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials.
  2. On the Add credentials to your project page, click the Cancel button.
  3. At the top of the page, select the OAuth consent screen tab. Select an Email address, enter a Product name (Mega Account Creator) if not already set, and click the Save button.
  4. Select the Credentials tab, click the Create credentials button and select OAuth client ID.
  5. Select the application type Other, enter the name "Mega Account Creator", and click the Create button.
  6. Click OK to dismiss the resulting dialog.
  7. Click the Download JSON button to the right of the client ID.
  8. Move this file to your working directory and rename it client_secret.json.
@zodman
zodman / rundeck.py
Last active September 18, 2018 22:14
rundeck tail log and project status
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
from __future__ import print_function
import logging
import os
import requests
import colorama
try:
@zodman
zodman / gist:cbcbd90333adc010fc86767b287fe689
Created August 2, 2018 17:13 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@zodman
zodman / VideoStream.php
Created January 22, 2018 08:13 — forked from ranacseruet/VideoStream.php
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";