#Country ban with UFW#
Grab your different country ip addresses and save as Linux IPTables
http://www.ip2location.com/free/visitor-blocker
##Add country## Run the following command
from flask import Flask, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
@app.route('/index') | |
def index(chartID = 'chart_ID', chart_type = 'bar', chart_height = 350): | |
chart = {"renderTo": chartID, "type": chart_type, "height": chart_height,} | |
series = [{"name": 'Label1', "data": [1,2,3]}, {"name": 'Label2', "data": [4, 5, 6]}] | |
title = {"text": 'My Title'} |
./imapsync --nofoldersizes --nosyncacls --syncinternaldates -sep2 / --host1 192.168.10.2 --user1="kim" --password1 'mysecretpasseord' --sep2 . --delete2 --regextrans2 's/^INBOX\.(.+)/$1/' --host2 192.168.10.57 --user2 [email protected] --password2 'myothersecretpassword' |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from os import listdir | |
import json | |
net = '/sys/class/net' | |
stat = net + '/{}/statistics/{}x_bytes' | |
interfaces = filter(lambda x: 'eth' in x, listdir(net)) |
#!/bin/bash | |
date=`date +%Y-%m-%d` | |
RETENTION_PERIOD="7" | |
HEADER="Backup data" | |
remove_oldfiles(){ | |
echo "Removing directory $1 files older than $RETENTION_PERIOD days" | wall | |
find $1 -type f -mtime +$2 -exec rm '{}' \; | |
} | |
BACKUPDIR="/disk0/svn_backup/001/" |
#!/usr/local/bin/python | |
import os | |
import plivo | |
import sys | |
from time import strftime | |
if not os.path.isdir(PATH): | |
sys.exit() |
#Country ban with UFW#
Grab your different country ip addresses and save as Linux IPTables
http://www.ip2location.com/free/visitor-blocker
##Add country## Run the following command
import xml.etree.ElementTree as ET | |
import urllib.request as MYURL | |
# tree = ET.parse('song.xml') | |
# rss = tree.getroot() | |
# for element in rss.findall('.channel/song'): | |
# print(element.attrib.get('sname')) | |
# print(element.findtext('title')) | |
# print(element.findtext('singer')) | |
kmaURL = "http://www.kma.go.kr/weather/forecast/mid-term-rss3.jsp?stnId=109" |
#!/usr/bin/env python3 | |
import requests | |
import sys | |
import xml.etree.ElementTree as ET | |
import datetime | |
# ICECAST RELATED CONSTANTS | |
STATS_URL = "http://<URL>" | |
ICECAST_USER = "<USER>" |
#!/usr/bin/env python3 | |
import argparse | |
import pprint | |
import os | |
import sys | |
import datetime | |
import signal | |
from time import sleep | |
from lxml import etree |
#!/usr/bin/env python | |
# Parse disk:* from lshw -xml | |
""" | |
Sample Output: | |
ATA Disk Hitachi HDS72105 /dev/sda | |
Disk Space: 500107862016 | |
Sector size: 512 |