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
#!/usr/bin/ruby | |
def resolve_node(node) | |
return node if node[-1] == '.'[0] | |
return node unless $context.has_key? "ORIGIN" | |
return "#{node}.#{$context["ORIGIN"]}" | |
end | |
ARGS.each do |filename| | |
File.open filename, 'r' do |file| |
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 <libxml/tree.h> | |
#include <libxml/xpath.h> | |
#include <libxml/HTMLparser.h> | |
#include <stdio.h> | |
#define FILENAME "index.html" | |
inline static | |
void initialize() | |
{ |
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 <gtk/gtk.h> | |
static | |
void destroy(GtkWidget *widget, gpointer data) | |
{ | |
gtk_main_quit() ; | |
} ; | |
static | |
gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer data) |
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 <libxml/tree.h> | |
#include <libxml/xpath.h> | |
#include <libxml/HTMLparser.h> | |
#include <stdio.h> | |
#define FILENAME "index.html" | |
inline static | |
void initialize() | |
{ |
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
function getImageSize(img) { | |
var i = $('<img/>') | |
.css('visibility', 'hidden') | |
.attr('src', $(img).attr('src')) | |
.appendTo('body'); | |
var r = { | |
width: i.width() | |
, height: i.height() | |
}; | |
i.remove(); |
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
FROM base/arch | |
RUN pacman -Sy reflector --noconfirm --noprogressbar | |
RUN reflector -c FR -f 3 > /etc/pacman.d/mirrorlist | |
RUN pacman -Syu --noconfirm --noprogressbar && pacman-db-upgrade && pacman -Scc --noconfirm | |
RUN pacman --noconfirm --noprogressbar -S git gcc cmake make | |
RUN pacman -S glut glew qt4 --noconfirm --noprogressbar | |
RUN git clone git://scm.gforge.inria.fr/sofa/sofa.git | |
RUN cd sofa && cmake . && cmake . | |
RUN cd sofa && make |
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
FROM debian | |
MAINTAINER Denis Wernert <[email protected]> | |
# Might want to bust cache here if looking to upgrade the distribution | |
RUN apt-get update && apt-get upgrade -y | |
# Install build dependencies | |
RUN apt-get install -y mercurial \ | |
make \ | |
gcc \ |
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 ( | |
"encoding/json" | |
"log" | |
"net/http" | |
"strings" | |
"time" | |
) |
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
#!/usr/bin/env python | |
""" | |
Largely based on https://github.com/docker/docker/issues/6354#issuecomment-60817733 | |
All credit goes to https://github.com/adamhadani | |
""" | |
import logging | |
import os | |
import os.path | |
import sys | |
import argparse |
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 | |
# Adapted from http://www.linuxjournal.com/content/server-hardening?page=0,2 | |
PATH=$PATH:/sbin | |
WD=`pwd` | |
TMP_DIR=$WD/tmp | |
IP_TMP=$TMP_DIR/ip.temp | |
IP_BLOCKLIST=$WD/ip-blocklist.conf | |
IP_BLOCKLIST_TMP=$TMP_DIR/ip-blocklist.temp | |
list="nigerian russian lacnic exploited-servers" |