Skip to content

Instantly share code, notes, and snippets.

@eternnoir
eternnoir / gist:5797146
Last active December 18, 2015 14:28
NCU自動簽到簽退 - 掛了不負責
import mechanize
import cookielib
import sys
from BeautifulSoup import BeautifulSoup
import html2text
import urllib
def getProjectNum(sou):
msg = str(sou.findAll('input', attrs={'type': 'radio'})[0])
items = msg.strip().split(' ')
@eternnoir
eternnoir / gist:5811818
Created June 19, 2013 05:13
NodeJS test
var Browser = require("zombie");
var myArgs = require('optimist').argv,
help = 'This would be a great place for real help information.';
if ((myArgs.h)||(myArgs.help)) {
console.log(help);
process.exit(0);
}
@eternnoir
eternnoir / gist:6348241
Created August 27, 2013 00:12
Atchlinux find biggest pkg
#!/usr/bin/env python
#
# bigpkg : find packages that require a lot of space on your system
# v0.4.0 (2011-07-29)
#
# Copyright (c) 2009-2011 by Allan McRae <allan@archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@eternnoir
eternnoir / gist:6432908
Created September 4, 2013 04:57
Linux Streaming
#!/bin/sh -xe
INFO=$(xwininfo -frame)
API_KEY="YOUR_API_KEY_GOES_HERE"
WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+')
WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/\+/,/' )
FPS="15"
INRES='1680x1010'
@eternnoir
eternnoir / gist:6521665
Created September 11, 2013 10:06
linode vpn use
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
@eternnoir
eternnoir / gist:7556322
Created November 20, 2013 02:02
wine方塊字,使用Droid Font
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink]
"FontLinkControl"=dword:00004000
"FontLinkDefaultChar"=dword:00003000
/* 平滑化(anti-alias) */
/* 如果覺得開了之後字體難看,把三個Y改成N */
[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"ClientSideAntiAliasWithCore"="Y"
"ClientSideAntiAliasWithRender"="Y"
"ClientSideWithRender"="Y"
@eternnoir
eternnoir / gist:7636960
Created November 25, 2013 05:59
/etc/init.d/vmware
#!/usr/bin/env bash
#
# Copyright 1998-2008 VMware, Inc. All rights reserved.
#
# This script manages the services needed to run VMware software.
#
# VMWARE_INIT_INFO
ETCDIR=/etc/vmware
@eternnoir
eternnoir / gist:7670741
Last active September 11, 2023 11:34
Area11論壇 LoginBot. python filename.py id pw
#! /usr/bin/env python2.7
import cookielib
import sys
import urllib
from BeautifulSoup import BeautifulSoup
import mechanize
class A_11_loginBot(object):
def __init__(self,id,pw,action=""):
@eternnoir
eternnoir / gist:7701964
Created November 29, 2013 05:30
pandoc markdown to pdf chinese template
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\usepackage{titlesec}
\titleformat{\section}{\LARGE\filcenter}{}{1em}{}
\titleformat{\subsection}{\Large\filcenter}{}{1em}{}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
@eternnoir
eternnoir / gist:7703139
Created November 29, 2013 08:58
/etc/init.d/vmware
#!/usr/bin/env bash
#
# Copyright 1998-2008 VMware, Inc. All rights reserved.
#
# This script manages the services needed to run VMware software.
#
# VMWARE_INIT_INFO
ETCDIR=/etc/vmware