gentoo l2tp ipsec client

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

Tags

###connect to unbutu strongswan xl2tpd

emerge libreswan xl2tpd

/etc/ipsec.d/xxx.conf

conn xxx
    authby=secret
    pfs=no
    rekey=no
    keyingtries=3
    type=transport
    left=%defaultroute
    leftprotoport=udp/l2tp
    leftid=@vpn.l2tp
    right=8.8.9.9 # internet ip
    rightid=10.0.1.2 #
    rightprotoport=udp/l2tp
    auto=add

 

/etc/ipsec.d/xxx.secrets

@vpn.l2tp %any : PSK "******"

 

/etc/xl2tpd/xl2tpd.conf

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