This file contains hidden or 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
| package main | |
| /* | |
| Made with <3 from picturesarenice and emi8ly. | |
| */ | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "github.com/cheggaaa/pb" |
This file contains hidden or 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
| #Getting the services and checking their states. | |
| Get-Service VMwareSTS,VMwareIdentityMgmtService,VMwareCertificateService,VMwareKdcService,VMwareDirectoryService | foreach {$_.DisplayName, $_.Status} | Write-Host | |
| #Setting variable. | |
| $sso = [VMwareSTS,VMwareIdentityMgmtService,VMwareCertificateService,VMwareKdcService,VMwareDirectoryService] | |
| #Shutdown/Start services in the proper order | |
| foreach ($service in $sso) { | |
| try | |
| { |
This file contains hidden or 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
| func ChildReaper() (exits []Exit, err error) { | |
| //start the loop to reap any abandonded children. | |
| for { | |
| var ( | |
| status syscall.WaitStatus | |
| usage syscall.Rusage | |
| ) | |
| // make the `wait4` call and check for errors. if the error equals | |
| // ECHILD (no child process), return empty exit status. |
This file contains hidden or 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
| # git objects for manipulation. | |
| objects = {'tags': [], 'commits': [], } | |
| def pull_git(): | |
| """ | |
| Pulls the current revision and saves it as a JSON object. | |
| :return: | |
| """ | |
| print("reading git objects.") | |
| for objhex in repo: |
This file contains hidden or 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
| #! /bin/bash | |
| if [ "$(id -u)" != "0" ]; then | |
| echo "This script must be run as root" 1>&2 | |
| exit 1 | |
| fi | |
| wget -qO- https://get.docker.com/ | sh | |
| usermod -aG docker `whoami` |
This file contains hidden or 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
| class LogPipe(threading.Thread): | |
| """ | |
| Piping subprocess output to a logger. | |
| """ | |
| def __init__(self, level): | |
| """ | |
| Setup the object with a logger and a loglevel and start the thread | |
| """ | |
| threading.Thread.__init__(self) | |
| self.daemon = False |
This file contains hidden or 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 requests import get | |
| from shutil import rmtree | |
| from subprocess import Popen, PIPE, STDOUT | |
| from os.path import isdir | |
| from os import listdir, chdir, mkdir, fdopen, pipe, close | |
| from sys import stdout | |
| from time import sleep | |
| import logging | |
This file contains hidden or 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
| #include <iostream> | |
| int main() { | |
| int i; | |
| int foo[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0}; | |
| for(i = 0; i < sizeof(foo)/sizeof(foo[0]); i++) | |
| { | |
| if(foo[i] == 0) | |
| { | |
| printf("Number 0 is at array position %i\n", i); |
This file contains hidden or 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
| class Slack(object): | |
| """ | |
| The Slack object for posting messages. | |
| """ | |
| def __init__(self): | |
| self.webhook = "" | |
| self.username = "Hal" | |
| self.icon_url = "http://i.imgur.com/hnDhvFB.jpg" |
This file contains hidden or 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
| func LogCapture(idx int, c chan string, client *http.Client, url string, lc string, wg *sync.WaitGroup) { | |
| defer wg.Done() | |
| wg.Add(idx) | |
| LogUrl := fmt.Sprintf("%s/%s/log", url, lc) | |
| request, err := http.NewRequest("GET", LogUrl, nil) | |
| if err != nil { | |
| log.Errorf("Error making new request: %s", err) | |
| } | |
| request.Header.Set("X-Powered-By", "logrhythmic") |