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
package main | |
/* | |
#cgo darwin CFLAGS: -DDARWIN -x objective-c | |
#cgo darwin LDFLAGS: -framework Cocoa | |
#import <Cocoa/Cocoa.h> | |
void DockRunning() { | |
int isRunning = 0; | |
NSWorkspace * ws = [NSWorkspace sharedWorkspace]; |
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
package main | |
/* | |
#cgo LDFLAGS: -framework SystemConfiguration | |
#include <SystemConfiguration/SystemConfiguration.h> | |
#include <stdlib.h> | |
*/ | |
import "C" | |
import ( | |
"errors" |
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
func checkDistribution(pkgPath string) (bool, error) { | |
const ( | |
xarHeaderMagic = 0x78617221 | |
xarHeaderSize = 28 | |
) | |
f, err := os.Open(pkgPath) | |
if err != nil { | |
return false, err | |
} |
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
package main | |
import ( | |
"bufio" | |
"bytes" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"os" |
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
// runs `managedsoftwareupdate --id=dep_bootstrap` in a loop. | |
// This utility is installed along with munkitools via InstallApplication during DEP enrollment. | |
// The utility is stopped/removed by a package called dep_complete which is the last item to run in the | |
// `dep_bootstrap` munki manifest. | |
package main | |
import ( | |
"fmt" | |
"log" |
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
#!/bin/bash | |
mkdir -p scripts | |
cat << EOF | |
#!/bin/bash | |
[[ $3 != "/" ]] && exit 0 | |
/bin/launchctl load /Library/LaunchDaemons/com.acme.osqueryd.plist |
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
package main | |
import ( | |
"crypto/tls" | |
"flag" | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"net/http/httputil" |
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
// Copyright (c) 2016 Marin Atanasov Nikolov <dnaeon@gmail.com> | |
// All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions | |
// are met: | |
// 1. Redistributions of source code must retain the above copyright | |
// notice, this list of conditions and the following disclaimer | |
// in this position and unchanged. | |
// 2. Redistributions in binary form must reproduce the above copyright |
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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>awesome go project</title> | |
</head> | |
<body> | |
<form class="form-upload" method="post" action="/upload"> | |
<fieldset> | |
<input type="text" name="first_name" /> |
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
package scoped | |
import ( | |
"errors" | |
"github.com/go-kit/kit/auth/jwt" | |
"github.com/go-kit/kit/endpoint" | |
"golang.org/x/net/context" | |
) |