- ライブラリをインストール
$ sudo apt install libgeoip1 libgeoip-dev geoip-bin
- Pythonのライブラリをインストール
$ pip install GeoIP
- 実行例
In [1]: import GeoIP
import numpy as np | |
import pandas as pd | |
def make_datasets(n=100, an=5): | |
data = np.abs(np.random.randn(n)) | |
r_idx = np.random.randint(1, n, an) | |
for i in r_idx: | |
data[i] = data[i] + (data.mean() * 5) | |
return pd.DataFrame(data) |
import numpy as np | |
from scipy import stats | |
data = np.random.randn(10) | |
def make_datasets(n=1000, r=3): | |
data = np.abs(np.random.randn(n)*10) | |
for i in range(r): | |
ab_ind = np.random.randint(n) | |
data[ab_ind] += 100 |
import sys | |
""" | |
wget 'http://nami.jp/ipv4bycc/cidr.txt.gz' | |
gunzip cidr.txt.gz | |
grep '^JP' cidr.txt | awk '{print $2}' > cidr_JP.txt | |
""" | |
try: | |
import StringIO as stringio |
#!/root/miniconda3/bin/python | |
# -*- coding: utf-8 -*- | |
import os | |
import time | |
import requests | |
import re | |
import pandas as pd | |
import numpy as np | |
from os.path import abspath, dirname, isfile |
$ sudo apt install libgeoip1 libgeoip-dev geoip-bin
$ pip install GeoIP
In [1]: import GeoIP
#!/usr/local/bin/python | |
# coding: utf-8 | |
import sys | |
import os | |
import subprocess | |
LOG = '/home/webuser/scanner.log' | |
class Scanner: |
set statusline=%F | |
set statusline+=%m | |
set statusline+=[ENC=%{&fileencoding}] | |
set statusline+=%= | |
set statusline+=[LOW=%l/%L] | |
set laststatus=2 |
import numpy as np | |
import sys | |
def _str2ep(s): | |
done = set() | |
l = len(s) | |
arr = [] | |
for i in s: | |
if not i in done: | |
x = s.count(i) |
$(document).ready(function(){ | |
//Check to see if the window is top if not then display button | |
$(window).scroll(function(){ | |
if ($(this).scrollTop() > 500) { | |
$('.scrollToTop').fadeIn(); | |
} else { | |
$('.scrollToTop').fadeOut(); | |
} | |
}); |
import numpy as np | |
import matplotlib.pyplot as plt | |
# prepare data | |
d = 2 | |
N = 3 | |
mean = 5 | |
rng = np.random.RandomState(100) |