shutdown

Running a Shell Script on Shutdown via launchd

你离开我真会死。 提交于 2019-12-06 11:49:54
Since startup items and rc commands are both deprecated (and in many cases not working at all) on OS X in favour of launchd , I'd like to find out what the correct way would be to setup a shell script that runs on logout/shutdown. For a startup item it was possible to create a shell script that looked something like: #!/bin/sh StartService() { echo "Started." } StopService() { echo "Stopped." } RunService "$1" But the RunService command isn't supported when running a script from launchd , and I'm not sure it's meant to be used anymore anyway. If possible, I'd like to create a shell script that

PowerShell window preventing shutdown

左心房为你撑大大i 提交于 2019-12-06 11:16:01
If I have a PowerShell window (at the PowerShell command prompt) on display it prevents the computer shutting down. I.e. if I open a PowerShell window and then try to shutdown the server, I get the End Program popup saying Windows cannot end this program. I get the same result if I start PowerShell from the start menu, from a cmd prompt and from a shortcut with -NoExit specified. How can I get shutdown to automatically close a PowerShell window (if it is at the PowerShell prompt) in the same way as it would for a CMD window? Alternatively, is it possible for PowerShell to detect when a

acl的基础知识以及工作原理配置

吃可爱长大的小学妹 提交于 2019-12-06 10:07:02
实验名称:acl基础配置 -作用: 匹配感兴趣的流量。 实验拓扑: 实验要求:pc1能ping通所有网络,其余网络都不同 实验目的:熟悉acl的应用 实验步骤: 第一:先使所有网络都能相互ping通 sw1 <Huawei>undo terminal monitor Info: Current terminal monitor is off. <Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]vlan batch 10 20 50 Info: This operation may take a few seconds. Please wait for a moment...done. [Huawei]inter Ethernet0/0/1 [Huawei-Ethernet0/0/1]undo shutdown [Huawei-Ethernet0/0/1]port link-type access [Huawei-Ethernet0/0/1]port default vlan 10 [Huawei-Ethernet0/0/1]inter eth0/0/2 [Huawei-Ethernet0/0/2]undo shutdown Info: Interface Ethernet0/0/2 is not

华为——ACL的运用

一笑奈何 提交于 2019-12-06 10:04:44
今天主要说一下关于ACL的知识,初次接触,如有不足,请各位大神提出宝贵意见,谢谢。 **ACL:Access Control List 访问控制列表 -定义:是用来实现流量识别功能的。 -作用:网络设备为了对特定的报文进行操作,需要配置一系列的匹配规则,以识别 出特定的报文,然后根据预先设定的策略对该报文进行操作。(可以简单的 理解为匹配感兴趣的流量) -实现: 1.制定规则 2.规定动作(允许/拒绝) 事件(例如:在某个端口下实施acl的配置内容) -类型: --标准ACL/基本ACL --扩展ACL/高级ACL 配置思路: 1.确保现有网络的连通性 2.查看现有的ACL 3.创建ACL 4.调用ACL 5.验证、测试、保存 下面为大家带来一个小小的拓扑实际性的操作一下 实验目的:PC1与PC3不通,但PC1和PC3都和PC2、PC4互通 实验拓扑: 地址规划: 设备 IP地址及子网 网关 PC1 192.168.10.1/24 192.168.10.254 PC2 192.168.20.2/24 192.168.20.254 PC3 192.168.30.3/24 192.168.30.254 PC4 192.168.40.4/24 192.168.40.254 实验步骤: 1.配置设备IP地址 2.配置网关 R1: <Huawei>system\ 进入系统视图 Enter

15. 扩展IP访问控制列表配置

雨燕双飞 提交于 2019-12-06 09:58:58
转载于: http://7c0bab95.wiz03.com/share/s/1Y2WKl218k5e2gpBCl2BeEsq2JBmkw26o4Uq2o65c805P767 扩展IP访问控制列表配置 实验目标 理解标准IP访问控制列表的原理及功能; 掌握编号的标准IP访问控制列表的配置方法; 实验背景 你是公司的网络管理员,公司的经理部、财务部们和销售部门分属于不同的3个网段,三部门之间用路由器进行信息传递,为了安全起见,公司领导要求销售部门不能对财务部进行访问,但经理部可以对财务部进行访问。 PC1代表经理部的主机、PC2代表销售部的主机、PC3代表财务部的主机。 技术原理 访问列表中定义的典型规则主要有以下:源地址、目标地址、上层协议、时间区域; 扩展IP访问列表(编号100-199、2000、2699)使用以上四种组合来进行转发或阻断分组;可以根据数据包的源IP、目的IP、源端口、目的端口、协议来定义规则,进行数据包的过滤。 扩展IP访问列表的配置包括以下两部: 定义扩展IP访问列表 将扩展IP访问列表应用于特定接口上 实验步骤 新建Packet Tracer拓扑图 (1)分公司出口路由器与外路由器之间通过V.35电缆串口连接,DCE端连接在R2上,配置其时钟频率64000;主机与路由器通过交叉线连接。 (2)配置PC机、服务器及路由器接口IP地址。 (3

How to “unbind” a socket programmatically?

那年仲夏 提交于 2019-12-06 09:32:13
问题 1) The socket doesn't seem to unbind from the LocalEndPoint until the process ends. 2) I have tried the solutions from the other question, and also tried waiting a minute - to no avail. 3) At the moment I have tried the below to get rid of the socket and its connections: public static void killUser(User victim) { LingerOption lo = new LingerOption(false, 0); victim.connectedSocket.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.Linger, lo); victim.connectedSocket.Shutdown

华为设备基本ACL和高级ACL综合配置

三世轮回 提交于 2019-12-06 09:17:22
实验需求: 0、做之前确保全网互通 1、-交换机用路由器代替,WG主机用路由器模拟 2、-AR1只能允许WG登陆 3、-YF和CW之间不能互通,但可以和WG互通 4、-WG和YF可以访问Client1 5、-CW不能访问Client1 6、-YF和WG只能访问Server1的WWW服务 7、-只有WG才能访问Server1的所有服务 实验拓扑: 实验配置: --------------------------------------------------------------------------------- [WG]int g0/0/0 [WG-GigabitEthernet0/0/0]ip add 192.168.10.1 24 [WG-GigabitEthernet0/0/0]un shutdown [WG]rip [WG-rip-1]version 2 [WG-rip-1]network 192.168.10.0 ---------------------------- [AR2]int g0/0/1 [AR2-GigabitEthernet0/0/1]ip add 192.168.10.2 24 [AR2-GigabitEthernet0/0/1]un shutdown [AR2]int g0/0/0 [AR2-GigabitEthernet0/0/0]ip

命名ACL的基本用法

旧巷老猫 提交于 2019-12-06 09:13:49
实例三:命名标准ACL的基本用法 1.在R1上配置1条静态路由到192.168.100.0/24网络,1条静态路由到192.168.200.0/24网络。 2.在R2上配置1条静态路由到200.200.200.0/24网络。 3.在R2上创建名permit-net100的标准ACL访问控制列表,规则设为:允许192.168.100.0/24网络访问,禁止192.168.200.0/24网络访问,并应用在R2的F0/0的出口方向上。 代码如下: en conf t hostname R1 interface f0/0 ip address 200.200.200.254 255.255.255.0 no shutdown exit interface f0/1 ip address 192.168.12.1 255.255.255.0 no shutdown exit ip route 192.168.100.0 255.255.255.0 f0/1 ip route 192.168.200.0 255.255.255.0 f0/1 end en conf t hostname R2 interface f0/0 ip address 192.168.12.2 255.255.255.0 no shutdown exit interface f0/1 ip address 192

标准ACL的基本用法

狂风中的少年 提交于 2019-12-06 09:13:40
实例一:标准ACL的基本用法 1.限制PC1访问服务器 2.访问控制列表应用在R2的S0/2/0的in方向 代码如下: R1配置 en conf t hostname R1 int f0/0 ip address 192.168.1.254 255.255.255.0 no shutdown exit int f0/1 ip address 192.168.2.254 255.255.255.0 no shutdown exit int s0/2/0 ip address 192.168.3.254 255.255.255.0 no shutdown clock rate 64000 exit router rip version 2 network 192.168.1.0 network 192.168.2.0 network 192.168.3.0 exit end R2配置 en conf t hostname R2 int s0/2/0 ip address 192.168.3.253 255.255.255.0 ip access-group 101 in no shutdown exit int f0/0 ip address 192.168.4.254 255.255.255.0 no shutdown exit access-list 1 deny 192.168

Linux常用命令总结

旧时模样 提交于 2019-12-06 08:44:34
自己简单总结的,希望对大家有帮助吧! 关机/重启 关机   poweroff //立即关机   shutdown -h now   //立刻关机   shutdown -h 时间 //到某个时刻自动关机   halt //立刻关机   init 0 //关闭系统   shutdown -c //取消定时关机   logout //注销   //简单说一下三个立刻关机的区别:poweroff是掉电关机,但实际上也是先关闭程序再关机,halt等同于shutodwn -h now是停掉系统而已,并没有掉电,主板是通电的 重启   shutdown -r now //立即重启 注意:关机和重启操作都是需要root权限的 系统信息 uname -r //查看系统内核版本 cat /proc/version //显示内核版本的详细信息 arch //查看系统处理器是32/64位 uname -m //等同于arch cat /proc/cpuinfo //查看cpu详细信息 date //显示系统时间 date +"时间显示格式" //按规定格式显示时间 clock -w //将系统时间写入硬件 cal 年 //查看某一年的日历 hostname //查看计算机名,后面可以加名称临时更改系统名称 cat /etc/redhat-release //查看系统版本 head /etc/issue