Ubuntu 16.04 l2tp ipsec

Submitted by lepton on Wed, 05/23/2018 - 08:38

sudo apt-get install strongswan xl2tpd ppp

/etc/ipsec.conf

conn L2TP-PSK

type=transport

authby=psk

keyexchange=ikev1

keyingtries=3

rekey=no

left=192.168.5.105 use local ip

right=%any

auto=add

/etc/ipsec.secrets

: PSK "12345678"

/etc/xl2tpd/xl2tpd.conf

[lns default] ; Our fallthrough LNS definition

ip range = 192.168.2.2-192.168.2.20 ; * Allocate from this IP range

local ip = 192.168.2.1 ; * Our local IP to use

Gatekeeper spctl

Submitted by lepton on Mon, 12/04/2017 - 09:28

Tags

可能因為 Backdoor.MAC.Eleanor 的出現,Apple 取消了System Preferences > Security & Privacy 中 Gatekeeper 允許執行任何來源應用程式,但是 Gatekeep 是可以用 terminal 來關閉,達到容許執行任何來源應用程式(也包括病毒),請小心使用。

打開 Terminal
輸入 sudo spctl --master-disable


回復 Gatekeeper 功能:
打開 Terminal
輸入 sudo spctl --master-enable

 

 To check whether Mail.app is allowed to run on the local system:
           spctl -a /Applications/Mail.app

     To allow Frobozz.app to run on the local system:
           spctl --add --label "My Stuff" /Applications/Frobozz.app

iOS应用内集成AppStore评分功能

Submitted by lepton on Tue, 11/07/2017 - 17:02

Tags

1...

/**

 * 可评分评论,无次数限制

 */

- (IBAction)appStoreComentBtnAction:(UIButton *)sender {

NSString  * nsStringToOpen = [NSString  stringWithFormat: @"itms-apps://itunes.apple.com/app/id%@?action=write-review",@"AppID"];//替换为对应的APPID

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:nsStringToOpen]];

Strongswan

Submitted by lepton on Thu, 09/14/2017 - 16:31

site_ip_url="kkk.com"
ipsec pki --gen --outform pem >ca.pem
ipsec pki --self  --in ca.pem  --dn "C=AU,O=Internet Widgits Pty Ltd,CN=My CA" --ca --outform pem >ca.cert.pem

ipsec pki --gen --outform pem> server.pem
ipsec pki --pub --in server.pem | ipsec pki --issue --cacert ca.cert.pem --cakey ca.pem --dn "C=AU,O=Internet Widgits Pty Ltd,CN=$site_ip_url" --san="$site_ip_url" --flag serverAuth --flag ikeIntermediate --outform pem >server.cert.pem

stunnel

Submitted by lepton on Tue, 01/03/2017 - 10:07

#生成密钥 stunnel.pem,生成过程需要填写地域、邮箱等信息

openssl req -new -x509 -days 365 -nodes -out stunnel.pem -keyout stunnel.pem

#Diffie-Hellman密钥创建