获取手机连接的wifi密码

星期三, 2019-12-25 | Author: Lee | computer | 没有评论 1,543 views

最近刚好休息一段时间,带着笔记本去图书馆,倒是很安静的,无奈没有直接公布可以用的wifi,算是小小遗憾吧.

但是现在基本上到处都是可以用的WIFI,从周边抓取一个信号强的来使用.

1.手机下载 WIFI万能钥匙

选取信号最好的那个免费连接即可,so easy.

2.手机WIFI选中 分享wifi二维码到微信

微信 二维码识别 P:后面即是密码,到;S前

完整信息示例:(123456789)为密码

WIFI:T:WPA;P:123456789;S:VIP;

Tags:

WordPress打赏插件之Admire基于改进自定义版

星期五, 2019-12-20 | Author: Lee | wordpress | 没有评论 2,059 views

打赏的一个功能一个插件而已

赞赏「admire」

首先感谢:有赏「You Shang」的作者:https://www.rifuyiri.net/t/4667

本人启用的时候不知道是新版本的原因还是插件有冲突,无法正常使用,然后自己重新改进之.

赞赏「admire」使用步骤

0.本地下载地址 https://www.pomelolee.com/admire/admire-v-1.0.0.zip

1.后台启用 赞赏「admire」插件


2.赞赏「admire」插件设置下自己的二维码地址,启用,默认是关闭展示的

3.需要自己手动在需要的地方调用函数即可代码如下

  <?php admire_show(); ?>

赞赏「admire」是一款能为WordPress便捷加入微信、支付宝,支付宝红包打赏/赞赏功能的插件。

改进地方:

1.移除了依赖jquery的信息

2.取消了拦截内容展示,改为手动自定义展示的地方

== Description ==

赞赏「admire」是一款能为WordPress便捷加入微信、支付宝,支付宝红包打赏/赞赏功能的插件。

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/admire` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the ‘Plugins’ screen in WordPress
3. Use the set screen to configure the plugin

== Screenshots ==

== Frequently Asked Questions ==

== Upgrade Notice ==

== Changelog ==

= 1.0.0 =

* only js no need jquery
* init
*<?php admire_show(); ?>

Tags: , , ,

git常用指令速查记录

星期五, 2019-12-13 | Author: Lee | JAVA-and-J2EE, linux | 没有评论 1,159 views

方便自己随时翻查

#查看远程分支

1.git branch -a

#查看本地分支

2.git branch

#创建切换分支

3.git checkout -b dev-lee origin/dev

#切换回master分支

4.git checkout master

› 继续阅读

Tags:

移除WordPress头部的window._wpemojiSettings代码及dns-prefetch

星期四, 2019-12-12 | Author: Lee | wordpress | 没有评论 2,154 views

升级到新版的wordpress的,看了下页面好多emojo的 js定义代码,对我也没有多大用,移除之.

头部还添加了dns-prefetch,从s.w.org预获取表情和头像,但s.w.org国内无法访问也是浪费.

在主题编辑 functions.php 文件中最后添加即可

//remove emoji
remove_action( 'admin_print_scripts', 'print_emoji_detection_script');
remove_action( 'admin_print_styles', 'print_emoji_styles');
remove_action( 'wp_head', 'print_emoji_detection_script', 7);
remove_action( 'wp_print_styles', 'print_emoji_styles');
remove_filter( 'the_content_feed', 'wp_staticize_emoji');
remove_filter( 'comment_text_rss', 'wp_staticize_emoji');
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email');
 
//remove dns-prefetch
remove_action( 'wp_head', 'wp_resource_hints', 2 );

刷新页面可以看到那一堆js消失了.

Tags: , ,

docker开启centos7的ssh远程连接及systemctl的放弃

星期四, 2019-12-12 | Author: Lee | computer, linux, Synology群晖 | 没有评论 3,311 views

群晖中docker开启centos7的ssh远程连接及systemctl的放弃

0.在群晖里开了centos想开启ssh连接由此记录

但是仍然无法开启systemctl功能,在配置中启用 ENTRYPOINT:/usr/sbin/init

虽然能启动systemctl 但是容器一旦重启就再也无法拉起,启动此容器失败会报cgroup的错误,然后再重建centos都会出问题,只有重启群晖解决,

里面大概是需要设置docker的一些东西,懒得搞了遂放弃,不想在群晖的主机中用命令行再折腾了

以后有需要再玩.

1. 安装passwd,openssl,openssh-server,net-tools

 yum -y update 
 yum install passwd openssl openssh-server net-tools -y

启动sshd:
# /usr/sbin/sshd -D &
正常启动需要pid文件存在,可以创建/var/run/ssh

› 继续阅读

Tags: ,

golang启用cron的定时任务

星期三, 2019-12-11 | Author: Lee | golang | 没有评论 2,059 views

0.起因用golang写了个自动备份mysql数据库的工具

把原来用shell脚步写的工具,封装成可执行文件,配置对应的密码参数即可自动执行,方便数据的自动备份

现在都用云数据库了,这种脚本也越来越不需要用了,直接保留镜像就好了,从小网站节省成本还是需要做的,只做全量备份即可.

闲话:还准备自动同步备份文件到多台机器,感觉golang写工具还是爽哉,想要工具可以赞赏我哈^-^

1.工具要用到定时执行启用cron

使用 https://github.com/robfig/cron 这个包,它实现了 cron 规范解析器和任务运行器

具体使用可以参加起使用说明,新版已经不直接支持秒的功能需要启用秒需要 c :=cron.New(cron.WithSeconds())即可

› 继续阅读

Tags: ,

letsencrypt的https证书续期遭遇raw.githubusercontent.com无法访问

星期日, 2019-12-08 | Author: Lee | linux | 没有评论 2,816 views

今天看到邮件提醒letsencrypt的https的证书快要到期了,想想自己设置了自动续期怎么还会有邮件提醒呢?

登录服务器查看,发现续期的脚本执行有错…

访问:https://raw.githubusercontent.com/certbot/certbot/v1.0.0/letsencrypt-auto-source/letsencrypt-auto

出现了无法连接,拒绝访问,解决之,重试脚本,升级完成.

0. ping raw.githubusercontent.com 获取的IP地址:151.101.108.133已经无法访问,连接重置了

1.访问ipaddress.com,或者使用ip lookup 工具获得相关域名的ip地址

当前查询:https://githubusercontent.com.ipaddress.com/raw.githubusercontent.com 的IP地址为:

IP Address 199.232.28.133

2.hosts添加指向此IP地址

sudo vi /etc/hosts
 
199.232.28.133 raw.githubusercontent.com

3.重新执行续期脚本,等待升级即可.

Tags:

centos7开启sshd多端口登录及修改端口

星期三, 2019-12-04 | Author: Lee | Database, linux | 3 Comments 2,414 views

0.不知道怎么回事 一台国外的机器的ssh的22端口,时常无法ssh连接,因此多加个端口来备用

1.编辑配置文件打开Port=22 或者修改此端口

vi /etc/ssh/sshd_config

Port 22
Port 1022

2.重启sshd服务

systemctl restart sshd

3.查看服务启动情况

netstat -lntp

4.防火墙放行

iptables -A INPUT -p tcp --dport 1022 -j ACCEPT

5.使用xshell等连接即可

可以同时使用22及1022的端口进行sshd连接服务器了

Tags: ,

Spring Boot 的核心注解SpringBootApplication引起的探究

星期二, 2019-12-03 | Author: Lee | JAVA-and-J2EE, spring-boot | 没有评论 1,239 views

Spring Boot 的核心注解SpringBootApplication引起的探究

1.Spring Boot 的核心注解是哪个?

先上一个工程的启动配置项看下:

项目比较老混杂了spring boot,dubbo,jersey注册等

	package com.pomelolee.cms;
 
	import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
	import com.pomelolee.boot.dubbo.annotation.EnableDubboProvider;
	import org.glassfish.jersey.server.ResourceConfig;
	import org.glassfish.jersey.servlet.ServletProperties;
	import org.springframework.beans.factory.config.BeanDefinition;
	import org.springframework.boot.SpringApplication;
	import org.springframework.boot.autoconfigure.SpringBootApplication;
	import org.springframework.boot.builder.SpringApplicationBuilder;
	import org.springframework.boot.web.support.SpringBootServletInitializer;
	import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
	import org.springframework.cloud.netflix.feign.EnableFeignClients;
	import org.springframework.context.annotation.Bean;
	import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
	import org.springframework.context.annotation.ImportResource;
	import org.springframework.util.ClassUtils;
 
	import java.util.HashSet;
	import java.util.Set;
 
	@EnableFeignClients
	@SpringBootApplication
	@EnableApolloConfig
	@EnableDiscoveryClient
	@EnableDubboProvider
	@ImportResource("classpath*:/META-INF/spring/spring-job.xml")
	public class Application extends SpringBootServletInitializer {
	  public static void main(String[] args) {
	    SpringApplication.run(Application.class, args);
	  }
 
	  @Override
	  protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
	    return application.sources(Application.class);
	  }
 
	  @Bean
	  public ResourceConfig resourceConfig() {
	    ResourceConfig resourceConfig = new ResourceConfig();
	    ClassPathScanningCandidateComponentProvider scanner =
	        new ClassPathScanningCandidateComponentProvider(true);
	    Set<beandefinition> beanDefinitionSet =
	        scanner.findCandidateComponents("com.pomelolee.cms.service");
	    beanDefinitionSet.addAll(scanner.findCandidateComponents("com.pomelolee.cms.facade"));
	    beanDefinitionSet.addAll(scanner.findCandidateComponents("com.pomelolee.cms.config"));
	    Set<Class<?>> clazzSet = new HashSet<Class<?>>();
	    for (BeanDefinition beanDefinition : beanDefinitionSet) {
	      clazzSet.add(
	          ClassUtils.resolveClassName(
	              beanDefinition.getBeanClassName(), resourceConfig.getClassLoader()));
	    }
	    resourceConfig.registerClasses(clazzSet);
	    resourceConfig.property(ServletProperties.FILTER_FORWARD_ON_404, true);
	    return resourceConfig;
	  }
	}
 </beandefinition>

@SpringBootApplication 注解,就是 Spring Boot 的核心注解。

› 继续阅读

Tags: ,

centos下jdk11及jdk8的环境变量配置

星期三, 2019-11-20 | Author: Lee | JAVA-and-J2EE, linux | 一条评论 3,440 views

0.最新的下载地址

Oracle 官方下载地址:https://www.oracle.com/technetwork/java/javase/downloads/index.html

国内镜像仓库华为:https://repo.huaweicloud.com/java/jdk/

由于Oracle JDK 11 的许可证的变化,生产环境需要使用OpenJDK 11(以免甲骨文律师信警告^o^)

亚马逊的编译版本下载地址(corretto):https://aws.amazon.com/cn/corretto/

adoptopenjdk编译的版本下载:https://adoptopenjdk.net/

1.配置jdk11、jdk12的 /etc/profile文件最后面追加即可,

jdk9后续版本将不再有jre及classpath要配置了

vi /etc/profile
 
export JAVA_HOME=/usr/local/webserver/jdk/jdk-11.0.5
export PATH=$PATH:$JAVA_HOME/bin

后续source 生效

source /etc/profile
 
java -version

2.配置jdk8的配置文件

tar zxvf  jdk-8u231-linux-x64.tar.gz
mv  jdk1.8.0_231 /usr/local/java/
 
vi /etc/profile
 
 
export JAVA_HOME=/usr/local/java/jdk1.8.0_231
export JRE_HOME=/usr/local/java/jdk1.8.0_231/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

Tags: ,

Search

文章分类

Links

Meta