iptables筆記

#!/bin/bash

if [ $UID -ne 0 ]; then
    sudo $0 $*
    exit
fi

# Clear default rules
iptables -F
iptables -X
iptables -Z

# Default policy for INPUT
iptables -P INPUT DROP

# Accept for loopback
iptables -A INPUT -i lo -j ACCEPT

# Allow ssh, http
iptables -A INPUT -p tcp --dport 22 -j ACCEPT …

Continue reading »

Python對於Encoding的鳥事

我寫了一個script去parse這個東西....

一開始是這麼寫的

# -*- coding: utf-8 -*-
import requests, re

urls = """http://www.shute.kh.edu.tw/~t1248/voc7000-AB.htm
http://www.shute.kh.edu.tw/~t1248/voc 7000 - CD.htm
http://www.shute.kh.edu.tw/~t1248/voc7000- EF.htm
http://www.shute.kh.edu.tw/~t1248/voc 7000 - GHIJ.htm …

Continue reading »

Ubuntu Server Setup Note

Config

Default Editor For sudoedit

sudo update-alternatives --config editor

Static IP

sudoedit /etc/network/interfaces

auto eth0
iface eth0 inet static
address <address>
netmask <mask>
network <network>
broadcast <broadcast>
gateway <gateway>
dns-nameservers 8.8.8.8

Problems

sendmail was slow

edit /etc/hosts

127.0.0.1       localhost localhost.localdomain …

Continue reading »

XAMPP也受到heartbleed漏洞影響

XAMPP 受到 heartbleed 漏洞影響示意圖

phpinfo

XAMPP官方公告及修補方法

有使用XAMPP的使用者們,快點進行修補囉!

Continue reading »

Logdown Hacks

Routing Bug

我從blogger匯入文章,但是custom url內有.的出現,結果就噴Error 404

解決方法

http://logdown.com/account/posts/198288-what-is-reset.css/edit http://logdown.com/account/posts/198288/edit

進入編輯後,把dot拿掉即可

dot-in-custom-url

大量刪除分類

吐嘈:POST轉頁超慢的,我剛剛從亂七八糟的blogger搬家過來,刪categories刪到吐血

// ==UserScript==
// @name        ajax-delete-categories
// @namespace   logdown.com
// @include     http://logdown.com/account/blogs/inndy/categories
// @include     https://logdown.com/account …

Continue reading »