gitlab备份还原
你所不理解的东西是你无法占有的。——歌德 首先进入Gitlab所在Docker容器 1docker exec -it <gitlab-container-name> /bin/bash 执行: 1gitlab-backup create 然后退出容器、拷贝 1docker cp <gitlab-container-name>:/var/opt/gitlab/backups /path/to/host/machine 还原的命令也很简单: 先停止 12gitlab-ctl stop unicorngitlab-ctl stop sidekiq 再还原 1gitlab-backup restore BACKUP=timestamp_of_backup 例如 1gitlab-backup restore BACKUP=1549251062_2019_02_04_11.8.1 然后重启即可 12gitlab-ctl reconfiguregitlab-ctl restart
对接声网rtc-restful-api
没有求知欲的学生,就像没有翅膀的鸟。——萨迪 代码如下: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131package com.example.agora.api.webclient;import com.alibaba.nacos.common.utils.JacksonUtils;import com.fasterxml.jackson.core.type.TypeReference;import com.example.agora.api.constant...
webclient在delete请求时携带request body
君子坦荡荡,小人长戚戚。——孔子 今天分享一个场景: 在对接声网rtc时,遇到一个请求,需要在delete请求中携带request body 所使用的请求框架是webflux的webclient 如果我们正常使用delete方法来构建请求,是无法通过bodyValue传入body的 但是这里我们可以直接使用: 123456789101112/** * 封禁用户权限-更新规则 * <a href="https://docportal.shengwang.cn/cn/All/rtc_channel_management_restfulapi?platform=Android#%E6%9B%B4%E6%96%B0%E8%A7%84%E5%88%99"> */public Mono<RtcAddDelKickRuleRes> delRtcKickRule(RtcDelKickRuleDTO dto) { dto.setAppId(appId); return webClient.method(HttpMethod.D...
emberjs
合抱之木,生于毫末;九层之台,起于累土;千里之行,始于足下。——老子 分享一个js框架 https://emberjs.com/ Ember.js 是一个高效的、经过实战考验的 JavaScript 框架,用于构建现代 Web 应用程序。它包括构建可在任何设备上运行的丰富 UI 所需的一切。 它的语法: 123456789import Route from '@ember/routing/route';export default class IndexRoute extends Route { async model() { return { title: 'Grand Old Mansion' }; }} 对应的页面 1<h1>{{@model.title}}</h1> 使用的是.hbs后缀的模板文件,语法和vue有些异曲同工之妙,是一个很值得学习的库 其emberjs约定大于配...
webclient模板变量
过于重视行为规则、拘泥形式,往往在事业上错失良机。——培根 今天分享在使用webclient进行开发时的的一个小技巧 例如这个方法: 1org.springframework.web.reactive.function.client.DefaultWebClient.DefaultRequestBodyUriSpec#uri(java.lang.String, java.lang.Object...) 此处如果直接使用: 1webClient.get().uri("/dev/v1/kicking-rule?appid={}", appId) 或者 1webClient.get().uri("/dev/v1/kicking-rule?appid=%s", appId) 哪怕 1webClient.get().uri("/dev/v1/kicking-rule?appid=%s", appId) 都是不行的。。。 正确的方式应该是: 1webClient.get().uri("/de...
webflux中操作符调试
生命不息,奋斗不止。——卡莱尔 分享一个小技巧,在webflux开发中,我们可以在主启动类上加这么一行代码: 1Hooks.onOperatorDebug(); 这行代码的用处是注册一个回调函数,可以打印操作符信息,举个例子: 12345678910111213141516import reactor.core.publisher.Flux;import reactor.core.publisher.Hooks;public class DebugExample { public static void main(String[] args) { Hooks.onOperatorDebug(); // 启用操作符调试 Flux<Integer> flux = Flux.just(1, 2, 3, 4) .map(i -> i / 0); // 这里会触发除以零的异常 flux.subscribe( value -> Syst...
hutool修复CollectorUtil.reduceListMap与Collectors.groupby一起使用时出现与预期不符的结果
待小人宜宽,防小人宜严。——金瑛 问题的issue: https://github.com/dromara/hutool/issues/3380 此处复现: 12345678910111213141516171819 List<Map<String, String>> data = ListUtil.toList( MapUtil.builder("name", "sam").put("count", "80").map(), MapUtil.builder("name", "sam").put("count", "81").map(), MapUtil.builder("name", "sam").put("count", "82").map(), MapUtil.builder("name&q...
sshx
谗言巧,佞言甘,忠言直,信言寡。——林逋 今天分享一个ssh的开源项目: https://github.com/ekzhang/sshx 这个sshx是基于web的ssh终端,我们打开它的网址: https://sshx.io/ 执行: 12curl -sSf https://sshx.io/get | shsshx 效果: 此处打开这个网址,新建一个会话 效果还不错
minio预签名上传前端axios注意事项
不论替人家做了多少好事,不论多么忠心耿耿,看起来,绝不能指望人家感谢你。——托尔斯泰 之前说过了camel+minio实现预签名URL上传 但当时提供的也是后端代码,现在需要前端axios的 axios文档:Axios API | Axios Docs 123456789101112axios({ method: 'PUT', url, headers: { "Content-Type": "application/octet-stream", }, data: new Blob([file]), responseType: "blob"}).then((res) => { console.log({ res })}).catch(console.error) 这里的file就是前端的File对象,我们此处是将其转换为Blob,然后再通过data参数发送,...
spring-state-machine守卫踩坑
真正的艺术家绝不顾虑作品的前途。——罗曼·罗兰 今天发现一个问题,如果我们是动态构建状态机,在传入指定守卫为null时,代码不会报错,且事件不会过渡到下一个状态 解决方式: 1234567builder.configureTransitions().withExternal() .name(transition.getName()) .source(transition.getSourceState()) .event(transition.getEvent()) .target(transition.getTargetState()) .action(Opp.of(transition.getAction()).orElse(SerCons.nothing()::accept)) .guard(Opp.of(transition.getGuard()).orElseGet(() -> c -> true)) 提供默认值 引入的是import org.dromara.streamquery....
