Skip to content

Instantly share code, notes, and snippets.

View napsy's full-sized avatar

Luka Napotnik napsy

View GitHub Profile
@napsy
napsy / gist:939481
Created April 24, 2011 11:00
Adding watchpoints to memory regions to detect r/w access
// Author: Luka Napotnik <[email protected]>
// This code is public domain.
#include <stdlib.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
@napsy
napsy / gist:940308
Created April 25, 2011 09:26
Quickly switch svn repository URL
#!/bin/bash
if [ $# -eq 0 ]
then
echo "$0 [home|office]"
exit
fi
if [ $1 == "home" ]
then
@napsy
napsy / goweb
Created July 9, 2012 11:04
goweb modifications
diff --git a/goweb/Makefile b/goweb/Makefile
index fe6c71e..69f976a 100644
--- a/goweb/Makefile
+++ b/goweb/Makefile
@@ -1,5 +1,3 @@
-include $(GOROOT)/src/Make.inc
-
TARG=goweb
GOFILES=\
constants.go \
@napsy
napsy / goweb
Created July 9, 2012 11:04
goweb modifications
diff --git a/goweb/Makefile b/goweb/Makefile
index fe6c71e..69f976a 100644
--- a/goweb/Makefile
+++ b/goweb/Makefile
@@ -1,5 +1,3 @@
-include $(GOROOT)/src/Make.inc
-
TARG=goweb
GOFILES=\
constants.go \
str := "From: mail notification service <" + GlobalConfig.MailAddress + ">\nTo: Owner <" + repository.NotifyEmail + ">\nSubject: [" + repository.Name + "] error notification\n\nSomething went wrong while handling the repository '" + repository.Name + "'. Please check the output log files!\n"
auth := smtp.PlainAuth(GlobalConfig.MailUsername, GlobalConfig.MailUsername, GlobalConfig.MailPassword, GlobalConfig.MailHost)
err := smtp.SendMail(GlobalConfig.MailHost + ":25", auth, GlobalConfig.MailAddress, []string{repository.NotifyEmail}, []byte(str))
if err != nil {
fmt.Printf("Error sending mail: %s\n", err)
}