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
"""A module of functions about non-zero Fibonacci numbers.""" | |
import sys | |
def fib(n): | |
"""Print the non-zero Fibonacci numbers less than n.""" | |
a, b =1,1 | |
while b<n: | |
print b, | |
a, b = b, a+b |
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 python2 | |
"""copy of pylibpcap, BSD license http://sourceforge.net/projects/pylibpcap/""" | |
import pcap | |
import sys | |
import string | |
import time | |
import socket | |
import struct |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet</title> | |
<link rel="stylesheet" href="http://code.leafletjs.com/leaflet-0.3.1/leaflet.css" /> | |
<script src="http://code.leafletjs.com/leaflet-0.3.1/leaflet.js"></script> | |
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> | |
<script src="https://raw.github.com/gist/2197042/2b90c41b39b7d5b3a851d8f256de2ebd3fe1fb74/leaflet-google.js"></script> | |
</head> | |
<body> |
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
def l2p6(x): | |
ans = (x**3)+(2*(x**2))+(3*x)-2 | |
print ans |
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
def l2p7(x): | |
ans = (3+x)/(x**2.) | |
print ans |
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 | |
# ingesting csv files into logstash requires removal of the header row in the | |
# first line of the file. This script processes csv files in the directory | |
# where it is executed. Script runs continuously until stopping with ctrl+Z | |
#specify directory to send files for ingest (without trailing /) | |
DEST=/home/user/Test/forIngest | |
echo "processing csv files in $(pwd) for ingest by logstash..." |
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 | |
# CSV to JSON converter using BASH | |
# original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/ | |
# thanks SecaGuy! | |
# Usage ./csv2json.sh input.csv > output.json | |
input=$1 | |
[ -z $1 ] && echo "No CSV input file specified" && exit 1 | |
[ ! -e $input ] && echo "Unable to locate $1" && exit 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
input { | |
http_poller { | |
# List of urls to hit | |
# URLs can either have a simple format for a get request | |
# Or use more complex HTTP features | |
urls => { | |
BWI => "http://services.faa.gov/airport/status/BWI?format=application/json" | |
IAD => "http://services.faa.gov/airport/status/IAD?format=application/json" | |
DCA => "http://services.faa.gov/airport/status/DCA?format=application/json" | |
} |
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
sudo dpkg-reconfigure keyboard-configuration #to reconfigure your keyboard. | |
#Choose English (US) for keyboard layout (second page of configuration). | |
#Then either reboot or | |
invoke-rc.d keyboard-setup start #to reload the keymap.Code: Select all |
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 | |
# Adds R to apt and install it | |
# | |
# Instructions: | |
# sudo chmod 700 InstallR.sh | |
# ./FirstTimeInstallR.sh | |
# Install R | |
sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list |
OlderNewer