- Create a directory to hold your code.
- Open Bowery.
- Create a new application.
- Search for an image named "PHP 5.5 Apache" and click it.
- Empty the command to run input, since we'll be using the apache httpd.
- Set the remote directory to "/var/www/html".
- Set the local directory to the directory your code lives in.
- Wait until the application is running.
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
ports () { | |
local items="$(sudo lsof -n -i -P | tr -s " " | cut -d " " -f 2,9,10 | \grep "LISTEN")" | |
printf "%-10s %-20s %s\n" "PID" "ADDRESS" "COMMAND" | |
if [[ "${items}" == "" ]] | |
then | |
return | |
fi | |
while read item | |
do | |
pid="$(echo "${item}" | awk '{print $1}')" |
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 ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
var tasks []int | |
var wg sync.WaitGroup |
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
#include <assert.h> | |
#include <string.h> | |
void reverse(char *str) { | |
size_t len = strlen(str); | |
size_t half = len >> 1; | |
for (int i = 0; i < half; i++) { | |
int ei = (len - 1) - i; | |
char begin = str[i]; |
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 ( | |
"github.com/fsouza/go-dockerclient" | |
"os" | |
"fmt" | |
) | |
func main() { | |
client, err := docker.NewClient("unix:///var/run/docker.sock") |
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 ( | |
"flag" | |
"github.com/Bowery/prompt" | |
"os" | |
) | |
var ( | |
prefix string |
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
# _/Users/larz/Programming/random | |
duplicate symbol __Z3addii in: | |
/var/folders/kz/fgkgncp17mg8t84dm5jjvzvm0000gn/T//go-link-Vas0Gn/000000.o | |
/var/folders/kz/fgkgncp17mg8t84dm5jjvzvm0000gn/T//go-link-Vas0Gn/000001.o | |
ld: 1 duplicate symbol for architecture x86_64 | |
clang: error: linker command failed with exit code 1 (use -v to see invocation) | |
/usr/local/go/pkg/tool/darwin_amd64/6l: running clang failed: unsuccessful exit status 0x100 |
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
In file included from ./osquery.go:5: | |
In file included from ./osquery.hh:4: | |
/usr/local/include/osquery/sql.h:5:10: fatal error: 'map' file not found | |
#include <map> |
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
// Writes stdin to output.log | |
package main | |
import ( | |
"os" | |
"io" | |
) | |
func main() { | |
output, err := os.Create("output.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
ports = [22, 80] | |
data = {ports: {}} | |
ports.forEach(function (p) { | |
var addr = 'localhost:' + p | |
data.ports[p] = addr // For some reason keys end up strings, event though p is a number. | |
}) | |
console.log(data.ports) |
NewerOlder