Skip to content

Instantly share code, notes, and snippets.

View mmphego's full-sized avatar
:octocat:
Never judge a person by their choice of IDE

Mpho Mphego mmphego

:octocat:
Never judge a person by their choice of IDE
View GitHub Profile
#!/usr/bin/env python
import paho.mqtt.client as mqtt
import RPi.GPIO as GPIO
def on_connect(client, userdata, rc):
#print ("Connected with rc: " + str(rc))
client.subscribe("kwf/demo/led")
def on_message(client, userdata, msg):
@mmphego
mmphego / jenkins-git-backup.sh
Created May 30, 2017 03:11 — forked from abayer/jenkins-git-backup.sh
Example of a script for backing up Jenkins config in git.
#!/bin/bash
#
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
#
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master
@mmphego
mmphego / remote_bash.sh
Created June 26, 2017 13:29 — forked from n0ts/remote_bash.sh
execute bash script from remote site
# http://stackoverflow.com/questions/5735666/execute-bash-script-from-url
bash <(curl -s http://mywebsite.com/myscript.txt)
# http://stackoverflow.com/questions/4642915/passing-parameters-to-bash-when-executing-a-script-fetched-by-curl
curl http://foo.com/script.sh | bash -s arg1 arg2
@mmphego
mmphego / git-io-custom-url.md
Created January 21, 2019 15:22 — forked from hellokaton/git-io-custom-url.md
git.io custom URL

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
  • https://*.github.com/*
  • https://*.github.io
@mmphego
mmphego / README.md
Created April 16, 2019 08:41 — forked from akashnimare/README.md
A Beginners Guide to writing a Kickass README ✍

Project title

A little info about your project and/ or overview that explains what the project is about.

Motivation

A short description of the motivation behind the creation and maintenance of the project. This should explain why the project exists.

Build status

Build status of continus integration i.e. travis, appveyor etc. Ex. -

Build Status

@mmphego
mmphego / Jenkins+Script+Console.md
Created May 25, 2020 11:54 — forked from mubbashir/Jenkins+Script+Console.md
jenkins groovy scripts collection.
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 23 columns, instead of 6. in line 8.
Number,Name,Type_1,Type_2,Total,HP,Attack,Defense,Sp_Atk,Sp_Def,Speed,Generation,isLegendary,Color,hasGender,Pr_Male,Egg_Group_1,Egg_Group_2,hasMegaEvolution,Height_m,Weight_kg,Catch_Rate,Body_Style
1,Bulbasaur,Grass,Poison,318,45,49,49,65,65,45,1,False,Green,True,0.875,Monster,Grass,False,0.71,6.9,45,quadruped
2,Ivysaur,Grass,Poison,405,60,62,63,80,80,60,1,False,Green,True,0.875,Monster,Grass,False,0.99,13.0,45,quadruped
3,Venusaur,Grass,Poison,525,80,82,83,100,100,80,1,False,Green,True,0.875,Monster,Grass,True,2.01,100.0,45,quadruped
4,Charmander,Fire,,309,39,52,43,60,50,65,1,False,Red,True,0.875,Monster,Dragon,False,0.61,8.5,45,bipedal_tailed
5,Charmeleon,Fire,,405,58,64,58,80,65,80,1,False,Red,True,0.875,Monster,Dragon,False,1.09,19.0,45,bipedal_tailed
6,Charizard,Fire,Flying,534,78,84,78,109,85,100,1,False,Red,True,0.875,Monster,Dragon,True,1.70,90.5,45,bipedal_tailed
7,Squirtle,Water,,314,44,48,65,50,64,43,1,False,Blue,True,0.875,Monster,Water_1,False,0.51,9.0,45,bipedal_tailed
8,Wartortle,Water,,405,59
@mmphego
mmphego / WA_Fn-UseC_-HR-Employee-Attrition.csv
Created November 29, 2020 16:55
IBM HR Analytics Employee Attrition & Performance Predict attrition
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 35 columns, instead of 8. in line 4.
Age,Attrition,BusinessTravel,DailyRate,Department,DistanceFromHome,Education,EducationField,EmployeeCount,EmployeeNumber,EnvironmentSatisfaction,Gender,HourlyRate,JobInvolvement,JobLevel,JobRole,JobSatisfaction,MaritalStatus,MonthlyIncome,MonthlyRate,NumCompaniesWorked,Over18,OverTime,PercentSalaryHike,PerformanceRating,RelationshipSatisfaction,StandardHours,StockOptionLevel,TotalWorkingYears,TrainingTimesLastYear,WorkLifeBalance,YearsAtCompany,YearsInCurrentRole,YearsSinceLastPromotion,YearsWithCurrManager
41,Yes,Travel_Rarely,1102,Sales,1,2,Life Sciences,1,1,2,Female,94,3,2,Sales Executive,4,Single,5993,19479,8,Y,Yes,11,3,1,80,0,8,0,1,6,4,0,5
49,No,Travel_Frequently,279,Research & Development,8,1,Life Sciences,1,2,3,Male,61,2,2,Research Scientist,2,Married,5130,24907,1,Y,No,23,4,4,80,1,10,3,3,10,7,1,7
37,Yes,Travel_Rarely,1373,Research & Development,2,2,Other,1,4,4,Male,92,2,1,Laboratory Technician,3,Single,2090,2396,6,Y,Yes,15,3,2,80,0,7,3,3,0,0,0,0
33,No,Travel_Frequently,1392,Research & Development,3,4,L
@mmphego
mmphego / prometheus-operator-values.yaml
Created April 21, 2021 08:28
prometheus-operator-values.yaml
# Default values for prometheus-operator.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
## Provide a name in place of prometheus-operator for `app:` labels
##
nameOverride: ""
## Override the deployment namespace
##
@mmphego
mmphego / diabetes.csv
Created April 26, 2021 14:53
diabetes dataset
PatientID Pregnancies PlasmaGlucose DiastolicBloodPressure TricepsThickness SerumInsulin BMI DiabetesPedigree Age Diabetic
1354778 0 171 80 34 23 43.50972593 1.213191354 21 0
1147438 8 92 93 47 36 21.24057571 0.158364981 23 0
1640031 7 115 47 52 35 41.51152348 0.079018568 23 0
1883350 9 103 78 25 304 29.58219193 1.282869847 43 1
1424119 1 85 59 27 35 42.60453585 0.549541871 22 0
1619297 0 82 92 9 253 19.72416021 0.103424498 26 0
1660149 0 133 47 19 227 21.94135672 0.174159779 21 0
1458769 0 67 87 43 36 18.2777226 0.23616494 26 0
1201647 8 80 95 33 24 26.62492885 0.443947388 53 1