“Windows” 标签页面:
-
Windows下编译安装Privoxy
首先,要安装MingW。在此不赘述。当然,用cygwin也可以,但是这样编译出来的Privoxy没有GUI图形界面。PS:Privoxy在jcc.c那里已经自动识别了MingW,并且嵌入了Windows GUI的API,因此编译出来就可以自己采用图形界面了。
然后,在这里下载Privoxy的源代码,本文以privoxy-3.0.18-stable为例。
进入privoxy-3.0.18-stable源码目录,执行以下命令,进入bash:
bash
执行以下命令,进行配置:
autoheader
autoconf
./configure –prefix=/r/privoxy –enable-mingw32 –disable-pthread稍微解释以下configure的各个参数。–prefix参数指明privoxy的安装目录,/r/privoxy是mingw表示windows文件系统的方式,即R盘的privoxy文件夹。–enable-mingw32指明了为mingw环境配置,其实不指明配置程序也会自动检测得到。–disable-pthread是禁用POSIX的pthread,privoxy会自动使用windows API的thread来实现线程,具体参照errlog.c的部分代码:
/********************************************************************* * * Function : get_thread_id * * Description : Returns a number that is different for each thread. * * XXX: Should be moved elsewhere (miscutil.c?) * * Parameters : None * * Returns : thread_id * *********************************************************************/ static long get_thread_id(void) { long this_thread = 1; /* was: pthread_t this_thread;*/ #ifdef __OS2__ PTIB ptib; APIRET ulrc; /* XXX: I have no clue what this does */ #endif /* __OS2__ */ /* FIXME get current thread id */ #ifdef FEATURE_PTHREAD this_thread = (long)pthread_self(); #ifdef __MACH__ /* * Mac OSX (and perhaps other Mach instances) doesn't have a debuggable * value at the first 4 bytes of pthread_self()'s return value, a pthread_t. * pthread_t is supposed to be opaque... but it's fairly random, though, so * we make it mostly presentable. */ this_thread = abs(this_thread % 1000); #endif /* def __MACH__ */ #elif defined(_WIN32) this_thread = GetCurrentThreadId(); #elif defined(__OS2__) ulrc = DosGetInfoBlocks(&ptib, NULL); if (ulrc == 0) this_thread = ptib -> tib_ptib2 -> tib2_ultid; #endif /* def FEATURE_PTHREAD */ return this_thread; }
配置成功后,编译安装:
make
make install
其实,make后已经有privoxy.exe,可以下载官方的Win32版本的ZIP包,替换里面的privoxy.exe即可使用,无需再make install。
一些注意的问题:
1、编译时提示未定义“NI_MAXSERV”
编译时出现如下错误:
jbsockets.c: In function ‘get_host_information’:
jbsockets.c:979:22: error: ‘NI_MAXSERV’ undeclared (first use in this function)jbsockets.c:979:22: note: each undeclared identifier is reported only once for e
ach function it appears in
make: *** [jbsockets.o] Error 1
修改jbsockets.c,在
const char jbsockets_h_rcs[] = JBSOCKETS_H_VERSION;
前面加上:
/* MOD BY Creke START */
#ifndef NI_MAXSERV#define NI_MAXSERV 32
#endif
/* MOD BY Creke END */
说实话,这是configure没有识别getnameinfo和getaddrinfo,因此config.h中没有定义HAVE_RFC2553所致。这些依赖于官方修复,再次仅拷贝ws2tcpip.h中的相关值进来,作临时修补。
2、MingW默认安装的话,需要额外的库吗?
需要zlib库,在mingw中又称为libz,可以在这里下载。当然,如果需要将privoxy拷贝到其它电脑运行,需要将libz-1.dll拷贝到privoxy程序目录中。
3、额外的DLL?
libgcc_s_dw2-1.dll
4、编译好如何发行和安装?
推荐下载官方发行的win32的zip包,将编译好的privoxy.exe覆盖。同时别忘记拷贝依赖的dll。
-
让SSH/SOCKS成为全局代理的软件们(Windows+Linux)
Windows下的有:
前者比较好用,可控规则较多。我正在使用。
Linux下的有:
proxychain功能较多,支持多个代理轮询等;redsocks据说支持android;tsocks配置简单。
proxychains教程
假设代理为127.0.0.1,端口为7070。我在Ubuntu下安装。
安装很简单:
sudo apt-get install proxychains
配置:
sudo vi /etc/proxychains.conf
把最后的“[ProxyList]”部分配置为自己的代理即可:
socks4 127.0.0.1 7070
使用方法:
proxychains <程序名>
即可让程序使用代理。
redsocks教程
严格意义上来说,proxychains不算自动的全局代理,有没有像Proxifier这样,开了之后自动让所有启动的程序都走系统代理呢?答案就是redsocks。
首先安装Ubuntu编译环境和必要的库:
sudo apt-get install autoconf automake libtool libevent-dev g++
下载源代码,然后编译安装:
./mkauto.sh
cp redsocks /usr/local/bin/
配置文件为:
base {
// debug: connection progress & client list on SIGUSR1
log_debug = off;// info: start and end of client session
log_info = off;/* possible `log’ values are:
* stderr
* file:/path/to/file
* syslog:FACILITY facility is any of "daemon", "local0"…"local7"
*/
log = "file:/dev/null";
// log = stderr;
// log = "file:/path/to/file";
// log = "syslog:local7";// detach from console
daemon = on;/* Change uid, gid and root directory, these options require root
* privilegies on startup.
* Note, your chroot may requre /etc/localtime if you write log to syslog.
* Log is opened before chroot & uid changing.
*/
// user = nobody;
// group = nobody;
// chroot = "/var/chroot";/* possible `redirector’ values are:
* iptables – for Linux
* ipf – for FreeBSD
* pf – for OpenBSD
* generic – some generic redirector that MAY work
*/
redirector = iptables;
}redsocks {
/* `local_ip’ defaults to 127.0.0.1 for security reasons,
* use 0.0.0.0 if you want to listen on every interface.
* `local_*’ are used as port to redirect to.
*/
local_ip = 127.0.0.1;
local_port = 12345;// `ip’ and `port’ are IP and tcp-port of proxy-server
ip = 127.0.0.1;
port = 7070;// known types: socks4, socks5, http-connect, http-relay
type = socks5;// login = "foobar";
// password = "baz";
}redudp {
// `local_ip’ should not be 0.0.0.0 as it’s also used for outgoing
// packets that are sent as replies – and it should be fixed
// if we want NAT to work properly.
local_ip = 127.0.0.1;
local_port = 10053;// `ip’ and `port’ of socks5 proxy server.
ip = 10.0.0.1;
port = 1080;
login = username;
password = pazzw0rd;// kernel does not give us this information, so we have to duplicate it
// in both iptables rules and configuration file. By the way, you can
// set `local_ip’ to 127.45.67.89 if you need more than 65535 ports to
// forward
// This limitation may be relaxed in future versions using contrack-tools.
dest_ip = 8.8.8.8;
dest_port = 53;udp_timeout = 30;
udp_timeout_stream = 180;
}dnstc {
// fake and really dumb DNS server that returns "truncated answer" to
// every query via UDP, RFC-compliant resolver should repeat same query
// via TCP in this case.
local_ip = 127.0.0.1;
local_port = 5300;
}// you can add more `redsocks’ and `redudp’ sections if you need.
这里的配置没有配置udp的代理部分,只是配置了tcp即redsocks部分。监听端口是12345。日志关闭了,因为好像我下载的当前版本无论怎么样都产生一堆调试日志,不知道以后会不会修复这点。
启动关闭脚本redsocks.sh为(via):
#! /bin/bash
SSHHOST=creke
SSHPORT=22
SSHUSR=creke
SSHPWD=crekeSSHDAEMON=/usr/local/bin/plink
SSHPIDFILE=/var/run/sshtunnel.pidstart_ssh()
{
echo "Start SSH Tunnel Daemon: "
start-stop-daemon -b -q -m -p $SSHPIDFILE –exec $SSHDAEMON -S \
— -N -D 127.0.0.1:7070 -P $SSHPORT -pw $SSHPWD $SSHUSR@$SSHHOST
echo "SSH Tunnel Daemon Started."
}stop_ssh()
{
#ps aux|grep "ssh -NfD 1234"|awk ‘{print $2}’|xargs kill
if [ -f $SSHPIDFILE ]; then
PID=$(cat $SSHPIDFILE)
kill $PID
while [ -d /proc/$PID ];
do
sleep 1
done
fi
rm -rf $SSHPIDFILE
echo "SSH Tunnel Daemon Stoped."
}case "$1" in
start)
start_ssh
cd /usr/local/redsocks
if [ -e redsocks.log ] ; then
rm redsocks.log
fi
./redsocks -p /usr/local/redsocks/redsocks.pid #set daemon = on in config file
# start redirection
# iptables -t nat -A OUTPUT -p tcp –dport 80 -j REDIRECT –to 12345
# iptables -t nat -A OUTPUT -p tcp –dport 443 -j REDIRECT –to 12345
# Create new chain
iptables -t nat -N REDSOCKS# Ignore LANs and some other reserved addresses.
iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN
iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN
iptables -t nat -A REDSOCKS -d 192.168.0.0/16 -j RETURN
iptables -t nat -A REDSOCKS -d 224.0.0.0/4 -j RETURN
iptables -t nat -A REDSOCKS -d 240.0.0.0/4 -j RETURN# Anything else should be redirected to port 12345
iptables -t nat -A REDSOCKS -p tcp -j REDIRECT –to-ports 12345
# Any tcp connection should be redirected.
iptables -t nat -A OUTPUT -p tcp -j REDSOCKS
;;stop)
stop_ssh
cd /usr/local/redsocks
if [ -e redsocks.pid ]; then
kill `cat redsocks.pid`
rm redsocks.pid
else
echo already killed, anyway, I will try killall
killall -9 redsocks
fi
# stop redirection
iptables -t nat -F OUTPUT
iptables -t nat -F REDSOCKS
iptables -t nat -X REDSOCKS
;;start_ssh)
start_ssh
;;stop_ssh)
stop_ssh
;;clean_dns)
# iptables -A INPUT -p udp –sport 53 -m state –state ESTABLISHED -m you-know-who -j DROP -m comment –comment "drop you-know-who dns hijacks"
echo this function not finished
;;*)
echo "Usage: redsocks start|stop|start_ssh|stop_ssh|clean_dns" >&2
exit 3
;;
esaciptables的规则是让所有的TCP包都发送到redsocks监听的端口12345。本脚本还整合了ssh的daemon启动,使用start-stop-daemon来实现。
启动和关闭:
将启动关闭脚本中的开头的几个变量配置好
启动命令:sudo ./redsocks.sh start
关闭命令:sudo ./redsocks.sh stop
-
Windows下使用Xmanager连接SSH开启Linux远程桌面的方法
在Windows下,可以使用“Xmanager Enterprise 3”连接SSH。这个套件包集成了:连接SSH用的“Xshell”;用于文件传送SFTP或FTP的“Xftp”;用于打印服务的“Xlpd”;还有当然就是显示X窗体的“Xmanager”。
在Windows下使用它,可以很方便地开启窗口,比如:
xcalc
可以开启图形化界面的Linux计算器。
而开启Linux远程桌面的方法,则分不同的图形环境,有不同的命令。
在KDE环境下,开启远程桌面的命令是:
startkde
在gnome环境下,开启远程桌面的命令是:
gnome-session
好了,就是这样。
-
Windows Live Writer (Portable) 绿色集成版(TriKnightz专用版)1.0发布!
用了两个小时,研究完毕WLW,发现原来M$也有那么开放和好用的工具。于是YY起来:这开发者不会是从股沟跳槽到M$的吧,呵呵。
好了,附上软件使用说明:
使用说明
Windows Live Writer (Portable) 绿色集成版(TriKnightz专用版)1.0§本软件为绿色便携集成版,供TriKnightz团队内部使用。
§直接在本地写好一切博客,然后一键发表!没错,一切就这么简单!
§支持wordpress分类、标签、发布时间等元素!●完整使用Windows Live Writer各项基本功能!
●同时集成flickr、picasa相册功能,你可以在一个软件里上传、插入、管理你的日志图片!
●集成SkyDrive功能,可以轻松使用微软的5G网络硬盘插入附件!
●集成程序源代码彩色高亮功能,还支持VS等IDE环境彩色代码直接粘贴!程序包括Windows Live Writer14.0.8064.206 zh-cn和WindowsLiveWriterPortable 2.0.0.0。
程序包括以下插件:
1.CodePaste v1.0.3345
2.vpaste 1.2.0.0
3.Wilco.SyntaxHighlighter 0.5.0.0
4.Friendly.Flickr 2.7.2.2
5.微软官方Picasa支持插件 1.2.0.0
6.SkyDrive Attachment Plugin已知问题:
1.某些环境下无法真正删除本地草稿,需要手动前往Data\Settings\Dir1.dat目录删除,不影响使用。端午节快乐!
Made By HHJ
2009.05.28下载地址:
1.群共享
2.
PS:今天突然良心发现,用ZIP打包,不用RAR了……
PS2:微软的服务就是不快……skydrive挺慢的……
PS3:如果大家还不会用,以后再写详细教程和使用技巧。嗯。
时间脚印
| 一 | 二 | 三 | 四 | 五 | 六 | 日 |
|---|---|---|---|---|---|---|
| « 一 | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | ||||
最新文章
- 从火车票提取完整实名信息
- CentOS安装git
- firefox蛋疼升级到9.0.1后提示“附加组件不兼容”解决办法
- 关于SSL证书通用名(CN)通配符的实验
- CentOS下安装使用start-stop-daemon
最近评论
- Xiaoxia 在 从火车票提取完整实名信息 上的评论
- 白羊座和什么座最配 在 从火车票提取完整实名信息 上的评论
- 有DNS的地方就能上网 « 细节的力量 在 用DNS隧道实现免费上网 上的评论
- creke 在 Windows下编译安装Privoxy 上的评论
- 小铱 在 Windows下编译安装Privoxy 上的评论