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
//========================================================== | |
// CUSTOM JAVASCRIPT CONSOLE | |
// built by jakub fiala | |
// | |
// this small script intercepts the standard console methods | |
// and provides a way of accessing their messages, | |
// as well as stack traces, which is really cool. | |
// it formats the stack traces for popular browsers | |
// | |
// contributions welcome! |
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
#define _GNU_SOURCE | |
#include <dlfcn.h> | |
#include <string.h> | |
int system(const char *cmd) { | |
static int (*realsystem)(const char *); | |
if (!realsystem) realsystem = dlsym(RTLD_NEXT, "system"); | |
if (strchr(cmd, ';') || strchr(cmd, '`') || strstr(cmd, "&&") || strstr(cmd, "../")) { | |
return 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
#!/bin/bash | |
COMMAND=$1 | |
HOST=$2 | |
case $COMMAND in | |
add) | |
shift;shift | |
if [[ ! $HOST ]]; then | |
echo No host specified. |