首页 文章 精选 留言 我的

精选列表

搜索[自动补全],共10012篇文章
优秀的个人博客,低调大师

Docker CE 全自动安装

操作系统 1 2 3 4 [root@localhost~] #cat/etc/redhat-release CentOSLinuxrelease7.3.1611(Core) [root@localhost~] #uname-r 3.10.0-514.el7.x86_64 安装代码如下所示: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 #!/bin/bash #2018-2-2615:34:05 #autoinstalldocker-ceonCentOS7 #byauthordengaosky ###################### #Uninstalloldversions yumremove-ydockerdocker-commondocker-selinuxdocker-engine #Installusingtherepository yum install -yyum-utilsdevice-mapper-persistent-datalvm2 ##yum-config-manager--add-repohttps://download.docker.com/linux/centos/docker-ce.repo yum-config-manager--add-repohttps: //mirrors .aliyun.com /docker-ce/linux/centos/docker-ce .repo #Disabletheedgeandtestrepositories yum-config-manager--disabledocker-ce-edge yum-config-manager--disabledocker-ce- test #INSTALLDOCKERCE yum install docker-ce-y #Configdocker cat > /etc/docker/daemon .json<<EOF { "registry-mirrors" :[ "http://df98fb04.m.daocloud.io" ]} EOF #DisableFirewalld,InstallandEnableiptables systemctldisablefirewalld;systemctlstopfirewalld yum install iptables-services-y systemctl enable iptables;systemctlrestartiptables #DisableSelinux setenforce0 sed -i '/SELINUX/s/enforcing/disabled/g' /etc/selinux/config #StartDocker systemctlstartdocker systemctl enable docker Docker版本信息: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 [root@localhost~] #dockerinfo Containers:0 Running:0 Paused:0 Stopped:0 Images:0 ServerVersion:17.12.0-ce StorageDriver:overlay2 BackingFilesystem:xfs Supportsd_type: true NativeOverlayDiff: false LoggingDriver:json- file CgroupDriver:cgroupfs Plugins: Volume: local Network:bridgehostmacvlannulloverlay Log:awslogsfluentdgcplogsgelfjournaldjson- file logentriessplunksyslog Swarm:inactive Runtimes:runc DefaultRuntime:runc InitBinary:docker-init containerdversion:89623f28b87a6004d4b785663257362d1658a729 runcversion:b2567b37d7b75eb4cf325b77297b140ea686ce8f initversion:949e6fa SecurityOptions: seccomp Profile:default KernelVersion:3.10.0-514.el7.x86_64 OperatingSystem:CentOSLinux7(Core) OSType:linux Architecture:x86_64 CPUs:2 TotalMemory:1.938GiB Name:localhost.localdomain ID:WMF3:D2KK:5ODB:LAS3:MJKI:QMLJ:H2H7:2BWN:6EMW:J7CS:2YIZ:Z4HW DockerRootDir: /var/lib/docker DebugMode(client): false DebugMode(server): false Registry:https: //index .docker.io /v1/ Labels: Experimental: false InsecureRegistries: 127.0.0.0 /8 LiveRestoreEnabled: false [root@localhost~] # 本文转自 dengaosky 51CTO博客,原文链接:http://blog.51cto.com/dengaosky/2073347,如需转载请自行联系原作者

优秀的个人博客,低调大师

让tabbar自动隐藏

在做iOS的开发过程中就会发现有一个比较头疼的问题,就是下面tabbar的隐藏与消失,特别是同一个控制器在不同的地方显示尤为尴尬。 一般在Push的时候都会写这样一句话. self.hidesBottomBarWhenPushed = NO; 有的时候各种Push就会发生tabbar出现异常。 最终我自己写了一个库,来应对这种事情的发生,然后使用起来就非常方便了。 直接Push就可以了,什么都不用写。 这是github的链接:https://github.com/YouZhiZheShiJingCheng/YZ_Push 首先要在Pch文件中导入YZ_Push.h 然后所有一级界面都继承oneVC,其他界面都继承twoVC即可。

优秀的个人博客,低调大师

自动升级OPENSSH shell脚本

由于管理着两百多台Linux服务器,一个人搞这么多机器的安全加固比较累,因此在学习了shell脚本之后果断的写了一些常用脚本做一些系统日常维护,本文OPENSSH的升级是博主本人几乎每两三个月就要做一次升级的,没办法绿盟安全扫描系统总是扫描到相关的高危漏洞,再就是OPENSSH版本更新的也比较频繁,因此不偷懒几乎没法活了。废话不说了,在这里贴下脚本,已经在线上服务器上执行了上百次了,应该不会有什么问题。 #!/bin/bash ################################################################# ######updateopensslopensshscirpt######### #####Author:kl##### ######Date:2014/07/13##### ######LastModified:2016/06/02####### ####Warning:starttelnetservicebeforeusethescript##### ################################################################# #################################################################################### # updateopensshandopenssl ######### ##### ## #################################################################################### #Determinewhetherthecurrentsysteminstalledgcccompilertools zlib_version="zlib-1.2.8" openssl_version="openssl-1.0.2g" openssh_version="openssh-7.2p2" gcc_path=`whichgcc` #gcc_name=`basename$gcc_path` DATE=$(date+%Y%m%d) #OSTYPE #Distributor_ID=$(lsb_release-i) Distributor=`lsb_release-i|cut-c17-` #Determinewhethertherootuser userid=`id-u` if["$userid"-ne0];then echo"sorry,onlyrootcanexecutethescript." exit fi #SETSELINUX=disabled if["$Distributor"!="SUSELINUX"];then sed-i'/SELINUX/s/enforcing/disabled/'/etc/selinux/config setenforce0 fi #pam-devel,tcp_wrappers-develneedbeinstalled,Otherwise,thesoftwarewillinstallfailure #Supportfortcpwrappers/libwraphasbeenremovedinopenssh6.7 if!rpm-qa|greppam-devel&>/dev/null;then echo"pam-develisnotinstalled"&&exit fi #if!rpm-qa|greptcp_wrappers-devel&>/dev/null;then # echo"tcp_wrappers-develnotinstalled"&&exit #fi #Checkwhethertoopenthetelnetservice netstat-tnlp|grep-w23 RETVAL3=$? if[$RETVAL3-eq0];then echo"telnetserviceisrunning------------[yes]" else echo"telnetserviceisnotrunning--------[no]" exit fi #Determinewhethertoinstallgccpackage if[-e"$gcc_path"];then echo"gccisinstalled----------------[yes]" else echo"gccisnotinstalled------------[no]" exit fi #stopsshdservice netstat-tnlp|grep-w22 RETVAL4=$? if[$RETVAL4-eq0];then servicesshdstop echo"stopsshdservice--------------[yes]" fi if[-e/etc/init.d/sshd];then cp/etc/init.d/sshd/root fi #removeopenssh*.rpmifexists ifrpm-qa|grepopenssh&>/dev/null; then rpm-qa|grepopenssh>openssh_list.txt whilereadline do rpm-e$line--nodeps echo"remove$linesuccess------------[yes]" done<openssh_list.txt fi ###########installzlib################## tar-zxvf"${zlib_version}.tar.gz">/dev/null cd$zlib_version ./configure RETVAL5=$? if[$RETVAL5-ne0];then echo"Configurezlibhasencounteredanerror" exit fi make RETVAL6=$? if[$RETVAL6-ne0];then echo"makezlibhasencounteredanerror" exit fi makeinstall cd.. echo"#########################################################" echo"#################################" echo"################zlibinstallsuccess#################" echo"#################################" echo"#########################################################" sleep2 ##########installopenssl############# tar-zxvf"${openssl_version}.tar.gz">/dev/null cd$openssl_version ./configsharedzlib RETVAL7=$? if[$RETVAL7-ne0];then echo"Configureopensslhasencounteredanerror" exit fi make RETVAL8=$? if[$RETVAL8-ne0];then echo"makeopensslhasencounteredanerror" exit fi makeinstall if[-e/usr/bin/openssl];then mv/usr/bin/openssl/usr/bin/openssl.OFF&&ln-s/usr/local/ssl/bin/openssl/usr/bin/openssl else ln-s/usr/local/ssl/bin/openssl/usr/bin/openssl fi if[-e/usr/include/openssl];then mv/usr/include/openssl/usr/include/openssl.OFF&&ln-s/usr/local/ssl/include/openssl/usr/include/openssl else ln-s/usr/local/ssl/include/openssl/usr/include/openssl fi ##Add"/usr/local/ssl/lib"to/etc/ld.so.conf ssl_lib=`grep-w"/usr/local/ssl/lib"/etc/ld.so.conf` if[!-e"$ssl_lib"];then echo"/usr/local/ssl/lib">>/etc/ld.so.conf fi ldconfig-v cd.. echo"#########################################################" echo"#################################" echo"################opensslinstallsucess################" echo"#################################" echo"#########################################################" sleep2 #############installopenssh############## if[-e/etc/ssh];then mv/etc/ssh/etc/ssh_$DATE fi tar-zxvf"${openssh_version}.tar.gz">/dev/null cd$openssh_version ./configure--prefix=/usr--sysconfdir=/etc/ssh--with-zlib--with-pam--with-ssl-dir=/usr/local/ssl--with-md5-passwords RETVAL9=$? if[$RETVAL9-ne0];then echo"Configureopensshhasencounteredanerror" exit fi make RETVAL10=$? if[$RETVAL10-ne0-a$RETVAL10-ne0];then echo"makeopensshhasencounteredanerror" exit fi makeinstall if["$Distributor"=="SUSELINUX"];then cdcontrib/suse cprc.sshd/etc/init.d/sshd chmod+x/etc/init.d/sshd chkconfig--addsshd else cdcontrib/redhat cpsshd.init/etc/init.d/sshd chmod+x/etc/init.d/sshd chkconfig--addsshd fi #AgenericPAMconfigurationisincludedas"contrib/sshd.pam.generic", #youmayneedtoedititbeforeusingitonyoursystem. cd.. cpsshd.pam.generic/etc/pam.d/sshd sed-i's/\/lib\/security\///g'/etc/pam.d/sshd #Modify/etc/ssh/sshd_config #Backup/etc/ssh/sshd_config cp-p/etc/ssh/sshd_config/etc/ssh/sshd_config_bak #ThedefaultsetofciphersandMACshasbeenalteredto #removeunsafealgorithms.Inparticular,CBCciphersandarcfour* #aredisabledbydefault. #ChangessinceOpenSSH6.6 echo"KexAlgorithmsdiffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org">>/etc/ssh/sshd_config echo"Ciphersaes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc">>/etc/ssh/sshd_config echo"MACshmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96">>/etc/ssh/sshd_config #Disablerootaccessviasshtoserver #*Thedefaultforthesshd_config(5)PermitRootLoginoptionhaschangedfrom"yes"to"prohibit-password". #*PermitRootLogin=without-password/prohibit-passwordnowbansall #interactiveauthenticationmethods,allowingonlypublic-key, #hostbasedandGSSAPIauthentication(previouslyitpermitted #keyboard-interactiveandpassword-lessauthenticationifthose #wereenabled). #PermitRootLoginprohibit-passwordisthedefaultsinceversion7.0p1 sed-i's/^#PermitRootLogin/PermitRootLogin/'/etc/ssh/sshd_config #sed-i'/PermitRootLogin/s/yes/no/'/etc/ssh/sshd_config sed-i'/PermitRootLogin/s/prohibit-password/no/'/etc/ssh/sshd_config #Set'UsePAMno'to'UsePAMyes'toenablePAMauthentication,accountprocessing, #andsessionprocessing sed-i'/^#UsePAMno/aUsePAMyes'/etc/ssh/sshd_config #Startsshdprocess servicesshdstart #Disabletelnetservice ifnetstat-tnlp|grep-w22&>/dev/null;then sed-i'/disable/s/no/yes/'/etc/xinetd.d/telnet servicexinetdrestart fi echo"#########################################################" echo"#################################" echo"################opensshinstallsucess################" echo"#################################" echo"#########################################################" echo"###############sshversion#################################################" echo"###################################################################################" sshd-v echo"####################################################################################" echo"####################################################################################"

资源下载

更多资源
Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册