Linux

Windows .crl to .pem for nginx

风格不统一 提交于 2021-02-19 01:51:43
问题 I have windows .crl file. Can I convert it into a .pem file to nginx using openssl? openssl crl -in crl.crl -noout -text unable to load CRL 139765490861728:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: X509 CRL 回答1: The error means that your crl file is not encoded properly in PEM format with right header and footer. Have the right PEM encoded crl file. If the CRL is in DER format: openssl crl -in your_current.crl -inform DER -out crl.pem Now you can use crl

[GIT实践]git实践系列之-- refs/for/branch和refs/head/branch

◇◆丶佛笑我妖孽 提交于 2021-02-19 01:47:43
本文作者:francisk84 git的诞生历史 -- 摘选自《Pro git》 Linux 内核开源项目有着为数众多的参与者。 绝大多数的 Linux 内核维护工作都花在了提交补丁和保存归档的繁琐事务上(1991-2002年间)。 到 2002 年,整个项目组开始启用一个专有的分布式版本控制系统 BitKeeper 来管理和维护代码。 到了 2005 年,开发 BitKeeper 的商业公司同 Linux 内核开源社区的合作关系结束,他们收回了 Linux 内核社区免费使用 BitKeeper 的权力。 这就迫使 Linux 开源社区(特别是 Linux 的缔造者 Linus Torvalds)基于使用 BitKeeper 时的经验教训,开发出自己的版本系统。 他们对新的系统制订了若干目标: 1. 速度 2. 简单的设计 3. 对非线性开发模式的强力支持(允许成千上万个并行开发的分支) 4. 完全分布式 5. 有能力高效管理类似 Linux 内核一样的超大规模项目(速度和数据量) git push时的refs/for/[branch_name]和refs/head/[branch_name] 谈到git push时的refs/for/[branch_name]指令,其实它是 Gerrit 工具的一种机制。简单的说,Gerrit为了保证每次代码提交都强制开启代码评审

洋哥!我要进大厂!

China☆狼群 提交于 2021-02-19 01:43:13
阅读本文大概需要4分钟。 最近不少读者咨询洋哥如何进大厂,回答的多了就想着要不整理出一个系列文章出来。 说干就干,第一期先写写应届毕业和刚工作不久的计算机专业的童鞋如何进大厂。 先说说必须要做到的几件事: 第一,学校内的课程,计算机基础知识,如C语言,数据结构,计算机组成原理,计算机网络,计算机操作系统等这些基础专业知识一定要理解掌握,在校招中,这些内容必考。 第二,提升自己写代码的能力。不会配置环境,不会框架,就去找资料自学,B站,慕课很多免费视频课程。 第三,做项目。这里不是指学校做的项目,而是真正可以部署上线的项目。你可以去GitHub上找,也可以从学长学姐或者老师看是否有合适的项目,或者找一些大厂实习岗位。 第四,疯狂刷算法题。leetcode上的题目很多都可能在校招中被拿来当面试题,《剑指Offer》也挺不错,leetcode最起码刷个200,300道,然后把《剑指Offer》背一遍,基本没大问题了。 以上基础,如果读书期间没有打牢固,工作后也必须想办法拼命学习。 再说说我应届毕业加入腾讯的学习路线吧: 首先攻克C语言,这个没什么,谭浩强的《C语言程序设计》反复看,然后一行行在电脑上敲出来。 当时对计算机缺乏系统认识,最难理解的就是指针,书上说它是个变量地址,那么问题来了,什么是地址?一不小心,指针就让程序Crash了。直到读研的时候,看了大学教材:《计算机组成原理

OS X alternative to eventfd

孤街浪徒 提交于 2021-02-19 01:42:29
问题 eventfd is Linux-specific. I need to port a library written on Linux which makes use of this event notification system to OS X. Is there a way to accomplish this? 回答1: Two options are a pipe and kqueue 's EVFILT_USER . It depends on how exactly eventfd is being used. 来源: https://stackoverflow.com/questions/26603615/os-x-alternative-to-eventfd

What is the purpose and result of using INADDR_ANY?

无人久伴 提交于 2021-02-19 01:26:10
问题 In Python when we want to make a script that listens for multicast traffic we set the IP_ADD_MEMBERSHIP option of the socket with a value that consists of the multicast group address and the address of a local interface on which it will listen for the group's traffic. Many examples on the Internet pass to IP_ADD_MEMBERSHIP the INADDR_ANY wildcard address as the local interface, and some of them state that this will make the socket to listen on all interfaces for multicast packets. However the

Linux C how to open a directory and get a file descriptor

爷,独闯天下 提交于 2021-02-19 00:50:32
问题 #include <stdio.h> #include <string.h> #include <errno.h> #include <fcntl.h> int main() { int fd; if ((fd = open("/home/zhangke", O_DIRECTORY | O_RDWR)) ==-1) { printf("error %s\n", strerror(errno)); return -1; } return 0; } /home/zhangke is a directory and it exists . I get error Is a directory , so, how can I use open() to get a fd of a directory correctly? 回答1: Use O_RDONLY instead of O_RDWR as the access mode. From the open(2) error list: EISDIR pathname refers to a directory and the

Program configuration data in Unix/Linux

守給你的承諾、 提交于 2021-02-18 22:38:35
问题 What is recommended way to keep a user configuration data in Unix/Linux? My programming language is C++. Configuration data will be kept in XML/text/binary format, I have no problem with handling such files. I want to know where can I keep them. For example, in the Windows OS configuration data may be kept in the Registry (old way) or in user application data directory. What about Linux? I need read/write access to configuration files. 回答1: The concept of the registry is peculiar to Windows,

How does “get_user_pages” work (For linux driver)

落爺英雄遲暮 提交于 2021-02-18 22:37:28
问题 Working on a Linux PCI driver, now I'm trying to write codes for DMA using scatter/gather. For now, I've learned that to access to DMA datas directly from User space, we need to pin user space pages to kernel space. And to do this, we have get_user_pages , its full definition is like: int get_user_pages(struct task_struct * tsk, struct mm_struct * mm, unsigned long start, int nr_pages, int write, int force, struct page ** pages, struct vm_area_struct ** vmas); My first question is about the

Program configuration data in Unix/Linux

烈酒焚心 提交于 2021-02-18 22:37:06
问题 What is recommended way to keep a user configuration data in Unix/Linux? My programming language is C++. Configuration data will be kept in XML/text/binary format, I have no problem with handling such files. I want to know where can I keep them. For example, in the Windows OS configuration data may be kept in the Registry (old way) or in user application data directory. What about Linux? I need read/write access to configuration files. 回答1: The concept of the registry is peculiar to Windows,

How to build a swift executable for Linux on macOS

混江龙づ霸主 提交于 2021-02-18 22:28:08
问题 I am trying to build a swift executable on my MacBook for my Linux vServer. I already tried using swiftc -target "x86_64-linux test.swift , but my macOS swift compiler shows this error: <unknown>:0: error: unable to load standard library for target 'x86_64--linux' So I looked around and found this question: Swift on OS X compiling for Linux? and tried out this example script from apple to setup a cross-platform toolchain. After trying to build a module like shown in the example text of the