首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏一个爱瞎折腾的程序猿

    通过脚本下载GO被墙或常用的相关包

    \src echo GOPATH:%workPath% if not exist %tempDir% md %tempDir% if not exist %tempDir%\grpc\ ( call git clone https://github.com/grpc/grpc-go %tempDir%\grpc call xcopy %tempDir%\grpc %workPath ://github.com/google/go-genproto.git %tempDir%\genproto call xcopy %tempDir%\genproto %workPath%\ /github.com/golang/net %tempDir%\net call xcopy %tempDir%\net %workPath%\golang.org\x\net /s /e / Q /Y /I ) if not exist %tempDir%\sys ( call git clone https://github.com/golang/sys %tempDir%\sys

    96910发布于 2018-09-14
  • 来自专栏方亮

    研发工程师玩转Kubernetes——启动、存活和就绪探针

    /ready; sleep 3;touch /tempdir/keepalive; while true; do sleep 5; done"] volumeMounts: - name: probe-volume mountPath: /tempdir startupProbe: exec: /keepalive': No such file or directory 可以看到Startup Probe在第4次检测时,/tempdir/ready文件还没创建。 Liveness Probe在第2次检测时,/tempdir/keepalive还没创建。到第三次检测时,这个标志文件就创建了。于是整个Pod进入了Running状态。 /ready; sleep 3;touch /tempdir/readiness; while true; do sleep 5; done"] volumeMounts:

    1.9K42编辑于 2023-08-15
  • 来自专栏方亮

    研发工程师玩转Kubernetes——emptyDir

    同一Pod上不同容器之间共享 # bash if [ -f /tempdir/lockfile ] && ! { set -C; 2>/dev/null >/tempdir/lockfile; }; then tail -f /tempdir/lockfile else exec 3>/tempdir { set -C; 2>/dev/null >/tempdir/lockfile; }; then tail -f /tempdir/lockfile; else exec 3>/tempdir/lockfile { set -C; 2>/dev/null >/tempdir/lockfile; }; then tail -f /tempdir/lockfile; else exec 3>/tempdir/lockfile { set -C; 2>/dev/null >/tempdir/lockfile; }; then tail -f /tempdir/lockfile; else exec 3>/tempdir/lockfile

    37620编辑于 2023-08-09
  • 来自专栏方亮

    研发工程师玩转Kubernetes——使用local型PV在不同Pod上共享数据

    { set -C; 2>/dev/null >/tempdir/lockfile; }; then tail -f /tempdir/lockfile; else exec 3>/tempdir/lockfile root 2.4K Aug 9 10:25 /tempdir/lockfile -rw-r–r-- 1 root root 9.8K Aug 9 10:26 /tempdir/lockfile - rw-r–r-- 1 root root 10.0K Aug 9 10:26 /tempdir/lockfile -rw-r–r-- 1 root root 10.1K Aug 9 10:26 /tempdir 9 10:49 /tempdir/lockfile -rw-r–r-- 1 root root 100.1K Aug 9 10:49 /tempdir/lockfile -rw-r–r-- 1 root root 593.4K Aug 9 12:51 /tempdir/lockfile

    52340编辑于 2023-08-10
  • 来自专栏我的技术专刊

    Flutte 缓存清除

    /// 获取缓存大小 static Future<int> total() async { Directory tempDir = await getTemporaryDirectory(); if (tempDir == null) return 0; int total = await _reduce(tempDir); return total; } 递归计算缓存目录: /// = await getTemporaryDirectory(); if (tempDir == null) return; await _delete(tempDir); } 递归清除缓存目录 = await getTemporaryDirectory(); if (tempDir == null) return 0; int total = await _reduce(tempDir getTemporaryDirectory(); if (tempDir == null) return; await _delete(tempDir); } /// 递归缓存目录

    6.4K10编辑于 2021-12-15
  • 来自专栏IT民工的代码世界

    SpringBoot访问jar包静态文件

    "; try { String templateFilePath = "tempfiles/classpathfile/"; File tempDir tempDir.exists()) { tempDir.mkdirs(); } String[] filePathList inputStream, file); }else{ //目录 tempDir tempDir.exists()) { tempDir.mkdirs(); } args) throws Exception { String templateFilePath = "tempfiles/classpathfile/"; File tempDir

    62230编辑于 2023-07-19
  • 来自专栏IT民工的代码世界

    SpringBoot使用spring.factories加载默认配置

    "; try { String templateFilePath = "tempfiles/classpathfile/"; File tempDir tempDir.exists()) { tempDir.mkdirs(); } String[] filePathList file); } } else { //目录 tempDir tempDir.exists()) { tempDir.mkdirs(); } }

    23710编辑于 2024-06-24
  • 来自专栏菩提树下的杨过

    jetty 9 嵌入式开发示例

    private Server server; 19 private int port; 20 private String host; 21 private String tempDir private String contextPath; 25 26 27 public JettyWebServer(int port, String host, String tempDir , String webDir, String logDir, String contextPath) { 28 29 logger.info("port:{},host:{},tempDir :{},webDir:{},logDir:{},contextPath:{}", port, host, tempDir, webDir, logDir, contextPath); 30 31 this.port = port; 32 this.host = host; 33 this.tempDir = tempDir; 34 this.webDir

    1.7K100发布于 2018-01-18
  • 来自专栏方亮

    研发工程师玩转Kubernetes——就绪探针(Readiness Probe)和服务(Service)

    nginx ports: - containerPort: 80 command: ["/bin/sh", "-c", "sleep 3; touch /tempdir true; do sleep 5; done"] volumeMounts: - name: probe-volume mountPath: /tempdir readinessProbe: exec: command: - cat - /tempdir 80/TCP Host Port: 0/TCP Command: /bin/sh -c sleep 3; touch /tempdir ] delay=2s timeout=1s period=1s #success=1 #failure=6 Environment: <none> Mounts: /tempdir

    71030编辑于 2023-08-15
  • 来自专栏waki

    easyswoole的核心文件

    = Config::getInstance()->getConf('TEMP_DIR'); if(empty($tempDir)){ $tempDir = EASYSWOOLE_ROOT /Temp'; Config::getInstance()->setConf('TEMP_DIR',$tempDir); }else{ $ tempDir = rtrim($tempDir,'/'); } if(! is_dir($tempDir)){ File::createDirectory($tempDir); } defined('EASYSWOOLE_TEMP_DIR ') or define('EASYSWOOLE_TEMP_DIR',$tempDir); $logDir = Config::getInstance()->getConf('LOG_DIR

    72920编辑于 2021-12-08
  • 来自专栏方亮

    研发工程师玩转Kubernetes——hostPath

    - name: hostpath-container image: busybox command: ["/bin/sh", "-c" ,"if [ -f /tempdir { set -C; 2>/dev/null >/tempdir/lockfile; }; then tail -f /tempdir/lockfile; else exec 3>/tempdir/lockfile &3; sleep 5; done; fi"] volumeMounts: - name: hostpath-volume mountPath: /tempdir Directory 我们观察创建的两个Pod中文件的内容 kubectl exec pods/hostpath-deployment-65cddc7df8-9qtlv -it -- tail -f /tempdir something to lockfile …… kubectl exec pods/hostpath-deployment-65cddc7df8-ltbgs -it -- tail -f /tempdir

    32020编辑于 2023-08-09
  • 来自专栏方亮

    研发工程师玩转Kubernetes——PVC通过storageClassName进行延迟绑定

    { set -C; 2>/dev/null >/tempdir/lockfile; }; then tail -f /tempdir/lockfile; else exec 3>/tempdir/lockfile sleep 1; done; fi"] volumeMounts: - name: local-pvc-volume mountPath: /tempdir { set -C; 2>/dev/null >/tempdir/lockfile; }; then tail -f /tempdir/lockfile; else exec 3>/tempdir/lockfile { set -C; 2>/dev/null >/tempdir/lockfile; }; then tail -f /tempdir/lockfile; else exec 3>/tempdir/lockfile { set -C; 2>/dev/null >/tempdir/lockfile; }; then tail -f /tempdir/lockfile; else exec 3>/tempdir/lockfile

    95540编辑于 2023-08-11
  • 来自专栏网络安全技术点滴分享

    APKURLGrep自动化提取安卓apk URL工具分析

    主控制模块(main.go) apktool.RunApktool(baseApk, tempDir) //反编译 extractor.Extract(tempDir) //url提取 2. 反编译模块(apktool.go) //使用系统命令执行apktool func RunApktool(apk string, tempDir string) string { cmd := exec.Command ("apktool","d", apk, "-o", tempDir, "-fq") output, err := cmd.CombinedOutput() if err !

    59810编辑于 2025-06-16
  • 来自专栏Panda诚

    JettyServer.java 源码解读

    = new File(props.getWebWorkingDirectory(), warFile.getName()); if (tempDir.exists() && ! tempDir.isDirectory()) { throw new RuntimeException(tempDir.getAbsolutePath() + " is not tempDir.exists()) { final boolean made = tempDir.mkdirs(); if (! made) { throw new RuntimeException(tempDir.getAbsolutePath() + " could not be created (tempDir.canRead() && tempDir.canWrite())) { throw new RuntimeException(tempDir.getAbsolutePath

    65710发布于 2020-09-01
  • 来自专栏Cyylog技术

    Docker_001

    for # let's build binaries from the published packaging sources set -x \ && tempDir ="$(mktemp -d)" \ && chown nobody:nobody $tempDir \ && apk add --no-cache --virtual && abuild-sign -k ${tempDir}/.abuild/abuild-key.rsa ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz && apk del .build-deps \ && apk add -X ${tempDir}/packages/alpine/ --no-cache $nginxPackages " ]; then rm -rf "$tempDir"; fi \ && if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc

    60530发布于 2020-08-19
  • 来自专栏万少的技术分享

    HarmonyOS Next 实战卡片开发 02

    = getContext(this).getApplicationContext().tempDir; // 生成一个新的文件名 const fileName = 123 + '.png ' // 通过缓存路径+文件名 拼接出完整的路径 const copyFilePath = tempDir + '/' + fileName // 将文件 拷贝到 临时目录 = this.context.getApplicationContext().tempDir; let imgMap: Record<string, number> = {}; // 打开本地图片并获取其打开后的fd let file = fileIo.openSync(tempDir + '/' + '123.png'); imgMap['imgBear'] = file.fd ().tempDir; let fileName = 'file' + Date.now(); let tmpFile = tempDir + '/' + fileName

    25200编辑于 2025-02-10
  • 来自专栏方球

    golang ioutil io工具

    = nil { fmt.Println(err) } 临时文件 TempDir 创建临时目录 func TempDir(dir, prefix string) (name string , err error) path, _ := ioutil.TempDir("./", "temp_dir") // 关闭后,移除临时文件夹 defer func()

    79920发布于 2019-08-23
  • 来自专栏后端开发随笔

    Spring Boot应用上传文件时报错

    实际上,追踪一下源码会发现,如果不明确设置Tomcat的文件上传临时目录,默认读取的是Servlet上下文对象的属性“javax.servlet.context.tempdir”值,如下源码: org.apache.catalina.connector.Request location = (new File((File)context.getServletContext().getAttribute("javax.servlet.context.tempdir getAbsoluteFile(); } } else { // 如果location属性值为空,则读取Servlet上下文对象的属性“javax.servlet.context.tempdir localhost/ROOT) location = (File)context.getServletContext().getAttribute("javax.servlet.context.tempdir

    2.1K20发布于 2019-09-29
  • 来自专栏信安百科

    关于CVE-2022-35650的分析

    $this->tempdir = make_temp_directory('bbquiz_import/' . copy($filename, $this->tempdir . '/bboard.zip', $this->tempdir)) { $dom = new DomDocument(); if (! $dom->load($this->tempdir . error(get_string('errormanifest', 'qformat_blackboard_six')); fulldelete($this->tempdir

    86630编辑于 2023-10-02
  • 来自专栏spring boot

    SpringBoot中大量数据导出方案:使用EasyExcel并行导出多个excel文件并压缩zip后下载

    )); // 略...校验数据 InputStream zipFileInputStream = null; Path tempZipFilePath = null; Path tempDir templateInputStream, outputStream); // 创建临时excel文件导出目录,用于将多个excel导出到此目录下 Path tmpDirRef = (tempDir req.userCode() + TMP_ZIP_DIR_PRE, ".zip"); // 将excel目录下的所有文件压缩到zip文件中,zipUtil有很多工具包都有 ZipUtil.zip(tempDir.toString zipFileInputStream.close(); } // 删除临时文件及目录 if (Objects.nonNull(tempDir )) { Files.walkFileTree(tempDir, new SimpleFileVisitor<Path>() { @Override

    2.1K10编辑于 2024-10-15
领券