首页 文章 精选 留言 我的

精选列表

搜索[AI生成],共10000篇文章
优秀的个人博客,低调大师

推荐 10 个 NB 的 IDEA 插件,代码能自动生成的绝不手写

本文收录在 GitHub 地址 https://github.com/chengxy-nds/Springboot-Notebook 友情提示:插件虽好,可不要贪装哦,装多了会 卡 、卡 、卡 ~ 正经干活用的 分享一点自己工作中得心应手的IDEA插件,可不是在插件商店随随便便搜的,都经过实战检验,用过的都说好。可能有一些大家用过的就快速划过就行了。 1、GenerateAllSetter 实际的开发中,可能会经常为某个对象中多个属性进行 set 赋值,尽管可以用BeanUtil.copyProperties()方式批量赋值,但这种方式有一些弊端,存在属性值覆盖的问题,所以不少场景还是需要手动 set。如果一个对象属性太多 set 起来也很痛苦,GenerateAllSetter可以一键将对象属性都 set 出来。 快捷键:Alt+Enter 2、Alibaba Java Coding Guidelines 阿里出品的《Java 开发手册》时下已经成为了很多公司新员工入职必读的手册,前一段阿里发布了《Java 开发手册(泰山版)》, 又一次对Java开发规范做了完善。不过,又臭又长的手册背下来是不可能的,但集成到IDEA开发工具中就方便很多。 举个栗子:开发手册上不允许用Executors去创建线程池,而是通过ThreadPoolExecutor的方式。 集成插件后会再去使用Executors去创建线程池会有如下的提示。 3、GsonFormat GsonFormat 个人觉得是一个非常非常实用的插件,它可以将JSON字符串自动转换成Java实体类。特别是在和其他系统对接时,往往以JSON格式传输数据,而我们需要用Java实体接收数据入库或者包装转发,如果字段太多一个一个编写那就太麻烦了。 快捷键:Alt+ S 4、Maven Helper Maven Helper 是解决Maven依赖冲突的利器,可以快速查找项目中的依赖冲突。安装后打开pom文件,底部有 Dependency Analyzer 视图。显示红色表示存在依赖冲突,点进去直接在包上右键Exclude排除,pom文件中会做出相应排除包的操作。 Conflicts(冲突) All Dependencies as List(列表形式查看所有依赖) All Dependencies as Tree(树结构查看所有依赖),并且这个页面还支持搜索。 5、Codota 用了Codota 后不再怕对API不会用,举个栗子:当我们用stream().filter()对List操作,可是对filter()用法不熟,按常理我们会百度一下,而用Codota 会提示很多filter()用法,节省不少查阅资料的时间。 6、Free MyBatis Plugin 在使用MyBatis 作为持久框架时有一个尴尬的问题:SQL xml文件和定义的Java接口无法相互跳转,不能像Java接口间调用那样,只能全局搜索稍显麻烦。Free MyBatis Plugin将两者之间进行关联。 7、IntelliJad IntelliJad是一个Java class文件的反编译工具,需要在 setting 中设置本地Java jad.exe工具的地址。 随便找个Jar架包选择class文件右键Decompile,会出现反编译的结果。 8、Properties to YAML Converter 将Properties 配置文件一键转换成YAML 文件,很实用的一个插件。注意:要提前备份原Properties 文件 9、Lombok Lombok 插件应该比较熟,它替我们解决了那些繁琐又重复的代码,比如Setter、Getter、toString、equals等方法。 10、CodeGlance CodeGlance 是一款代码编辑区迷你缩放图插件,可以很方便的知道我们方法大致在什么位置。 IDEA还有不少的开发小技巧,有助于我们少些代码,不知道大家有没有发现?变量后.可以联想提示,而在联想列表的最后边有很多简洁的命令。 例如: list.sout = System.out.println(list); list.var = List<User> list1 = list list.nn = list.if (list != null) ...... 装X用的 下边这些就属于装X神器了,可以根据个人的喜好来耍一下。 1、Material Theme UI 使用插件后界面图标样式都会变的很漂亮。 2、activate-power-mode 这个震动的效果看似很是酷炫,可写了十分钟代码我就快被它晃悠吐了。 3、Nyan progress bar 会让IDEA所有进度条都变得萌萌的,但我并不建议你安装因为会很卡,不知道是不是只有我这样。 4、Rainbow Brackets 彩虹颜色的括号,看着很舒服,有点赏心悦目的感觉。 整理了几百本各类技术电子书,送给小伙伴们。关注公号回复【666】自行领取。和一些小伙伴们建了一个技术交流群,一起探讨技术、分享技术资料,旨在共同学习进步,如果感兴趣就加入我们吧! 无论你是刚入行、还是已经有几年经验的程序员,相信这份面试提纲都会给你不少助力,长按二维码关注 『 程序员内点事 』 ,回复 『 offer 』 自行领取,祝大家 offer 拿到手软

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

通过shell检查mysql主机和数据库,生成html报表的脚本

该脚本主要用于大致诊断MYSQL主机和数据库配置及性能收集,脚本部分功能展示如下: 实现该上述展示功能的shell脚本如下: file_output='os_mysql_summary.html' td_str='' th_str='' myuser="root" mypasswd="password" myip="192.168.11.101" myport="3307" mysql_cmd="mysql-u${myuser}-p${mypasswd}-h${myip}-P${myport}--protocol=tcp--silent" create_html_css(){ echo-e"<html> <head> <styletype="text/css"> body{font:12pxCourierNew,Helvetica,sansserif;color:black;background:White;} table,tr,td{font:12pxCourierNew,Helvetica,sansserif;color:Black;background:#FFFFCC;padding:0px0px0px0px;margin:0px0px0px0px;} th{font:bold12pxCourierNew,Helvetica,sansserif;color:White;background:#0033FF;padding:0px0px0px0px;} h1{font:bold12ptCourierNew,Helvetica,sansserif;color:Black;padding:0px0px0px0px;} </style> </head> <body>" } create_html_head(){ echo-e"<h1>$1</h1>" } create_table_head1(){ echo-e"<tablewidth="68%"border="1"bordercolor="#000000"cellspacing="0px"style="border-collapse:collapse">" } create_table_head2(){ echo-e"<tablewidth="100%"border="1"bordercolor="#000000"cellspacing="0px"style="border-collapse:collapse">" } create_td(){ td_str=`echo$1|awk'BEGIN{FS="|"}''{i=1;while(i<=NF){print"<td>"$i"</td>";i++}}'` } create_th(){ th_str=`echo$1|awk'BEGIN{FS="|"}''{i=1;while(i<=NF){print"<th>"$i"</th>";i++}}'` } create_tr1(){ create_td"$1" echo-e"<tr> $td_str </tr>">>$file_output } create_tr2(){ create_th"$1" echo-e"<tr> $th_str </tr>">>$file_output } create_tr3(){ echo-e"<tr><td> <prestyle=\"font-family:CourierNew;word-wrap:break-word;white-space:pre-wrap;white-space:-moz-pre-wrap\"> `cat$1` </pre></td></tr>">>$file_output } create_table_end(){ echo-e"</table>" } create_html_end(){ echo-e"</body></html>" } NAME_VAL_LEN=12 name_val(){ printf"%+*s|%s\n""${NAME_VAL_LEN}""$1""$2" } get_virtual(){ localfile="/var/log/dmesg" ifgrep-qi-e"vmware"-e"vmxnet"-e'paravirtualizedkernelonvmi'"${file}";then echo"VMWare"; elifgrep-qi-e'paravirtualizedkernelonxen'-e'Xenvirtualconsole'"${file}";then echo"Xen"; elifgrep-qi"qemu""${file}";then echo"QEmu"; elifgrep-qi'paravirtualizedkernelonKVM'"${file}";then echo"KVM"; elifgrep-q"VBOX""${file}";then echo"VirtualBox"; elifgrep-qi'hd.:Virtual..,ATA.*drive'"${file}";then echo"MicrosoftVirtualPC"; else echo"PhysicalMachine" fi } get_physics(){ name_val"Date""`date-u+'%F%TUTC'`(localTZ:`date+'%Z%z'`)" name_val"Hostname""`uname-n`" name_val"Uptime""`uptime`" name_val"System""`dmidecode-s"system-manufacturer""system-product-name""system-version""chassis-type"`" name_val"Service_num""`dmidecode-s"system-serial-number"`" name_val"Platform""`uname-s`" name_val"Release""`cat/etc/{oracle,redhat,SuSE,centos}-release2>/dev/null|sort-ru|head-n1`" name_val"Kernel""`uname-r`" name_val"Architecture""CPU=`lscpu|grepArchitecture|awk-F:'{print$2}'|sed's/^[[:space:]]*//g'`;OS=`getconfLONG_BIT`-bit" name_val"Threading""`getconfGNU_LIBPTHREAD_VERSION`" name_val"SELinux""`getenforce`" name_val"Virtualized""`get_virtual`" } get_cpuinfo(){ file="/proc/cpuinfo" virtual=`grep-c^processor"${file}"` physical=`grep'physicalid'"${file}"|sort-u|wc-l` cores=`grep'cpucores'"${file}"|head-n1|cut-d:-f2` model=`grep"modelname""${file}"|sort-u|awk-F:'{print$2}'` speed=`grep-i"cpuMHz""${file}"|sort-u|awk-F:'{print$2}'` cache=`grep-i"cachesize""${file}"|sort-u|awk-F:'{print$2}'` SysCPUIdle=`vmstat|sed-n'$p'|awk'{print$15}'` ["${physical}"="0"]&&physical="${virtual}" [-z"${cores}"]&&cores=0 cores=$((${cores}*${physical})); htt="" if[${cores}-gt0-a$cores-lt$virtual];thenhtt=yes;elsehtt=no;fi name_val"Processors""physical=${physical},cores=${cores},virtual=${virtual},hyperthreading=${htt}" name_val"Models""${physical}*${model}" name_val"Speeds""${virtual}*${speed}" name_val"Caches""${virtual}*${cache}" name_val"CPUIdle(%)""${SysCPUIdle}%" } get_meminfo(){ echo"Locator|Size|Speed|FormFactor|Type|TypeDetail">>/tmp/tmpmem3_h1_`date+%y%m%d`.txt dmidecode|grep-v"MemoryDeviceMappedAddress"|grep-A12-w"MemoryDevice"\ |egrep"Locator:|Size:|Speed:|FormFactor:|Type:|TypeDetail:"\ |awk-F:'/Size|Type|Form.Factor|Type.Detail|^[\t]+Locator/{printf("|%s",$2)}/^[\t]+Speed/{print"|"$2}'\ |grep-v"NoModuleInstalled"\ |awk-F"|"'{print$4,"|",$2,"|",$7,"|",$3,"|",$5,"|",$6}'>>/tmp/tmpmem3_t1_`date+%y%m%d`.txt free-glht>>/tmp/tmpmem2_`date+%y%m%d`.txt memtotal=`vmstat-s|head-1|awk'{print$1}'` avm=`vmstat-s|sed-n'3p'|awk'{print$1}'` name_val"Mem_used_rate(%)""`echo"100*${avm}/${memtotal}"|bc`%">>/tmp/tmpmem1_`date+%y%m%d`.txt } get_diskinfo(){ echo"Filesystem|Type|Size|Used|Avail|Use%|Mountedon|Opts">>/tmp/tmpdisk_h1_`date+%y%m%d`.txt df-ThP|grep-vtmpfs|sed'1d'|sort>/tmp/tmpdf1_`date+%y%m%d`.txt mount-l|awk'{print$1,$6}'|grep^/|sort>/tmp/tmpdf2_`date+%y%m%d`.txt join/tmp/tmpdf1_`date+%y%m%d`.txt/tmp/tmpdf2_`date+%y%m%d`.txt\ |awk'{print$1,"|",$2,"|",$3,"|",$4,"|",$5,"|",$6,"|",$7,"|",$8}'>>/tmp/tmpdisk_t1_`date+%y%m%d`.txt lsblk>>/tmp/tmpdisk1_`date+%y%m%d`.txt fordiskin`ls-l/sys/block|awk'{print$9}'|sed'/^$/d'|grep-vfd` do echo"${disk}"`cat/sys/block/${disk}/queue/scheduler`>>/tmp/tmpdisk2_`date+%y%m%d`.txt done pvs>>/tmp/tmpdisk3_`date+%y%m%d`.txt echo"================================================================">>/tmp/tmpdisk3_`date+%y%m%d`.txt vgs>>/tmp/tmpdisk3_`date+%y%m%d`.txt echo"================================================================">>/tmp/tmpdisk3_`date+%y%m%d`.txt lvs>>/tmp/tmpdisk3_`date+%y%m%d`.txt } get_netinfo(){ echo"interface|status|ipadds|mtu|Speed|Duplex">>/tmp/tmpnet_h1_`date+%y%m%d`.txt foripstrin`ifconfig-a|grep":flags"|awk'{print$1}'|sed's/.$//'` do ipadds=`ifconfig${ipstr}|grep-winet|awk'{print$2}'` mtu=`ifconfig${ipstr}|grepmtu|awk'{print$NF}'` speed=`ethtool${ipstr}|grepSpeed|awk-F:'{print$2}'` duplex=`ethtool${ipstr}|grepDuplex|awk-F:'{print$2}'` echo"${ipstr}""up""${ipadds}""${mtu}""${speed}""${duplex}"\ |awk'{print$1,"|",$2,"|",$3,"|",$4,"|",$5,"|",$6}'>>/tmp/tmpnet1_`date+%y%m%d`.txt done } get_topproc(){ #osload echo"osload1">>/tmp/tmpload_`date+%y%m%d`.txt sar-q15>>/tmp/tmpload_`date+%y%m%d`.txt echo"osload2">>/tmp/tmpload_`date+%y%m%d`.txt sar-b15>>/tmp/tmpload_`date+%y%m%d`.txt echo"osload3">>/tmp/tmpload_`date+%y%m%d`.txt vmstat15>>/tmp/tmpload_`date+%y%m%d`.txt #topcpu mpstat15>>/tmp/tmptopcpu_`date+%y%m%d`.txt echo"TOP10CPUResourceProcess">>/tmp/tmptopcpu_`date+%y%m%d`.txt psaux|head-1>>/tmp/tmptopcpu_`date+%y%m%d`.txt psaux|grep-vPID|sort-rn-k+3|head>>/tmp/tmptopcpu_`date+%y%m%d`.txt #top-bn1-o"%CPU"|sed-n'/PID/,17p' #topmem echo"TOP10MEMResourceProcess">>/tmp/tmptopmem_`date+%y%m%d`.txt psaux|head-1>>/tmp/tmptopmem_`date+%y%m%d`.txt psaux|grep-vPID|sort-rn-k+4|head>>/tmp/tmptopmem_`date+%y%m%d`.txt #top-bn1-o"%MEM"|sed-n'/PID/,17p' #topi/o iostat-cdmx23>>/tmp/tmptopio_`date+%y%m%d`.txt #iotop-botq-n3-d2 } my_base_info(){ ${mysql_cmd}-e"selectnow(),current_user(),version()\G" ${mysql_cmd}-e"showglobalvariableslike'autocommit';"|grep-i^auto|awk'{print$1,":",$2}' ${mysql_cmd}-e"showglobalvariables"|egrep-w"port|character_set_server|datadir|log_error|log_bin_basename|tx_isolation|binlog_format"|awk'{print$1,":",$2}' } my_stat_info(){ ${mysql_cmd}-estatus>>/tmp/tmpmy_stat_`date+%y%m%d`.txt } my_connip_info(){ echo"ipadds|conn_status|count">>/tmp/tmpmy_connip_h1_`date+%y%m%d`.txt netstat-an|grep${myport}|grep-viLISTEN|awk'{print$5,$6}'|sed's/::ffff://g'|sed's/:[0-9]*//g'|sed'1d'|sort|uniq-c|awk'{print$2,"|",$3,"|",$1}'>>/tmp/tmpmy_connip_t1_`date+%y%m%d`.txt } my_param_info(){ echo"Variable_name|Value">>/tmp/tmpmy_param_h1_`date+%y%m%d`.txt ${mysql_cmd}-e"showglobalvariables"|egrep-w"innodb_buffer_pool_size|innodb_file_per_table|innodb_flush_log_at_trx_commit|innodb_io_capacity|\ innodb_lock_wait_timeout|innodb_data_home_dir|innodb_log_file_size|innodb_log_files_in_group|log_slave_updates|long_query_time|lower_case_table_names|\ max_connections|max_connect_errors|max_user_connections|query_cache_size|query_cache_type|server_id|slow_query_log|slow_query_log_file|innodb_temp_data_file_path|\ sql_mode|gtid_mode|enforce_gtid_consistency|expire_logs_days|sync_binlog|open_files_limit|myisam_sort_buffer_size|myisam_max_sort_file_size"\ |awk'{print$1,"|",$2}'>>/tmp/tmpmy_param_t1_`date+%y%m%d`.txt } my_segm1_info(){ ${mysql_cmd}-H-e"selectTABLE_SCHEMA,concat(truncate(sum(data_length)/1024/1024/1024,2),'GB')asdata_size,\ concat(truncate(sum(index_length)/1024/1024/1024,2),'GB')asindex_size\ frominformation_schema.tablesgroupbyTABLE_SCHEMAorderbydata_lengthdesc;" } my_segm2_info(){ ${mysql_cmd}-H-e"selecttable_schema,table_name,table_rows,concat(truncate(data_length/1024/1024/1024,2),'GB')asdata_size,\ concat(truncate(index_length/1024/1024/1024,2),'GB')asindex_sizefrominformation_schema.tablesorderbydata_lengthdesclimit10;" } my_segm3_info(){ ${mysql_cmd}-H-e"selecttable_name,table_rows,concat(round(data_length/1024/1024,2),'MB')assize,data_free\ frominformation_schema.tableswheredata_free>0orderbydata_lengthdesc;" } my_obj1_info(){ ${mysql_cmd}-H-e"selecttable_schemaasdb,table_typeasobject_type,count(*)ascntfrominformation_schema.tablesgroupbytable_schema,table_typeunionall\ selectroutine_schemaasdb,routine_typeasobject_type,count(*)ascntfrominformation_schema.routinesgroupbyroutine_schema,routine_type;" } my_obj2_info(){ ${mysql_cmd}-H-e"selecttable_schema,engine,count(*)ascntfrominformation_schema.tablesgroupbytable_schema,engine;" } my_obj3_info(){ ${mysql_cmd}-H-e"selecttable_schema,table_namefrominformation_schema.tableswheretable_schemanotin('mysql','information_schema','performance_schema','sys')andtable_namenotin(\ selecttable_namefrominformation_schema.table_constraintstjoininformation_schema.key_column_usagekusing(\ constraint_name,table_schema,table_name)wheret.constraint_type='PRIMARYKEY'andtable_schemanotin('mysql','information_schema','performance_schema','sys'));" } my_lock_info(){ ${mysql_cmd}-H-e"SELECTr.trx_idwaiting_trx_id,r.trx_mysql_thread_idwaiting_thread,r.trx_querywaiting_query,\ b.trx_idblocking_trx_id,b.trx_mysql_thread_idblocking_thread,b.trx_queryblocking_query,\ bl.lock_idblocking_lock_id,bl.lock_modeblocking_lock_mode,bl.lock_typeblocking_lock_type,\ bl.lock_tableblocking_lock_table,bl.lock_indexblocking_lock_index,\ rl.lock_idwaiting_lock_id,rl.lock_modewaiting_lock_mode,rl.lock_typewaiting_lock_type,\ rl.lock_tablewaiting_lock_table,rl.lock_indexwaiting_lock_index\ FROMinformation_schema.INNODB_LOCK_WAITSw\ INNERJOINinformation_schema.INNODB_TRXbONb.trx_id=w.blocking_trx_id\ INNERJOINinformation_schema.INNODB_TRXrONr.trx_id=w.requesting_trx_id\ INNERJOINinformation_schema.INNODB_LOCKSblONbl.lock_id=w.blocking_lock_id\ INNERJOINinformation_schema.INNODB_LOCKSrlONrl.lock_id=w.requested_lock_id\G" } my_innodb_info(){ ${mysql_cmd}-e"showengineinnodbstatus\G" } my_user_info(){ ${mysql_cmd}-e"SELECTDISTINCTCONCAT('showgrantsfor''',user,'''@''',host,''';')ASqueryFROMmysql.user;">>/tmp/tmpmy_user_t_`date+%y%m%d`.txt whilereadline do echo"=================================================================">>/tmp/tmpmy_user_`date+%y%m%d`.txt echo"$line">>/tmp/tmpmy_user_`date+%y%m%d`.txt ${mysql_cmd}-e"$line">>/tmp/tmpmy_user_`date+%y%m%d`.txt done</tmp/tmpmy_user_t_`date+%y%m%d`.txt } create_html(){ rm-rf$file_output touch$file_output create_html_css>>$file_output create_html_head"OSBasicSummary">>$file_output create_table_head1>>$file_output get_physics>>/tmp/tmpos_summ_`date+%y%m%d`.txt whilereadline do create_tr1"$line" done</tmp/tmpos_summ_`date+%y%m%d`.txt create_table_end>>$file_output create_html_head"CPUInfoSummary">>$file_output create_table_head1>>$file_output get_cpuinfo>>/tmp/tmp_cpuinfo_`date+%y%m%d`.txt whilereadline do create_tr1"$line" done</tmp/tmp_cpuinfo_`date+%y%m%d`.txt create_table_end>>$file_output create_html_head"MEMInfoSummary">>$file_output create_table_head1>>$file_output get_meminfo whilereadline do create_tr1"$line" done</tmp/tmpmem1_`date+%y%m%d`.txt create_table_end>>$file_output create_table_head1>>$file_output create_tr3"/tmp/tmpmem2_`date+%y%m%d`.txt" create_table_end>>$file_output create_table_head1>>$file_output whilereadline do create_tr2"$line" done</tmp/tmpmem3_h1_`date+%y%m%d`.txt whilereadline do create_tr1"$line" done</tmp/tmpmem3_t1_`date+%y%m%d`.txt create_table_end>>$file_output create_html_head"DiskInfoSummary">>$file_output create_table_head1>>$file_output get_diskinfo whilereadline do create_tr2"$line" done</tmp/tmpdisk_h1_`date+%y%m%d`.txt whilereadline do create_tr1"$line" done</tmp/tmpdisk_t1_`date+%y%m%d`.txt create_table_end>>$file_output create_table_head1>>$file_output create_tr3"/tmp/tmpdisk1_`date+%y%m%d`.txt" create_table_end>>$file_output create_table_head1>>$file_output create_tr3"/tmp/tmpdisk2_`date+%y%m%d`.txt" create_table_end>>$file_output create_table_head1>>$file_output create_tr3"/tmp/tmpdisk3_`date+%y%m%d`.txt" create_table_end>>$file_output create_html_head"NetworkInfoSummary">>$file_output create_table_head1>>$file_output get_netinfo whilereadline do create_tr2"$line" done</tmp/tmpnet_h1_`date+%y%m%d`.txt whilereadline do create_tr1"$line" done</tmp/tmpnet1_`date+%y%m%d`.txt create_table_end>>$file_output create_html_head"OSLoadSummary">>$file_output create_table_head1>>$file_output get_topproc create_tr3"/tmp/tmpload_`date+%y%m%d`.txt" create_table_end>>$file_output create_html_head"TOPCPUSummary">>$file_output create_table_head1>>$file_output create_tr3"/tmp/tmptopcpu_`date+%y%m%d`.txt" create_table_end>>$file_output create_html_head"TOPMEMSummary">>$file_output create_table_head1>>$file_output create_tr3"/tmp/tmptopmem_`date+%y%m%d`.txt" create_table_end>>$file_output create_html_head"TOPIOSummary">>$file_output create_table_head1>>$file_output create_tr3"/tmp/tmptopio_`date+%y%m%d`.txt" create_table_end>>$file_output create_html_head"BasicDatabaseInformation">>$file_output create_table_head1>>$file_output my_base_info>>/tmp/tmpmy_base_`date+%y%m%d`.txt sed-i-e'1d'-e's/:/|/g'/tmp/tmpmy_base_`date+%y%m%d`.txt whilereadline do create_tr1"$line" done</tmp/tmpmy_base_`date+%y%m%d`.txt create_table_end>>$file_output create_html_head"RunningStatusofDatabase">>$file_output create_table_head1>>$file_output my_stat_info create_tr3"/tmp/tmpmy_stat_`date+%y%m%d`.txt" create_table_end>>$file_output create_html_head"IPConnectionStatistics">>$file_output create_table_head1>>$file_output my_connip_info whilereadline do create_tr2"$line" done</tmp/tmpmy_connip_h1_`date+%y%m%d`.txt whilereadline do create_tr1"$line" done</tmp/tmpmy_connip_t1_`date+%y%m%d`.txt create_table_end>>$file_output create_html_head"ImportantParameters">>$file_output create_table_head1>>$file_output my_param_info whilereadline do create_tr2"$line" done</tmp/tmpmy_param_h1_`date+%y%m%d`.txt whilereadline do create_tr1"$line" done</tmp/tmpmy_param_t1_`date+%y%m%d`.txt create_table_end>>$file_output create_html_head"Sizeofeachdatabase">>$file_output my_segm1_info>>$file_output create_html_head"TOP10SpaceTable">>$file_output my_segm2_info>>$file_output create_html_head"HighWaterLevelMeter">>$file_output my_segm3_info>>$file_output create_html_head"Objecttypestatistics">>$file_output my_obj1_info>>$file_output create_html_head"StorageEngineNumberStatistics">>$file_output my_obj2_info>>$file_output create_html_head"Tableswithoutprimarykeys">>$file_output my_obj3_info>>$file_output create_html_head"Lockinformation">>$file_output my_lock_info>>$file_output create_html_head"InnodbStatusInformation">>$file_output create_table_head1>>$file_output my_innodb_info>>/tmp/tmpmy_innodb_`date+%y%m%d`.txt create_tr3"/tmp/tmpmy_innodb_`date+%y%m%d`.txt" create_table_end>>$file_output create_html_head"UserAuthorizationInformation">>$file_output create_table_head1>>$file_output my_user_info create_tr3"/tmp/tmpmy_user_`date+%y%m%d`.txt" create_table_end>>$file_output create_html_head"SlowSQLstatistics">>$file_output create_html_end>>$file_output sed-i's/BORDER=1/width="68%"border="1"bordercolor="#000000"cellspacing="0px"style="border-collapse:collapse"/g'$file_output rm-rf/tmp/tmp*_`date+%y%m%d`.txt } #Thisscriptmustbeexecutedasroot RUID=`id|awk-F\('{print$1}'|awk-F\='{print$2}'` ##OR#RUID=`id|cut-d\(-f1|cut-d\=-f2`#OR#ROOT_UID=0 if[${RUID}!="0"];then echo"Thisscriptmustbeexecutedasroot" exit1 fi PLATFORM=`uname` if[${PLATFORM}="HP-UX"];then echo"ThisscriptdoesnotsupportHP-UXplatformforthetimebeing" exit1 elif[${PLATFORM}="SunOS"];then echo"ThisscriptdoesnotsupportSunOSplatformforthetimebeing" exit1 elif[${PLATFORM}="AIX"];then echo"ThisscriptdoesnotsupportAIXplatformforthetimebeing" exit1 elif[${PLATFORM}="Linux"];then echo-e" ########################################################################################### ## #Makesurethatthefollowingparametersatthebeginningofthescriptarecorrect.# #myuser="root"(DatabaseAccount)# #mypasswd="password"(Databasepassword)# #myip="192.168.11.101"(DatabasenativeIP)# #myport="3307"(Databaseport)# #Otherwise,thescriptcannotbeexecutedproperly.# ## ########################################################################################### " #read-p"Thedatabaseconnectioninformationisconfiguredcorrectly.Pleaseexecute[yesory]:"SELECT #printf'\n' #if[$SELECT=="yes"-o$SELECT=="y"];then create_html #else #exit1 #fi fi

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

每日一博 | 徒手用 HTML 生成一朵云,很真的那种

《天边一朵云》是由蔡明亮执导,李康生、陈湘琪领衔主演的剧情电影,情节很文艺,摄影很露骨,属于那种你看了后完全没有撸点的色情片。看完本片后,我很后悔,所以我打算自己用html弄出天边一片云(本句上下文没有任何关联,只有没撸点这方面一样) 云的特点就是模糊,琢磨不定,所以我的入手点就是阴影,让我们开始撸代码,上帝说要有个div,就有了一个div <div id="cloud-circle"></div> 为了div有个伴,就从div的身体里拆下肋骨,变成了css body { width: 100vw; height: 100vw; background: cornsilk; padding: 1%; } #cloud-circle { width: 180px; height: 180px; background: coral; border-radius: 50%; box-shadow: 200px 200px 50px 0px #000; } 其实就是画了一个圆,然后用box-shadow加了个阴影,box-shadow的参数说明如下: 其中最后一个参数inset没写,模糊靠的是blur参数。看到的效果如下: 好像和云的形象距离比较远,这时候要svg的filter出场了: <svg width="0" height="0"> <filter id="filter"> <feTurbulence type="fractalNoise" baseFrequency=".01" numOctaves="10" /> <feDisplacementMap in="SourceGraphic" scale="10" /> </filter> </svg> 在上面的CSS里面加上这个filter #cloud-circle { width: 180px; height: 180px; background: coral; border-radius: 50%; filter: url(#filter);/*看这里看这里*/ box-shadow: 200px 200px 50px 0px #000; } 看到的效果是这样的 在filter的腐蚀下,cloud-circle这个div的面容变的憔悴了,(女同胞们,用手机摄像头滤镜是没有好下场的!)。这里我们要讲下filter。SVG使用<filter>元素来定义滤镜。它的滤镜其实有很多,效果各异,具体的内容可以看这里。我们用的是滤镜中的feTurbulence,该滤镜利用Perlin噪声函数创建了一个图像。它实现了人造纹理比如说云纹、大理石纹的合成。看到云纹了没有,我们要的就是它。具体的参数不说了,大家可以自己去这里看,我们主要用SourceGraphic这个参数,这个参数值越大,对图像的腐蚀性越强,我看180这个数字挺吉利,就用它试下: <feDisplacementMap in="SourceGraphic" scale="10" /> 效果如下: 这愁云惨雾的样子就有些象了,但这个背景颜色不对,我这又不是沙城暴,不能是黄色的啊,调成蓝天 background: linear-gradient(165deg, #527785 0%, #7FB4C7 100%); 看,沙城暴过去了,蓝天来了 不过云彩一般是长条的,我们把那个圆形(如果大家还记得这个货最开始一个圆的话)拉长,变成一个长椭圆形。 #cloud-circle { /*拉长width和height的比例*/ width: 500px; height: 275px; background: coral; border-radius: 50%; filter: url(#filter); box-shadow: 200px 200px 50px 0px #000; } 效果就变成这样啦 这两货你侬我侬的,靠的太紧了,桔色这家伙还压在别人黑小姐身上,太不纯洁了,拆散拆散。 #cloud-circle { width: 500px; height: 275px; background: coral; border-radius: 50%; filter: url(#filter); box-shadow: 400px 400px 60px 0px #fff; /* 拉大阴影的位移位置,改变阴影的颜色 */ position: absolute; /* 改成绝对定位 */ top: -320px; /* 向上移一点 */ left: -320px; /* 向左移一点 */ } 于是,猴急的橙色男士被移出了窗口,看不见了,黑小姐变成了白小姐了。 我终于成功的拆散了他们,心情很是舒畅,一朵白云就这么做出来了。但看她单薄的样子,一副二次元的模样,我觉得很不满意,我不是宅男啊,不喜欢纸片人,我要让她有立体感,咋办呢,这时候,要祭出一张原理图,让大家知道我也是有理论知识的。 看,一朵有层次的云其实是真的靠层次来体现的,三层合一就是一朵有白有黑,前凸后翘的立体云了,我们开始撸代码,先来三层云: <div class="cloud" id="cloud-back"></div> <div class="cloud" id="cloud-mid"></div> <div class="cloud" id="cloud-front"></div> 然后各自拥有自己的filter <svg width="0" height="0"> <!--Top Layer--> <filter id="filter-back"> <feTurbulence type="fractalNoise" baseFrequency="0.012" numOctaves="4" seed="0" /> <feDisplacementMap in="SourceGraphic" scale="170" /> </filter> <filter id="filter-mid"> <feTurbulence type="fractalNoise" baseFrequency="0.012" numOctaves="2" seed="0"/> <feDisplacementMap in="SourceGraphic" scale="150" /> </filter> <filter id="filter-front"> <feTurbulence type="fractalNoise" baseFrequency="0.012" numOctaves="2" seed="0"/> <feDisplacementMap in="SourceGraphic" scale="100" /> </filter> </svg> 里面主要变化就在SourceGraphic,之前讲过,这个参数越大,腐蚀性越强。另外css也要做下修改: .cloud { width: 500px; height: 275px; border-radius: 50%; position: absolute; top: -35vh; left: -25vw; } #cloud-back { filter: url(#filter-back); box-shadow: 300px 300px 30px -20px #fff; } #cloud-mid { filter: url(#filter-mid); box-shadow: 300px 340px 70px -60px rgba(158, 168, 179, 0.5); left: -25vw; } #cloud-front { filter: url(#filter-front); box-shadow: 300px 370px 60px -100px rgba(0, 0, 0, 0.3); left: -25vw; } 主要是针对三层云的颜色和阴影大小位置做了些调整,最终的结果就出来了。 一朵怎么看怎么象真的云就出现了。代码大家可以去这里看 最后,如果大家看完了《天边一片云》这部电影,对西瓜这种水果会有全新的认识......

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

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

Sublime Text

Sublime Text

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

用户登录
用户注册
修改密码
忘记密码