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 | |
# | |
# simulwan-bridge.sh | |
# Nicolargo - 2012 | |
# | |
############################################################################## | |
# Nom des interfaces ou l'on doit faire les simulations | |
# eth0 cote LAN local |
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
[cpu] | |
# Limits values for CPU user in % | |
# Defaults values if not defined: 50/70/90 | |
user_careful=50 | |
user_warning=70 | |
user_critical=90 | |
# Limits values for CPU system in % | |
# Defaults values if not defined: 50/70/90 | |
system_careful=50 | |
system_warning=70 |
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 | |
# | |
# Simple Firewall configuration. | |
# | |
# Author: Nicolargo | |
# | |
# chkconfig: 2345 9 91 | |
# description: Activates/Deactivates the firewall at boot time | |
# | |
### BEGIN INIT INFO |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
NBCORE=`nproc` | |
FREEMEM=`free -th | grep "buffers/cache" | awk '{print $4}'` | |
TIME=30 | |
echo "START CPU stress" | |
echo "$NBCORE logical core" | |
echo | |
echo "Stress CPU user - $TIME seconds" | |
stress --cpu $NBCORE -t $TIME | |
# echo |
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
import threading | |
import docker | |
import time | |
class ThreadStats(threading.Thread): | |
def __init__(self, client, container): | |
super(ThreadStats, self).__init__() | |
self._stop = threading.Event() | |
self.container = container |
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
############################################################################# | |
# Apply a function to a list | |
############################################################################# | |
# Instead of... | |
newlist = [] | |
for word in oldlist: | |
newlist.append(word.upper()) | |
# ... use 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Timestamp compression test bed | |
# | |
# | |
import sys | |
import array |
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
import asyncore | |
import socket | |
class PortScanner(asyncore.dispatcher): | |
def __init__(self, host, port): | |
self.host = host | |
self.port = port | |
asyncore.dispatcher.__init__(self) |
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
onename |
OlderNewer