Mac safari proxy automatic switcher

https://www.zhihu.com/question/20818790

 

 

作者:Liap
链接:https://www.zhihu.com/question/20818790/answer/16481541
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

tell application “Finder”
set dialog to display dialog “GoAgent switch. Please select:” buttons {“ON”, “OFF”, “Cancel”} default button “ON” with title “GoAgent”
set interface to button returned of dialog
end tell

if interface is “Cancel” then
return
end if

if interface is “ON” then
tell application “Terminal”
do script “python goagent/local/proxy.py”
end tell

do shell script “networksetup -setwebproxy Wi-Fi 127.0.0.1 8087” user name “***” password “***” with administrator privileges
do shell script “networksetup -setsecurewebproxy Wi-Fi 127.0.0.1 8087” user name “***” password “***” with administrator privileges
do shell script “networksetup -setwebproxystate Wi-Fi on” user name “***” password “***” with administrator privileges
do shell script “networksetup -setsecurewebproxystate Wi-Fi on” user name “***” password “***” with administrator privileges
end if
if interface is “OFF” then
tell application “Terminal”
do script “killall Terminal”
end tell
do shell script “networksetup -setwebproxystate Wi-Fi off” user name “***” password “***” with administrator privileges
do shell script “networksetup -setsecurewebproxystate Wi-Fi off” user name “***” password “***” with administrator privileges
end if

 

windows 使用clang.exe编译c程序

  1. 编译好clang.exe;

—– 使用mingw编译链—

  1. …\bin\clang.exe hello.c -o aaa.exe –target=x86_64-pc-windows-gnu -mllvm -protect

—– 使用vs2017编译链——

  1. 到vs2017的安装目录搜索一个叫做vcvarsall.bat的文件. 可能的路径是:vs2017\VC\Auxiliary\Build运行 vcvarsall.bat  x86_amd64
  2. 然后运行以下命令编译c

clang.exe *.c –target=i686-pc-windows-vs2017  -o hanoi.exe

adb devices no permissions

When adb devices replies : no permission, just run the following commands:


sudo chown root:`whoami` `which adb`

sudo chmod 4550 `which adb`

adb kill-server

adb devices

reference: http://stackoverflow.com/questions/14460656/android-debug-bridge-adb-device-no-permissions

ImportError: No module named _sqlite3

If you are under RHEL/centos 6, you can try this:

cp /usr/lib64/python2.6/lib-dynload/_sqlite3.so /usr/local/lib/python2.7/sqlite3/

link: http://stackoverflow.com/questions/11394013/problems-with-python-2-7-3-on-centos-with-sqlite3-module

Solarized Dark Color Scheme


[Solarized Dark]
text(bold)=839496
magenta(bold)=6c71c4
text=839496
white(bold)=fdf6e3
green=859900
red(bold)=cb4b16
green(bold)=586e75
black(bold)=073642
red=dc322f
blue=268bd2
black=002b36
blue(bold)=839496
yellow(bold)=657b83
cyan(bold)=93a1a1
yellow=b58900
magenta=dd3682
background=042028
white=eee8d5
cyan=2aa198
[Names]
count=1
name0=Solarized Dark