- php 实现JWT
每天瞎忙的农民工
phpphp
在PHP中,JSONWebToken(JWT)是一种开放标准(RFC7519)用于在各方之间作为JSON对象安全地传输信息。JWT通常用于身份验证系统,如OAuth2或基于令牌的身份验证。以下是一个基本的PHP实现JWT生成和验证的代码示例。JWT的组成部分JWT包含三个部分:Header(头部):说明算法和令牌类型。Payload(有效载荷):包含声明(如用户数据、过期时间等)。Signatur
- springcloud — 微服务鉴权管理Spring Security原理解析(二)
RachelHwang
springcloudspringjavaspringsecurityoauth2springcloud
引言:回顾之前介绍的OAuth2简单分析与介绍,微服务鉴权管理之OAuth2原理解析(一),前面的部分,我们关注了SpringSecurity是如何完成认证工作的,但是另外一部分核心的内容:过滤器,一直没有提到,我们已经知道SpringSecurity使用了springSecurityFilterChain作为了安全过滤的入口,这一节主要分析一下这个过滤器链都包含了哪些关键的过滤器,并且各自的使命
- Spring Cloud云架构 - SSO单点登录之OAuth2.0 根据token获取用户信息(4)
初夏_91fb
上一篇我根据框架中OAuth2.0的使用总结,画了SSO单点登录之OAuth2.0登出流程,今天我们看一下根据用户token获取yoghurt信息的流程:image/***根据token获取用户信息*@paramaccessToken*@return*@throwsException*/@RequestMapping(value="/user/token/{accesstoken}",method
- 这可能是全网最详细的 Spring Cloud OAuth2 单点登录使用教程了,妈妈再也不用担心我被面试官吊打了!
2401_84558091
程序员java面试学习
最后对于很多Java工程师而言,想要提升技能,往往是自己摸索成长,不成体系的学习效果低效漫长且无助。整理的这些资料希望对Java开发的朋友们有所参考以及少走弯路,本文的重点是你有没有收获与成长,其余的都不重要,希望读者们能谨记这一点。再分享一波我的Java面试真题+视频学习详解+技能进阶书籍本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收
- 【DevOps工具篇】使用Ansible部署Keycloak oauth2proxy 和 单点登录(SSO)设置
小涵
DevOps企业级项目实战devopsansible运维ldapkeycloakproxyoauth
【DevOps工具篇】使用Ansible部署Keycloakoauth2proxy和单点登录(SSO)设置目录【DevOps工具篇】使用Ansible部署Keycloakoauth2proxy和单点登录(SSO)设置Ansible基础知识部署Keycloak创建OIDC-客户端创建oauth2proxy部署顶级AnsiblePlaybookHost.iniplaybook.yaml推荐超级课程:D
- Oauth2简介
Lill_bin
杂谈githubgit网络服务器大数据java
OAuth2.0是一个行业标准的协议,用于授权。它允许应用程序代表用户访问服务器上的数据,而无需暴露用户的用户名和密码。OAuth2.0专注于简化客户端开发人员的操作,同时为Web应用、桌面应用、手机和客厅设备提供专门的认证流程。OAuth2.0的核心概念:资源所有者(ResourceOwner):指的是数据的拥有者,即用户。在OAuth2.0中,资源所有者授权第三方应用访问其数据。资源服务器(R
- Spring-Security(二)OAuth2认证详解(持续更新)
lbmydream
springcloud架构spring探析springjava后端
SpringSecurity&Oauth2系列:SpringSecurity(一)源码分析及认证流程SpringSecurity(二)OAuth2认证详解及自定义异常处理文章目录1、OAuth2.0简介1.1OAuth2.0相关名词解释1.2四种授权模式1.3、OAuth2框架1.4OAuth2.0客户端提供功能2、OAuth2.0认证服务2.1SpringSecurityOAuth2提供的程序实
- 支付宝生活号获取用户授权
Strawberry96
支付宝生活号前端
为了下次不用再去看一遍官方文档,简单的做一下笔记。想了解更多的细节,请移步支付宝官方文档1、用户授权,拼接的url,如下:获取用户信息的授权scope=auth_user:https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=APPID&scope=auth_user&redirect_uri=ENCODED_URL?st
- 教程:在Spring Boot应用中集成OAuth 2.0认证
微赚淘客系统开发者@聚娃科技
springboot后端java
教程:在SpringBoot应用中集成OAuth2.0认证大家好,我是免费搭建查券返利机器人省钱赚佣金就用微赚淘客系统3.0的小编,也是冬天不穿秋裤,天冷也要风度的程序猿!OAuth2.0是一种广泛使用的授权框架,用于安全地授权第三方应用程序访问HTTP服务,而无需将用户的用户名和密码暴露给第三方。在现代的分布式系统中,使用OAuth2.0认证可以有效地保护API端点和用户数据。本文将介绍如何在S
- Spring OAuth2.0 OIDC详解
Mr. bigworth
OAuth2.0springspringboot
OIDC简介作用身份验证:OIDC在OAuth2授权的基础上增加了身份验证功能,通过IDToken验证用户身份的真实性。用户信息获取:通过IDToken和用户信息端点,客户端可以获取用户的详细信息。安全性增强:通过引入nonce参数和IDToken,OIDC增强了请求的安全性,防止重放攻击等安全问题。总的来说,OIDC提供了比OAuth2更加完整和安全的身份验证和授权机制,确保在授权第三方应用访问
- 在Spring Boot中实现OAuth2.0认证
微赚淘客机器人开发者联盟@聚娃科技
springbootjavaredis
在SpringBoot中实现OAuth2.0认证大家好,我是微赚淘客系统3.0的小编,是个冬天不穿秋裤,天冷也要风度的程序猿!OAuth2.0是一种用于授权的协议,它使得用户可以授权第三方应用程序访问他们在某服务提供商上的资源,而无需共享他们的凭据。SpringBoot提供了对OAuth2.0的原生支持,可以方便地将其集成到应用程序中。本文将详细介绍如何在SpringBoot中实现OAuth2.0
- Spring Boot 与 Spring Security 的集成及 OAuth2 实现
2的n次方_
springspringbootjava
我的主页:2的n次方_在现代Web应用开发中,安全性是至关重要的。无论是保护用户的敏感数据,还是确保API只允许经过授权的请求访问,开发者都需要一个强大且灵活的安全框架来实现这些需求。SpringSecurity作为Spring框架的安全模块,能够为应用提供全面的安全保护。而OAuth2作为一种授权协议,广泛应用于单点登录(SSO)、社交登录、API保护等场景。本文将详细介绍如何在SpringBo
- springboot 集成OAuth2 一些用到的基础类
耂勹
springspringbootjavaspring
文章目录1.登录校验token,提取clientId2.根据clientId获取token配置信息类3.实际登录类4.加载token信息到自定义缓存5.自定义用户信息类6.异常翻译类7.认证服务器配置1.登录校验token,提取clientIdpackageorg.springframework.security.web.authentication.www;publicclassBasicAut
- 设计一个登录系统时,分布式如何保证
喝醉的小鲁班
设计模式
设计一个分布式登录系统时,需要确保系统的可靠性、安全性和可扩展性。分布式系统的登录功能需要处理用户认证、授权、会话管理等方面,并且要在多个服务器或服务实例之间保持一致。以下是设计分布式登录系统时需要考虑的一些关键点:1.用户认证与授权集中认证服务:设计一个专门的认证服务处理用户登录请求。所有的登录请求都应通过这个服务进行处理。认证服务可以使用JWT(JSONWebTokens)、OAuth2、Op
- Salesforce Community 用户 OAuth 只能通过 web server 或 user-agent flows,而不能通过 username/password
Channing Lewis
Salesforcesalesforce
importrequestsinstance_url='https://yourCompanyName.my.site.com'url=f"{instance_url}/services/oauth2/token"payload={'grant_type':'password','client_id':'CLIENT_ID','client_secret':'CLIENT_SECRET','use
- 程序员开发技术整理
laizhixue
学习前端框架
前端技术:vue-前端框架element-前端框架bootstrap-前端框架echarts-图标组件C#后端技术:webservice:soap架构:简单的通信协议,用于服务通信ORM框架:对象关系映射,如EF:对象实体模型,是ado.net中的应用技术soap服务通讯:xml通讯ado.net:OAuth2:登录授权认证:Token认证:JWT:jsonwebtokenJava后端技术:便捷工
- 整合spring cloud云架构 - SSO单点登录之OAuth2.0 根据token获取用户信息(4)
初夏_91fb
上一篇我根据框架中OAuth2.0的使用总结,画了SSO单点登录之OAuth2.0登出流程,今天我们看一下根据用户token获取yoghurt信息的流程:image/***根据token获取用户信息*@paramaccessToken*@return*@throwsException*/@RequestMapping(value="/user/token/{accesstoken}",method
- Spring Cloud微服务网关Zuul过滤链和整合OAuth2+JWT入门实战
NullzzZ
微服务SpringCloud系列文章springcloud微服务网络java后端springspringboot
一、SpringCloudZuul过滤链1.1工作原理Zuul的核心逻辑是由一系列的Filter来实现的,他们能够在进行HTTP请求或者相应的时候执行相关操作。ZuulFilter的主要特性有一下几点:Filter的类型:Filter的类型决定了它在Filter链中的执行顺序。路由动作发生前、路由动作发生时,路由动作发生后,也可能是路由过程发生异常时。Filter的执行顺序:同一种类型的Filte
- grpc、https、oauth2等认证专栏实战17:grpc-go自定义认证之base64验证介绍
码二哥
码二哥的技术专栏golangkubernetesgrpc-go零入门容器云网络网络协议
已发表的技术专栏(订阅即可观看所有专栏)0 grpc-go、protobuf、multus-cni技术专栏总入口1 grpc-go源码剖析与实战 文章目录2 Protobuf介绍与实战图文专栏 文章目录3 multus-cni 文章目录(k8s多网络实现方案)4 grpc、oauth2、openssl、双向认证、单向认证等专栏文章目录本篇文章主要分享自定义认证下base64验证方案
- Spring Security对接OIDC(OAuth2)外部认证
langzitianya
SpringBootJAVAspringbootspringsecurityoauth2oidcopenid前后端分离
前后端分离项目对接OIDC(OAuth2)外部认证,认证服务器可以使用Keycloak。后端已有用户管理和权限管理,需要外部认证服务器的用户名和业务系统的用户名一致才可以登录。后台基于SpringBoot2.7+SpringSecurity流程:前台浏览器跳转到后台地址+/login/oauth2/authorization/my-oidc-client后台返回302重定向,重定向到登录外部认证服
- 【微服务安全】OpenID Connect 简介:现代应用程序的身份验证
surfirst
架构安全服务器运维
OpenIDConnect(OIDC)是一个建立在OAuth2.0之上的开放身份验证协议。它简化了应用程序以一种标准化和可互操作的方式验证用户身份并获取其基本个人资料信息的方式。可以将其视为应用程序“知道你是谁”的一种安全方式,而无需你创建单独的帐户或透露你的密码。以下是OIDC的工作原理:1.用户发起登录:您访问使用OIDC的网站或应用程序。代替创建新帐户,您可以单击“使用[提供商]登录”按钮,
- 【springboot+vue项目(十五)】基于Oauth2的SSO单点登录(二)vue-element-admin框架改造整合Oauth2.0
幸福巡礼
springbootvue.js后端
Vue-element-admin是一个基于Vue.js和ElementUI的后台管理系统框架,提供了丰富的组件和功能,可以帮助开发者快速搭建现代化的后台管理系统。一、基本知识(一)Vue-element-admin的主要文件和目录vue-element-admin/|--build/#构建相关配置文件||--build.js#生产环境构建脚本||--check-versions.js#检查Nod
- oauthlib,一个强大的 Python 身份校验库!
漫走云雾
python开发语言oauth
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到网站零基础入门的AI学习网站~。目录编辑前言什么是OAuthLib?安装OAuthLibOAuthLib的主要功能OAuthLib的用法实现OAuth2.0服务端实现OAuth2.0客户端实际应用案例1.第三方登录集成2.API访问控制3.单点登录(SSO)总结前言大家好,今天为大家分享一个强大的Pytho
- Blazor OIDC 单点登录授权实例5 - 独立SSR App (net8 webapp ) 端授权
Densen2014
BlazorBlazorhybird/MAUIBlazorBootstrapBlazorwebapp
目录:OpenID与OAuth2基础知识BlazorwasmGoogle登录BlazorwasmGitee码云登录BlazorOIDC单点登录授权实例1-建立和配置IDS身份验证服务BlazorOIDC单点登录授权实例2-登录信息组件wasmBlazorOIDC单点登录授权实例3-服务端管理组件BlazorOIDC单点登录授权实例4-部署服务端/独立WASM端授权BlazorOIDC单点登录授权实
- Blazor Wasm Gitee 码云登录
Densen2014
BlazorBlazorhybird/MAUIBlazorwasmgiteejquery
目录:OpenID与OAuth2基础知识BlazorwasmGoogle登录BlazorwasmGitee码云登录BlazorSSR/WASMIDS/OIDC单点登录授权实例1-建立和配置IDS身份验证服务BlazorSSR/WASMIDS/OIDC单点登录授权实例2-登录信息组件wasmBlazorSSR/WASMIDS/OIDC单点登录授权实例3-服务端管理组件BlazorSSR/WASMID
- SpringBoot--实战开发--OAuth2.0客户端模式(五十一)
无剑_君
一、客户端模式简介 客户端模式(ClientCredentialsGrant)指客户端以自己的名义,而不是以用户的名义,向"服务提供商"进行认证。严格地说,客户端模式并不属于OAuth框架所要解决的问题。在这种模式中,用户直接向客户端注册,客户端以自己的名义要求"服务提供商"提供服务,其实不存在授权问题。 这种模式直接根据client的id和密钥即可获取token,无需用户参与这种模式比较合适
- 微信订阅号通过获取Openid并获取用户基本信息
D_R_M
我们知道,服务号有获取用户基本信息的接口,通过oauth2.0网页授权获取的。但是认证的订阅号也有获取用户基本信息的接口了,但是与服务号不同的是,这个需要用户主动触发才可以获得,需要用户发送任意关键词或者点击菜单。image.png1、先获取openid,用户主动触发,获得openid2、获取access_token3、通过这两个获取用户基本信息,头像,昵称等接口调用请求说明http请求方式:GE
- 微服务OAuth 2.1认证授权Demo方案(Spring Security 6)
木子dn
SpringCloud#认证授权微服务架构springsecurityOAuth2.1
文章目录一、介绍二、auth微服务代码1.SecurityConfig2.UserDetailsService3.总结三、gateway微服务代码1.统一处理CORS问题四、content微服务代码1.controller2.SecurityConfig3.解析JWTUtils4.总结五、一些坑书接上文微服务OAuth2.1认证授权可行性方案(SpringSecurity6)一、介绍三个微服务au
- springboot集成Sa-Token及Redis的redisson客户端
enjoy编程
程序员实用工具集合springbootredisredissonSa-Token单点登录
文章目录什么是Sa-Token?为什么集成Redis的redisson客户端?如何集成?maven依赖application.yml配置过滤器配置验证参考什么是Sa-Token?Sa-Token是一个轻量级Java权限认证框架,主要解决:登录认证、权限认证、单点登录、OAuth2.0、分布式Session会话、微服务网关鉴权等一系列权限相关问题。具体参见:https://sa-token.cc/d
- User must be authenticated with Spring Security before authorization can be completed.异常处理
无我_无他_有你
错误:UsermustbeauthenticatedwithSpringSecuritybeforeauthorizationcanbecompleted.简要说下错误原因:该错误是oauth2授权码模式访问接口/oauth/authorize时,由于SpringSecurity上下文中没有用户认证信息,所以在springsecurity中拦截报错。源码中在/oauth/authorize接口de
- 深入浅出Java Annotation(元注解和自定义注解)
Josh_Persistence
Java Annotation元注解自定义注解
一、基本概述
Annontation是Java5开始引入的新特征。中文名称一般叫注解。它提供了一种安全的类似注释的机制,用来将任何的信息或元数据(metadata)与程序元素(类、方法、成员变量等)进行关联。
更通俗的意思是为程序的元素(类、方法、成员变量)加上更直观更明了的说明,这些说明信息是与程序的业务逻辑无关,并且是供指定的工具或
- mysql优化特定类型的查询
annan211
java工作mysql
本节所介绍的查询优化的技巧都是和特定版本相关的,所以对于未来mysql的版本未必适用。
1 优化count查询
对于count这个函数的网上的大部分资料都是错误的或者是理解的都是一知半解的。在做优化之前我们先来看看
真正的count()函数的作用到底是什么。
count()是一个特殊的函数,有两种非常不同的作用,他可以统计某个列值的数量,也可以统计行数。
在统
- MAC下安装多版本JDK和切换几种方式
棋子chessman
jdk
环境:
MAC AIR,OS X 10.10,64位
历史:
过去 Mac 上的 Java 都是由 Apple 自己提供,只支持到 Java 6,并且OS X 10.7 开始系统并不自带(而是可选安装)(原自带的是1.6)。
后来 Apple 加入 OpenJDK 继续支持 Java 6,而 Java 7 将由 Oracle 负责提供。
在终端中输入jav
- javaScript (1)
Array_06
JavaScriptjava浏览器
JavaScript
1、运算符
运算符就是完成操作的一系列符号,它有七类: 赋值运算符(=,+=,-=,*=,/=,%=,<<=,>>=,|=,&=)、算术运算符(+,-,*,/,++,--,%)、比较运算符(>,<,<=,>=,==,===,!=,!==)、逻辑运算符(||,&&,!)、条件运算(?:)、位
- 国内顶级代码分享网站
袁潇含
javajdkoracle.netPHP
现在国内很多开源网站感觉都是为了利益而做的
当然利益是肯定的,否则谁也不会免费的去做网站
&
- Elasticsearch、MongoDB和Hadoop比较
随意而生
mongodbhadoop搜索引擎
IT界在过去几年中出现了一个有趣的现象。很多新的技术出现并立即拥抱了“大数据”。稍微老一点的技术也会将大数据添进自己的特性,避免落大部队太远,我们看到了不同技术之间的边际的模糊化。假如你有诸如Elasticsearch或者Solr这样的搜索引擎,它们存储着JSON文档,MongoDB存着JSON文档,或者一堆JSON文档存放在一个Hadoop集群的HDFS中。你可以使用这三种配
- mac os 系统科研软件总结
张亚雄
mac os
1.1 Microsoft Office for Mac 2011
大客户版,自行搜索。
1.2 Latex (MacTex):
系统环境:https://tug.org/mactex/
&nb
- Maven实战(四)生命周期
AdyZhang
maven
1. 三套生命周期 Maven拥有三套相互独立的生命周期,它们分别为clean,default和site。 每个生命周期包含一些阶段,这些阶段是有顺序的,并且后面的阶段依赖于前面的阶段,用户和Maven最直接的交互方式就是调用这些生命周期阶段。 以clean生命周期为例,它包含的阶段有pre-clean, clean 和 post
- Linux下Jenkins迁移
aijuans
Jenkins
1. 将Jenkins程序目录copy过去 源程序在/export/data/tomcatRoot/ofctest-jenkins.jd.com下面 tar -cvzf jenkins.tar.gz ofctest-jenkins.jd.com &
- request.getInputStream()只能获取一次的问题
ayaoxinchao
requestInputstream
问题:在使用HTTP协议实现应用间接口通信时,服务端读取客户端请求过来的数据,会用到request.getInputStream(),第一次读取的时候可以读取到数据,但是接下来的读取操作都读取不到数据
原因: 1. 一个InputStream对象在被读取完成后,将无法被再次读取,始终返回-1; 2. InputStream并没有实现reset方法(可以重
- 数据库SQL优化大总结之 百万级数据库优化方案
BigBird2012
SQL优化
网上关于SQL优化的教程很多,但是比较杂乱。近日有空整理了一下,写出来跟大家分享一下,其中有错误和不足的地方,还请大家纠正补充。
这篇文章我花费了大量的时间查找资料、修改、排版,希望大家阅读之后,感觉好的话推荐给更多的人,让更多的人看到、纠正以及补充。
1.对查询进行优化,要尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。
2.应尽量避免在 where
- jsonObject的使用
bijian1013
javajson
在项目中难免会用java处理json格式的数据,因此封装了一个JSONUtil工具类。
JSONUtil.java
package com.bijian.json.study;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
- [Zookeeper学习笔记之六]Zookeeper源代码分析之Zookeeper.WatchRegistration
bit1129
zookeeper
Zookeeper类是Zookeeper提供给用户访问Zookeeper service的主要API,它包含了如下几个内部类
首先分析它的内部类,从WatchRegistration开始,为指定的znode path注册一个Watcher,
/**
* Register a watcher for a particular p
- 【Scala十三】Scala核心七:部分应用函数
bit1129
scala
何为部分应用函数?
Partially applied function: A function that’s used in an expression and that misses some of its arguments.For instance, if function f has type Int => Int => Int, then f and f(1) are p
- Tomcat Error listenerStart 终极大法
ronin47
tomcat
Tomcat报的错太含糊了,什么错都没报出来,只提示了Error listenerStart。为了调试,我们要获得更详细的日志。可以在WEB-INF/classes目录下新建一个文件叫logging.properties,内容如下
Java代码
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHa
- 不用加减符号实现加减法
BrokenDreams
实现
今天有群友发了一个问题,要求不用加减符号(包括负号)来实现加减法。
分析一下,先看最简单的情况,假设1+1,按二进制算的话结果是10,可以看到从右往左的第一位变为0,第二位由于进位变为1。
 
- 读《研磨设计模式》-代码笔记-状态模式-State
bylijinnan
java设计模式
声明: 本文只为方便我个人查阅和理解,详细的分析以及源代码请移步 原作者的博客http://chjavach.iteye.com/
/*
当一个对象的内在状态改变时允许改变其行为,这个对象看起来像是改变了其类
状态模式主要解决的是当控制一个对象状态的条件表达式过于复杂时的情况
把状态的判断逻辑转移到表示不同状态的一系列类中,可以把复杂的判断逻辑简化
如果在
- CUDA程序block和thread超出硬件允许值时的异常
cherishLC
CUDA
调用CUDA的核函数时指定block 和 thread大小,该大小可以是dim3类型的(三维数组),只用一维时可以是usigned int型的。
以下程序验证了当block或thread大小超出硬件允许值时会产生异常!!!GPU根本不会执行运算!!!
所以验证结果的正确性很重要!!!
在VS中创建CUDA项目会有一个模板,里面有更详细的状态验证。
以下程序在K5000GPU上跑的。
- 诡异的超长时间GC问题定位
chenchao051
jvmcmsGChbaseswap
HBase的GC策略采用PawNew+CMS, 这是大众化的配置,ParNew经常会出现停顿时间特别长的情况,有时候甚至长到令人发指的地步,例如请看如下日志:
2012-10-17T05:54:54.293+0800: 739594.224: [GC 739606.508: [ParNew: 996800K->110720K(996800K), 178.8826900 secs] 3700
- maven环境快速搭建
daizj
安装mavne环境配置
一 下载maven
安装maven之前,要先安装jdk及配置JAVA_HOME环境变量。这个安装和配置java环境不用多说。
maven下载地址:http://maven.apache.org/download.html,目前最新的是这个apache-maven-3.2.5-bin.zip,然后解压在任意位置,最好地址中不要带中文字符,这个做java 的都知道,地址中出现中文会出现很多
- PHP网站安全,避免PHP网站受到攻击的方法
dcj3sjt126com
PHP
对于PHP网站安全主要存在这样几种攻击方式:1、命令注入(Command Injection)2、eval注入(Eval Injection)3、客户端脚本攻击(Script Insertion)4、跨网站脚本攻击(Cross Site Scripting, XSS)5、SQL注入攻击(SQL injection)6、跨网站请求伪造攻击(Cross Site Request Forgerie
- yii中给CGridView设置默认的排序根据时间倒序的方法
dcj3sjt126com
GridView
public function searchWithRelated() {
$criteria = new CDbCriteria;
$criteria->together = true; //without th
- Java集合对象和数组对象的转换
dyy_gusi
java集合
在开发中,我们经常需要将集合对象(List,Set)转换为数组对象,或者将数组对象转换为集合对象。Java提供了相互转换的工具,但是我们使用的时候需要注意,不能乱用滥用。
1、数组对象转换为集合对象
最暴力的方式是new一个集合对象,然后遍历数组,依次将数组中的元素放入到新的集合中,但是这样做显然过
- nginx同一主机部署多个应用
geeksun
nginx
近日有一需求,需要在一台主机上用nginx部署2个php应用,分别是wordpress和wiki,探索了半天,终于部署好了,下面把过程记录下来。
1. 在nginx下创建vhosts目录,用以放置vhost文件。
mkdir vhosts
2. 修改nginx.conf的配置, 在http节点增加下面内容设置,用来包含vhosts里的配置文件
#
- ubuntu添加admin权限的用户账号
hongtoushizi
ubuntuuseradd
ubuntu创建账号的方式通常用到两种:useradd 和adduser . 本人尝试了useradd方法,步骤如下:
1:useradd
使用useradd时,如果后面不加任何参数的话,如:sudo useradd sysadm 创建出来的用户将是默认的三无用户:无home directory ,无密码,无系统shell。
顾应该如下操作:
- 第五章 常用Lua开发库2-JSON库、编码转换、字符串处理
jinnianshilongnian
nginxlua
JSON库
在进行数据传输时JSON格式目前应用广泛,因此从Lua对象与JSON字符串之间相互转换是一个非常常见的功能;目前Lua也有几个JSON库,本人用过cjson、dkjson。其中cjson的语法严格(比如unicode \u0020\u7eaf),要求符合规范否则会解析失败(如\u002),而dkjson相对宽松,当然也可以通过修改cjson的源码来完成
- Spring定时器配置的两种实现方式OpenSymphony Quartz和java Timer详解
yaerfeng1989
timerquartz定时器
原创整理不易,转载请注明出处:Spring定时器配置的两种实现方式OpenSymphony Quartz和java Timer详解
代码下载地址:http://www.zuidaima.com/share/1772648445103104.htm
有两种流行Spring定时器配置:Java的Timer类和OpenSymphony的Quartz。
1.Java Timer定时
首先继承jav
- Linux下df与du两个命令的差别?
pda158
linux
一、df显示文件系统的使用情况,与du比較,就是更全盘化。 最经常使用的就是 df -T,显示文件系统的使用情况并显示文件系统的类型。 举比例如以下: [root@localhost ~]# df -T Filesystem Type &n
- [转]SQLite的工具类 ---- 通过反射把Cursor封装到VO对象
ctfzh
VOandroidsqlite反射Cursor
在写DAO层时,觉得从Cursor里一个一个的取出字段值再装到VO(值对象)里太麻烦了,就写了一个工具类,用到了反射,可以把查询记录的值装到对应的VO里,也可以生成该VO的List。
使用时需要注意:
考虑到Android的性能问题,VO没有使用Setter和Getter,而是直接用public的属性。
表中的字段名需要和VO的属性名一样,要是不一样就得在查询的SQL中
- 该学习笔记用到的Employee表
vipbooks
oraclesql工作
这是我在学习Oracle是用到的Employee表,在该笔记中用到的就是这张表,大家可以用它来学习和练习。
drop table Employee;
-- 员工信息表
create table Employee(
-- 员工编号
EmpNo number(3) primary key,
-- 姓