Обновите расширение так, чтобы оно было таким:
extension UIView {
func roundCorners(corners:UIRectCorner, radius: CGFloat) {
let path = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
let mask = CAShapeLayer()
let rect = self.bounds
mask.frame = rect
mask.path = path.cgPath
self.layer.mask = mask
}
}
Слой формы (маска) должен знать фрейм
Здесь есть хорошо описанное решение сценария Perl . Прочтите также комментарии к публикации.
Подробнее читайте на SSH Agent Forwarding (упоминается в комментариях к сообщениям сценария perl).
The first solution that leaps to mind is to tunnel one local port to each of your servers. Since SSH uses port 22, we'll use each SSH connection to tunnel a local port to the next server's port 22.
When you open PuTTY, you're met with the PuTTY Configuration dialog. The two categories you'll need to edit are "Session" and "Connection→SSH→Tunnels".
Open a copy of PuTTY. Use these settings:
Connect to host
server1
Tunnel a port
15500
Destination: server2:22
(the secure shell port)
Now, every time you connect to port 15500 on your local machine, your connection is being tunneled to port 22 on server2.
Open a copy of PuTTY. Use these settings:
localhost
15501
server3:22
(the secure shell port)Open a copy of PuTTY. Use these settings:
localhost
15502
server3:22
(the secure shell port)Use WinSCP to connect to localhost
on port 15502
. Your connection will be tunneled as if you're connecting to server3
directly.
Let me know in the comments whether this works for you. Good luck!
В OpenSSH я использую эту настройку, когда мне нужны туннели. Это позволяет мне напрямую набирать sftp server3
, не беспокоясь о ручном запуске туннелей server2
и server1
.
# ~/.ssh/config # to connect to server2, tunnel through server1 Host server2 ProxyCommand ssh server1 nc %h %p # to connect to server3, tunnel through server2 Host server3 ProxyCommand ssh server2 nc %h %p
Чтобы быть более полным, я обычно обычно используйте ssh -oCiphers = arcfour128, arcfour256, arcfour, blowfish-cbc -oControlMaster = no -oForwardX11 = no -oForwardAgent = no -oPermitLocalCommand = no -oClearAllForwardings = yes server1 1193% h% p как [the server1 1193% h% p ] ProxyCommand
.
aes
/ 3des
для внешнего уровня; arcfour
и blowfish
работают быстрее. -o ****
вне паранойи,user @ % proxyhost nc% host% port и установите имя хоста / порт / пользователь / пароль прокси-сервера в панели настройки соединения / прокси соответственно. plink
и остальная часть пакета PuTTY ( pscp
, psftp
и т. Д.) Загружают все, что сохранено в графической конфигурации PuTTY; надеюсь, WinSCP тоже. (Я им не пользуюсь, поэтому плохо знаком с его функциями.)