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
var App = express(); | |
App.engine('html', require('ejs').renderFile); | |
App.set('views', '/'); | |
App.set('view engine', 'html'); | |
App.use(function(req, res, next){ | |
res.locals.title = 'Test'; | |
next(); | |
}); |
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 <sys/types.h> | |
#include <sys/stat.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <syslog.h> | |
#include <string.h> |
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
find . -type d -empty | xargs ls | grep -v ./.git/ | sed -e 's/:$/\/.gitkeep/' | xargs touch |
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/sh | |
echo "Flushing iptables rules..." | |
sleep 1 | |
iptables -F | |
iptables -X | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
iptables -P INPUT ACCEPT |
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/sh | |
# Reset Firewall | |
iptables -t filter -F | |
iptables -t filter -X | |
# Bloquage total | |
iptables -t filter -P INPUT DROP | |
iptables -t filter -P OUTPUT DROP | |
iptables -t filter -P FORWARD DROP | |
# Ne pas casser les connexions |
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
public boolean resoudre(int k){ | |
if(k==this.N){ | |
return true; | |
} | |
for(int i=0; i<this.N; i++){ | |
for(int j=0; j<this.N; j++){ | |
//On parcours l'échiquier à la recherche d'une position valide | |
Piece p = this.creerPiece(i,j); | |
//On teste la position de la piece | |
if(p.compatible(this.pieces)){ |
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 formlyFieldsFromSchema(sschema) { | |
var fields = []; | |
var currentGroup = fields; | |
var groupStack = []; | |
var callbacks = { | |
leaf: function (sschema, key) { | |
var schema = sschema.schema(key); | |
//SimpleSchema <-> formly mapping | |
var mapping = { |
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/sh | |
if [ $# -lt 3 ]; then | |
echo "Usage: $0 url_format seq_start seq_end [wget_args]" | |
exit | |
fi | |
url_format=$1 | |
seq_start=$2 | |
seq_end=$3 |
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
################################################### | |
# Offset an IP address by any number of addresses # | |
################################################### | |
offset_ip(){ | |
IP=$1 | |
OFFSET=$2 | |
# Convert IP as hexadecimal number | |
IP_HEX=$(printf '%.2X%.2X%.2X%.2X\n' `echo $IP | sed -e 's/\./ /g'`) |