Wednesday, June 30, 2021

Recent Questions - English Language & Usage Stack Exchange

Recent Questions - English Language & Usage Stack Exchange


What does create outside of them means [closed]

Posted: 30 Jun 2021 11:38 AM PDT

I have heard people use or read this sentence : I tend to create outside of them.
I checked online that it's a grammatically perfect sentence. But I couldn't find
what does it mean

Alternative ways of saying "white-labeled"?

Posted: 30 Jun 2021 12:27 PM PDT

In software engineering, there has been a movement towards ensuring that language is more inclusive and culturally sensitive.

For example, I've been in companies that now use the word "main" instead of "master" branch, and allow-list/block-list instead of "white-list"/"black-list".

Are there synonyms for the concept of "white-labeling"?

A compound word or phrase would be acceptable. What's important to me is that people will understand what I mean. I'd like to be able to omit the explanatory line below in parentheses.

Example sentence:

"If I could go back and engineer that project again, I'd consider building it in a white-labeled way. (Instead of everything being designed just for myself, the system would also support additional customers.)"

My understanding of "private label" is more like when a grocery store wants to profit from branding a certain product but would prefer to buy and re-label and existing product. With "private label", it seems like there is a 1-to-1 relationship between product and new label. This doesn't quite fit my feeling of how I've heard "white-labeled", which implies more like "the core product is already built, and it can serve unlimited companies who each can pay to attach their logo to it."

Why do OED and ODO differ on the plural of “zero”? [closed]

Posted: 30 Jun 2021 10:51 AM PDT

Continuing What is the plural form of "zero"? , OED says

Plural zeroes

and examples of both endings follow.

Lexico (formerly Oxford Dictionaries Online) has

Cardinal number (zeros).

My question is not about what the correct™ plural is. My question is why the Oxfordians themselves could not agree on the plural.

Does "anything" typically include people? [closed]

Posted: 30 Jun 2021 10:30 AM PDT

I'm stuck trying to figure out if my usage of "anything" is consistent/common/correct. There are three related words to consider:

  1. Thing - (Almost?) Never refers to a person (rarely refers to anything that's alive, but as this parenthetical demonstrates before the first comma, it does happen)
  2. Everything - Used in an unrestricted sense (e.g. life, the universe, and everything), includes both people, all living things, along with all other things in the universe
  3. Anything - I think uses without clarifying context can include people, but I'm not sure.

For example, I'll tell my children "I love you more than anything (else) in the whole wide world." I don't say "anyone" because I want the statement to include both people and stuff (what if they think I love pizza more than them?), and to me, "anything" fits the bill (without requiring the tedious "anyone and anything"), and unless context specifically limits it.

So my question is: Does "anything", when not limited by context clues, cover people the way "everything" does? Or does it exclude people, the way "thing" does? Online dictionaries are being frustratingly vague on this specific topic.

My idea is ignored when I say it, but listened to when someone repeats it

Posted: 30 Jun 2021 10:36 AM PDT

Is there a word or phrase to describe the situation when one person makes a comment or suggestion in a meeting and is ignored, but a few minutes later someone else makes essentially the same comment or suggestion and is listened to?

What does "which" refer to if there are two subjects? [duplicate]

Posted: 30 Jun 2021 06:35 AM PDT

  1. Alaska is one of the states of America which is located on the border side.
  1. Alaska is one of the states of America which is a superpower country.

In the first sentence "which" refers to Alaska.

In the second sentence "which" refers to America.

Which sentence is wrong?

What is another word for "historical figure"? [closed]

Posted: 30 Jun 2021 05:56 AM PDT

What is another word for "historical figure"? I'm looking for a word for someone from history that was significant? (e.g. Abraham Lincoln)

What's the difference between envy and resent? [closed]

Posted: 30 Jun 2021 03:55 AM PDT

What's the difference between envy and resent?

envy

painful or resentful awareness of an advantage enjoyed by another joined with a desire to possess the same advantage

Envy is the feeling you have when you wish you could have the same thing or quality that someone else has.

If you envy someone, you wish that you had the same things or qualities that they have.

resent

If you resent someone or something, you feel bitter and angry about them. [source]

to feel bitter or angry about something, especially because you feel it is unfair [source]


However the word resent is used as a comparative emotion as this article says. It is often used interchangeably with the word envy, so maybe there is a modern meaning in our current lexicon that the dictionary fails to explain, where they can both used in the same place.

Are mid-sentence exclamations archaic? [duplicate]

Posted: 30 Jun 2021 03:30 AM PDT

I've found when reading older literature written by Poe, Tolkien or Dickens that quite often in dialogue and description there will be an exclamation mid-sentence with the sentence continuing afterwards. For example:

Light grew, and lo! the Company passed through another gateway (...) (Lord of the Rings: RotK)

Also common in these books is alas! being mid sentence, with Dickens I recall there being a thank God! as well. Are these kinds of exclamations still used in modern writing or would they be considered archaic?

Is 'dummy object' allowed for English? [closed]

Posted: 30 Jun 2021 03:29 AM PDT

The sentence I have hard time to write is following.

Why should I use 'Move' feature of 'Settings-App' to move program rather than just cut and paste folder for program?

I thought

'Move' feature of 'Settings-App'

This is too verbose and what come to my mind was the notion of 'dummy subject'.

So, I try to write it as following way.

Why should I use it to move program that 'Move' feature of 'Settings-App' rather than just cut and paste program folder?

However, I have not idea about this is the proper or allowed way to use dummy 'it'. I've searched for 'dummy subject' and 'dummy pronoun', but still have any confidence about it.

Is it proper way to use 'it' as dummy like this? If not, what is the best practice for placing verbose object at the back of sentence?

Term/phrase to describe a word that develops divergent (often context-specific) meanings [duplicate]

Posted: 30 Jun 2021 05:24 AM PDT

There are certain cases where a single word takes on more than one meaning. This is ostensibly the same word and, superficially, it often seems to have a single definition (it certainly started with only one). However, for some reason or another, these words evolved to mean somewhat different things in different contexts (such as in different fields and/or communities).

Basically, these words exhibit

  • A single original meaning that (over time) diverges into several
  • A relatively clear meaning within a specific context
  • Different meanings in different contexts, which may be obscured by superficial similarity

A common example of this is "data scientist". If you ask people in different in different, you will get surprisingly different expectations of what a data scientist is. Some define them as experts in machine learning. Others consider them to be closer to data analysts or statisticians. Still others focus on domain knowledge and insights/storytelling through data. Often these communities aren't really aware that the others mean something similar but rather different.

You might say that "data science is an ambiguous word". While this description isn't wrong, it doesn't really capture the first two points very well. These kinds of words began as a single concept and evolved to express separate but clear (at least in isolation) to different groups of people.

You could arguably call it "jargon", since it tends to be associated with a field or professional group. The key difference is that jargon tends to have a single specific definition. I'd imagine these words are often "buzzwords", since that would encourage wide and inconsistent use, but I wouldn't say that is an essential component.

I hope I was able to convey the idea clearly. Honestly, I found it surprisingly hard to describe given the slippery nature of these words.

While/When + past continuous [closed]

Posted: 30 Jun 2021 02:08 AM PDT

I am curious about what you think about these sentences. Are they both acceptable? I mean using 'while or when' has a slightly different meaning, doesn't it? 1 I liked English when I was studying at school 2 I liked English while I was studying at school. My comment on them is that the other one suggests more strongly that I no longer like English; it expresses more clearly the concept of the duration of two things happening at the same time.

When searching for the origin of "bootlegger" has anyone considered foreign origin? Namely the low German/Saxon/Norwegian "utlegger"

Posted: 30 Jun 2021 01:34 AM PDT

As boots are hardly satisfactory to transport alcohol, the explanations based around boots or legs seem doubtful. Immigrants from northern European coastal areas would be familiar with both smuggling and alcohol so applying the word for outrigger (used colloquially for smugglers in their common unwritten language) doesn´t seem far fetched. When spoken only the "b" is missing which might have been added by nonspeakers of low German/Saxon/Norse.

I´m not a native speaker of english, please excuse my mistakes.

Why isn't "compulse" a word?

Posted: 30 Jun 2021 02:15 AM PDT

Given the words impel, impulsive, impulse, compel, and compulsive, why isn't compulse a word?

You could argue compulsion is the noun form of compel and thus is analogous to impulse, but impel already has the noun form of impulsion (though it may not be widely used).

Looking for a word that means to open an opportunity for something bad to happen

Posted: 30 Jun 2021 12:16 AM PDT

For example: "Doing many things at the same time oggies an oggy for hazards"

What's oggy?

I could say opens an opportunity for... But open an opportunity is usually used in a positive context. Also "opens the door for...", usually for good things. What's similar but has a negative connotation, meaning when used it implies something bad would happen.

in what kind of everyday situation should i use huff, puff, gasp and pant? [closed]

Posted: 30 Jun 2021 08:24 AM PDT

The Cambridge dictionary defines the words huff, puff, gasp and pant respectively as following:

  • to breathe loudly, esp. after physical exercise.
  • to breathe fast and with difficulty, usually because you have been exercising.
  • to breathe loudly and with difficulty, trying to get more air.
  • to breathe quickly and loudly through your mouth, usually because you have been doing something very energetic.

and the idioms "huff and puff" and "puff and pant" respectively as following:

  • to breathe loudly, usually after physical exercise.
  • to breathe fast and with difficulty, usually because you have been exercising.

There's a clear difference between these 4 words, but... IMHO it's a bit unnecessary to have 4 words with such a close meaning, so I want to know whether or not native speakers use these 4 words interchangeably, and if not, in what kind of everyday situation should I use each one of them?

I also want to know the difference (if any) between:

  • "huff and puff" and huff.
  • "puff and pant" and puff.

With whom in a sentence [closed]

Posted: 30 Jun 2021 11:52 AM PDT

"Can you print out a newer version of my certificate and hand it over to someone with whom I'm acquainted?"

Better expression than chauvinist for male dominant attitude

Posted: 30 Jun 2021 04:29 AM PDT

I'm getting a hard time to find an appropriate word on English with similar meaning to the portuguese word "machismo".

In portuguese this word means a conservative pro-male attitude, like an attitude that reinforces patriarchy and male dominance.

Example: a man that sees woman as inferior to man and should only be an house keeper and don't get a job. Or a man that uses and objectifies women.

Now every translation I've seen uses either chauvinism or sexism for this. I don't see neither as appropriate because chauvinism is more related with fanatic nationalism and sexism AFAIU can be from both sexes.

Can anyone think of a better way to express this idea of male dominant attitude?

Adjective capitalization of fictional species and nationalities

Posted: 30 Jun 2021 06:41 AM PDT

There exist a fictional nation called Elf Nation. (not a creative name but this is for a grammar experiment)

The species which inhabit this nation are called elf(singular) and elves (plural).

Would the nationality of this nation be capitalized?

For example, in the real world, we would refer to a citizen of a nation as: American citizen or British citizen or Russian citizen and so on. We would capitalize the nationality and not the profession. More examples: Japanese writer, Chinese professor.

What if the adjective of our nation's citizens is the same as the species name. Would we capitalize the adjective then? Example from the real world: human astronaut, not Human astronaut

So, would we refer to a general of this fictional nation Elf Nation as: elf general or Elf general?

Also, would it be elf culture or Elf culture, seeing that we use human culture and not Human culture?

I know you could just make up a separate adjective in this case and a separate adjective already exists for this species. My question is mostly about if and when can you mix nationality and species if they are fundamentally the same.

Using the indefinite article before "rain"

Posted: 30 Jun 2021 07:18 AM PDT

I have recently learned the use of the indefinite article before uncountable nouns to talk about an unspecific instance. Can I use "a heavy rain" in the following sentence to communicate that I am talking about an instance of heavy rain (a heavy downpour)?

The water level in the lake is much higher after a heavy rain.

Why did the writer use "him", instead of "himself"? [closed]

Posted: 30 Jun 2021 09:55 AM PDT

On a visit one evening to Nathaniel Hawthorne and his wife, Herman Melville, MobyDick author, told them a story of a fight he had witnessed on an island in the South Seas, in which one of the Polynesian warriors had wreaked havoc among his foes with a heavy club. Striding about the room, Melville demonstrated the feats of bravery and the desperate drama of the battle. After he had gone, Mrs. Hawthorne thought she remembered that he had left empty-handed, and wondered, "Where is that club with which Mr. Melville was laying about him so?" Mr. Hawthorne maintained that he must have taken it with him, and indeed a search of the room revealed nothing. The next time they saw him, they asked him what had happened to the club. It turned out that there was no club; it had simply been a figment of their imagination, conjured up by the vividness of Melville's narrative.

Question: Why did the writer use "him", instead of "himself"?

What's it called when a company owns products or services that strictly limit consumers to that company's products or services?

Posted: 30 Jun 2021 12:01 AM PDT

What's it called when a company owns products or services that strictly limit consumers to that company's products or services? For example, a camera only saves images in a format readable by a product of the camera manufacturer.

The word or expression I'm looking for would be used like this:

The way this company imposes such a restriction on its customers is called __________.

Can a comma be used before 'and' here? [closed]

Posted: 30 Jun 2021 10:18 AM PDT

Is it appropriate to use a comma in these examples?

We, however, discussed ways of improving the school's standard so as to increase the admission rate of students this year, and scheduled the next meeting to be on Tuesday for proper arrangements.

He never looked for trouble (although he had a bag full of trouble for trouble-seekers), and had a high sense of humor, which made the few people who did not like him become his admirers.

I know that a comma can only be used before a coordinating conjunction if it connects two independent clauses. But this is not the case here. I thought of this question and wanted to know whether using a comma in these examples is correct.

Please note that example 2 is taken from a novel.

More of a/an/the something than something

Posted: 30 Jun 2021 01:09 AM PDT

I would like to know more about this expression: More of a/an something than something.

As far as I know, it's usually used when we refer to things that are preceded by articles such as a and an. For example, we can say "He's more of a singer than a dancer", which means that he's more like a singer than a dancer.

However, I would like to know if we can use it when the words we are describing are preceded by "the", which is also an article.

For example, can we use "The cause of the disaster was more of the operator than the machine itself"?

Any opinions are welcome.

Thanks in advance!

What is it called when two unrelated clauses are joined and make no sense

Posted: 30 Jun 2021 07:05 AM PDT

I'm find this very hard to describe, but as it's something that I find grating I'm trying to find a word to describe it so I can discuss it with people.

Here is a conversation that to me makes sense:

Me: Do you like butter?

Someone else: No I don't, but I can spread it

This is not jarring. Maybe they could have said 'but at least I can spread it', but that feels implied.

Here is an example where the two clauses feel jarring:

Me: Do you like butter?

Someone else: Yes I do, but I can spread it

Here, you expect but to be a counter to the first clause, but in this example it's not countering anything. It feel clear the speaker meant to say 'and', but regardless this formation feels jarring.

Here's another example:

This is not isolated to but, however I can't find good example.

What is this called?

Word describing an outdated and no longer updated software package

Posted: 30 Jun 2021 07:42 AM PDT

I am looking for a word describing a software package that has not been updated for a long time, and although it still works with new versions of the underlying software, bugs have not been fixed for years, and no new features have been added.

I found this similar question, however, none of the words from the answer really seem to match, because the software package still exists and works, but just has not been updated in a long time. So it was not retired, or replaced, or terminated, or deprecated, or sunsetted.

"Unsupported" would somewhat match, but this essentially applied to a huge number of similar packages which are typically not officially supported. "Abandoned" sounds a bit harsh to me, as I would use the word in a document that the original author of the package might get to see at some point.

I was thinking about something like "obsolete" or "outdated", but this sort of seems to imply that there exists something newer, or better replacing the old package, which is not the case.

Translation of German "Es wird nichts so heiß gegessen, wie es gekocht wird"

Posted: 30 Jun 2021 12:06 PM PDT

A German speaker wrote:

As the German saying goes: You never eat the food as hot as it is cooked.

This is a literal translation of the proverb, "Es wird nichts so heiß gegessen, wie es gekocht wird." I wasn't the only person who had never heard that proverb in English. To me it sounded like a great proverb, but I couldn't quite figure out what it should mean. When asked to clarify its application to the question at hand, the German explained:

We don't take the rules as literally as they are written.

"Wow!" I thought. "That is a great proverb! Why can't I think of an English equivalent?"

Out of curiosity I popped the whole saying into Google translate and it came back with, "Nothing is as bad as it looks." So that doesn't seem right.

Of course German is famous for having a word for everything. But without falling back on ethnic jokes I can't figure out why a simple proverb like this would not have been translated or have an English analog.

Is there something equivalent, or similar, in English? Or any great insights into why there wouldn't be?

Is there a word for occurring four times a week? [closed]

Posted: 30 Jun 2021 08:42 AM PDT

I am trying to use this word to say how often my basketball team meets to practice.

OSCHINA 社区最新专区文章

OSCHINA 社区最新专区文章


如何往MySQL的大数据表添中加一列?

Posted: 30 Jun 2021 01:21 AM PDT

以前老版本 MySQL 添加一列的方式: 会造成锁表,简易过程如下: 新建一个和 Table1 完全同构的 Table2 对表 Table1 加写锁 在表 Table2 上执行 ALTER TABLE 你的表 ADD COLUMN 新列 char(128) 将 Table1 中的数据拷贝到 Table2 将 Table2 重命名为 Table1 并移除 Table1,释放所有相关的锁 如果数据量特别特别大,那么锁...

老大让我优化数据库,我上来就分库分表,他过来就是一jio。。。

Posted: 29 Jun 2021 05:08 AM PDT

记得,如果有人问你做数据库优化最有效的方式是什么? SQL优化、分布式集群、分库分表!干就完了~ **但上来就考虑分库分表真的合适么,你对分库分表又理解多少呢?什么时候分?有几种分法儿?** 首先我们要知道分库、分表都是干啥的,本文主角还是我们的MySQL为第一视角。首先从字面意思来看: **分库:** 由单个数据库实...

详解Redis主从复制原理

Posted: 29 Jun 2021 08:31 AM PDT

> 文章首发于公众号 "蘑菇睡不着" # 前言 Redis 的主从复制和 MySQL 差不多,主要起着 数据备份,读写分离等作用。所以说主从复制对 Redis 来说非常重要,而无论是面试还是工作总,了解 **Redis主从复制** 底层实现有非常有必要,那么接下来就和大家来看看 Redis 主从复制是怎么实现的吧。 # 什么是 Redis 主从复制? ...

【参赛作品3】浅聊openGauss体系架构

Posted: 29 Jun 2021 06:24 PM PDT

2020年7月openGauss刚刚开源,我便开始对openGauss数据库的学习。根据以往学习数据库的经验,最先想了解的是openGauss数据库的架构,希望对即将使用的数据库各个模块有所了解。但鉴于时间有限,仅有的资料图是源码doc目录内的"openGauss逻辑结构图",便针对该图做了简单介绍,并形成文档[《浅聊openGauss逻辑架构》](h...

这几个事务案例会回滚吗?最后一个90%的人判断错了...

Posted: 29 Jun 2021 06:48 PM PDT

下面这个问题源于前几日在我们的Spring技术交流群里,一个群友提出的关于事务回滚的疑问。 在讨论过程中,我尝试去复现群友提出的问题场景,发现了另外一个可能让大家会迷惑的情况。 当时在群里说了结果和原因,但微信群范围有限,所以单独写篇文章,拿出来给大家看看,顺便考考大家,对这块是否了解。 ## 问题描述 这个...

【参赛作品7】PostgreSQL/openGauss数据库易犯的十大错误

Posted: 29 Jun 2021 07:05 PM PDT

总结十点PostgreSQL/openGauss数据库中容易犯的错误。 ## 1.同时设置日志行前缀和csvlog格式 比较常见大家同时配置下面这两个参数 ``` log_line_prefix = '%m %u %d %p' log_destination='csvlog' ``` - %m是带毫秒的时间戳 - %u是用户名 - %d是数据库名 - %p是进程ID 然后当我们配置为csvlog日志时,日志行的内容项是固...

DigitalOcean 与 MongoDB 合作,推出全新的 DBaaS 产品

Posted: 29 Jun 2021 05:30 PM PDT

DigitalOcean 今天宣布将与 MongoDB 展开合作,推出 DigitalOcean Managed MongoDB,这是一个全新的管理型数据库即服务(DBaaS)产品。它将主要提供给应用程序开发人员和中小型企业。 管理型 MongoDB 可以帮助开发人员在 DigitalOcean 上轻松创建 MongoDB 集群。它还通过无缝管理、扩展和保护集群来简化数据库管理,从而...

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Is there a command to wait X seconds before next command?

Posted: 30 Jun 2021 10:05 AM PDT

Say I want to execute two commands but I want to wait X amount of seconds before the next one gets executed, what's the command for this?

E.g. sudo dnf upgrade -y && [PAUSE X SECONDS] && shutdown -r

“you are in emergency mode,, After logging in type ”journalctl -xb“ti view…”

Posted: 30 Jun 2021 10:07 AM PDT

my os (pop os , ubuntu based) gets freezed due to a RAM exceed, I reboot my system and only have CLI, were I got the tittle mentioned message:

"you are in emergency mode,, After logging in type "journalctl -xb"ti view…"

for getting to a solution I ran sudo blkid as mentioned in previous threads to see the UUIDs of the devices so I can edit certain lines in sudo vim /etc/fstab: https://www.enmimaquinafunciona.com/pregunta/135568/permitir-el-funcionamiento-en-modo-de-emergencia

As I understand I must change "00" to "0 0" on the correponding line on the device wwhere I mounted my os, in my case: /dev/sdb3

this is what I got when running cat /etc/fstab

/etc/tab static file system information. Use 'blkid' for print universally unique identifier for a device; this may be used with UUID= as a more robust way to name devices that works even if disks are added or removed. See fstab(5)
/dev/mapper/cryptswap none swap defaults 0 0 PARTUUID=7d9d3545-8064-4caf-9c02-c8ad5d8f1f92 /boot/efi vfat unmask=0077 0 0 UUID=4a53bf15-f3ba-49e6-a692-679166eab69c / ext4 noatime,errors=rmeount-ro 0 0 UUID= 0C80015D80014EA0 /mnt/data ntfs defaults 0 2

*blackened highlighted line correspond to my /root system as I see there is already a "0 0" instead of "00" on /dev/sdb3 UUID (where I have installed root system)

if it helps, I have 2 GPU drivers on my system, an NVIDIA geFORCE MX330 and a intel i7-1065G7.

so, how can I boot in normal mode ?

Show Plot in Separate Window in Pycharm Professional Edition 2021.1.2

Posted: 30 Jun 2021 09:20 AM PDT

I am a new Linux Ubuntu 20.04.2 LTS User. I want to view my plots created in Pycharm Professional 2021.1.2 (using matplotlib.pyplot.plot command) in a separate window. By default, the plot is getting displayed in the inbuilt sciview within the IDE. I want it to be displayed in a separate window for some reason.

I did try unchecking 'show plots in tool window' in Settings >> Tools >> Python Scientific

It worked in Windows 10 version of Pycharm. But in Ubuntu, I am getting the following error:

Error: failed to send plot to http://127.0.0.1:63342  Traceback (most recent call last):    File "/home/jenkins/Downloads/pycharm-professional-2021.1.2/pycharm-2021.1.2/plugins/python/helpers/pycharm_display/datalore/display/display_.py", line 60, in _send_display_message      urlopen(url, buffer)    File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen      return opener.open(url, data, timeout)    File "/usr/lib/python3.8/urllib/request.py", line 531, in open      response = meth(req, response)    File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response      response = self.parent.error(    File "/usr/lib/python3.8/urllib/request.py", line 569, in error      return self._call_chain(*args)    File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain      result = func(*args)    File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default      raise HTTPError(req.full_url, code, msg, hdrs, fp)  urllib.error.HTTPError: HTTP Error 404: Not Found    

NOTE: For the same code, I get the graph if I keep 'show plots in tool window' checked in Settings >> Tools >> Python Scientific. I am using Python 3.8.5

Please help me fix this.

How to determine minimum supported OS version of my app?

Posted: 30 Jun 2021 10:02 AM PDT

Background

I'm making an C++ app that's supposed to run on Centos 7. Builds are being done on Centos 7.9, and I'm using C++11 and C++17 features, which limits backward compatibility with older versions of Centos 7. There is an installer that can perform some checks before user is able to run the app.

Question

How can I automatically determine minimal supported version of Centos 7 for the app I'm developing?

What i have currently

Right now, after building, I'm retrieving a list of the required libraries using ldd and readelf (see: https://stackoverflow.com/questions/6242761/determine-direct-shared-object-dependencies-of-a-linux-binary ). With the list I'm able to compare what the user has to what my app needs, and if the user's version is lower than required, the installer tells him to upgrade. However, with this method my list tells me what are the versions of the libraries that I have on my build machine, not the oldest compatible versions of them.

What i've thought I'd do was I'd downgrade my build machine to some version of Centos 7 and - if the app compiles - say that's the lowest supported one. The installer would then compare user's version of library to the generated list. That being said, I'd like to have some sort of promise that newer versions are backward-compatible with the version I'd be using, and I couldn't find anything like that on Centos' or Red Hat's webpages. There are also security concerns about using older, unsupported version of OS.

Second option would be to only support whatever I have on my build machine, but that might require some users to upgrade, and they might not like it.

Third option is to build the app and try to run it on an old version of Centos.


Biggest part of my problem is lack of knowledge how to distribute Linux apps outside of the packet manager. On Windows you simply pack all DLLs with EXEs and you're good to go (most of the time). On Linux however you can't do that (I mean, you can mess with RPATH...).

Screen resolution won't change no matter which way I try it

Posted: 30 Jun 2021 10:09 AM PDT

Hello, I'm using Manjaro GNOME in a VM and I wanted to change the screen resolution to 1080p. To achieve this I firstly used xrandr. Its a bit weird though, that the only output detected is "XWAYLAND0" and not "Virtual1". This is what I entered in the terminal:


    ~ $ cvt 1920 1080  # 1920x1080 59.96hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz  Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2567   1080 1083 1088 1120 -hsync +vsync  ~ $ xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2567   1080 1083 1088 1120 -hsync +vsync  ~ $ xrandr --addmode XWAYLAND0 1920x1080_60.00     

But the screen resolution still does not show up in the display settings.


What I tried next was changing the GRUB screen resolution as shown in a YouTube tutorial. I changed GRUB_GFXMODE in my /etc/default/grub to 1920x1080x32 and entered the command

~ $ sudo update-grub
But this also had no affect on my screen resolution.


How do I change my screen resolution?

How to start Ubuntu Desktop from CLI?

Posted: 30 Jun 2021 09:19 AM PDT

I'm using a Macbook Pro M1, and trying to set up an Ubuntu VM using UTM. I've managed to set up Ubuntu 20.04.2 LTS Server, but am having issues getting the Desktop / GUI part running.

I've followed this guide to the letter - https://mac.getutm.app/gallery/ubuntu-20-04 - and managed to get the server installed fine.

At the end of the guide, I'm told to do the following to install Ubuntu Desktop:-

$ sudo apt install tasksel  $ sudo tasksel install ubuntu-desktop  $ sudo reboot  

That had no effect.

I then found another guide here - https://linuxconfig.org/start-gui-from-command-line-on-ubuntu-20-04-focal-fossa - which says to run the following:-

$ sudo systemctl isolate graphical  $ sudo systemctl set-default graphical.target  

Again - zero effect.

What am I missing?

How to Ctrl+Z a Bash or loop?

Posted: 30 Jun 2021 08:41 AM PDT

If I have a for loop that executes a long running process with different arguments each time it runs, and then press Ctrl+Z, this suspends the process that is running. But, when I execute fg to continue the suspended process, the loop exits after the process has finished, instead of continuing with the next run ? Example:

~$ ls  very_long_1.mp3  very_long_2.mp3  very_long_3.mp3  very_long_4.mp3  very_long_5.mp3  very_long_6.mp3  ~$ for mp3 in *.mp3; do mplayer $mp3; done  [mplayer plays very_long_1.mp3]  [mplayer plays very_long_2.mp3]  [mplayer plays very_long_3.mp3]  ^Z [while mplayer is still playing very_long_3.mp3]  ~$ sleep 1m; fg  [mplayer continues playing very_long_3.mp3]  ~$  

After playing very_long_3.mp3, I expect the 3 yet unplayed files to be played - but that never occurs. Why does this happen, and how can I suspend the whole for loop while being able to execute commands like I am when pressing Ctrl+Z ?

CentOS: Connections limit per port for Redis

Posted: 30 Jun 2021 08:28 AM PDT

I am using Redis caching server on CentOS, where Redis accepts clients connections on the configured listening TCP port. I am trying to figure out the limits applied by the operating system to the number of connection allowed to the single configured port for redis.

The user being used is root as shown:

[root@server-001]# ps -ef | grep -i redis   root     19595     1  9 Jun26 ?        09:43:07 /usr/local/bin/redis-server 0.0.0.0:6379  

Now I am tricked by multiple factors:

1st: the value of file-max is:

[root@server-001]# cat /proc/sys/fs/file-max  6518496  

2nd: the value of limits.conf:

[root@server-001]# cat /etc/security/limits.d/20-nproc.conf   # Default limit for number of user's processes to prevent  # accidental fork bombs.  # See rhbz #432903 for reasoning.    *          soft    nproc     4096  root       soft    nproc     unlimited  

3rd: The soft and hard limit of file descriptors:

[root@server-001]# ulimit -Hn  4096  [root@server-001]# ulimit -Sn  1024  

Now, knowing that the the real factor limits connection to a single port is file descriptors, which one I have to change to make sure that the redis server is accepting as much clients as it is possible?

How to prevent VxXsrv from copying to clipboard on selection?

Posted: 30 Jun 2021 08:00 AM PDT

I am using VcXsrv to view remote Linux' windows on Windows :)

I am running it with

"C:\Program Files\VcXsrv\vcxsrv.exe" -ac -terminate -lesspointer -multiwindow -clipboard -wgl -xkblayout us,ru -xkboptions grp:rctrl_rshift_toggle  

unfortunately, it behaves unwonted for Windows users: it copies to clipboard upon any selection.

Can it be disabled / reconfigured to copy only by explicit command?

export env variable does not work from Makefile

Posted: 30 Jun 2021 08:49 AM PDT

We have below task in Makefile:

test:      export SOME_ENV=someTest      go test -tags=integration -v -race  ./tests/integrationtest/...  

on shell prompt, SOME_ENV is set and the next command(go test) internally picks .someTest.env file

 $ export SOME_ENV=someTest   $ go test -tags=integration -v -race  ./tests/integrationtest/...  

but the Makefile approach doesn't work

Why environment variable is not set using Makefile approach?

Note: we have another tasks in Makefile that should not be influence with this export

Why integer division is faster than bitwise shift in shell?

Posted: 30 Jun 2021 08:13 AM PDT

I'm comparing performance of bash and dash (default sh in Xubuntu 18.04).

  • I expect sh to be faster than bash
  • I expect bitwise shift to be faster than division operator.

However, I'm getting inconsistencies:

λ hyperfine --export-markdown a.md -w 3 ./*  Benchmark #1: ./calc-div.bash    Time (mean ± σ):      2.550 s ±  0.033 s    [User: 2.482 s, System: 0.068 s]    Range (min … max):    2.497 s …  2.595 s    10 runs    Benchmark #2: ./calc-div.sh    Time (mean ± σ):      2.063 s ±  0.016 s    [User: 2.063 s, System: 0.000 s]    Range (min … max):    2.043 s …  2.100 s    10 runs    Benchmark #3: ./calc-shift.bash    Time (mean ± σ):      3.312 s ±  0.034 s    [User: 3.255 s, System: 0.057 s]    Range (min … max):    3.274 s …  3.385 s    10 runs    Benchmark #4: ./calc-shift.sh    Time (mean ± σ):      2.087 s ±  0.046 s    [User: 2.086 s, System: 0.001 s]    Range (min … max):    2.058 s …  2.211 s    10 runs    Summary    './calc-div.sh' ran      1.01 ± 0.02 times faster than './calc-shift.sh'      1.24 ± 0.02 times faster than './calc-div.bash'      1.61 ± 0.02 times faster than './calc-shift.bash'  
Command Mean [s] Min [s] Max [s] Relative
./calc-div.bash 2.550 ± 0.033 2.497 2.595 1.24 ± 0.02
./calc-div.sh 2.063 ± 0.016 2.043 2.100 1.00
./calc-shift.bash 3.312 ± 0.034 3.274 3.385 1.61 ± 0.02
./calc-shift.sh 2.087 ± 0.046 2.058 2.211 1.01 ± 0.02

Here are the scripts I tested:

calc-div.bash

#!/usr/bin/env bash    for i in {1..1000000}; do      _=$(( i / 1024 ))  done  

calc-div.sh

  i=1  while [ $i -le 1000000 ]; do      _=$(( i / 1024 ))      i=$(( i + 1 ))  done  

calc-shift.bash

  for i in {1..1000000}; do      _=$(( i >> 10 ))  done  

calc-shift.sh

#!/usr/bin/env sh    i=1  while [ $i -le 1000000 ]; do      _=$(( i >> 10 ))      i=$(( i + 1 ))  done  

This difference is more visible for 5000000:

Command Mean [s] Min [s] Max [s] Relative
./calc-div.bash 13.333 ± 0.202 12.870 13.584 1.23 ± 0.02
./calc-div.sh 10.830 ± 0.119 10.750 11.150 1.00
./calc-shift.bash 17.361 ± 0.357 16.995 18.283 1.60 ± 0.04
./calc-shift.sh 11.226 ± 0.351 10.834 11.958 1.04 ± 0.03
Summary    './calc-div.sh' ran      1.04 ± 0.03 times faster than './calc-shift.sh'      1.23 ± 0.02 times faster than './calc-div.bash'      1.60 ± 0.04 times faster than './calc-shift.bash'  

As you can see, for both bash and dash, division operator is faster than equivalent bitwise-shift to the right.

Remarkable tablet: Convert text file into notebook page

Posted: 30 Jun 2021 09:52 AM PDT

I am using the Remarkable 2 tablet with its note-taking functionality. I can scribble new notebook pages or annotate pdf-documents with the tools on it. I would, however, like to import existing text files (mainly txt) that I can then treat as if I had scribbled them (cut parts, move them around, erase single words, etc.).

Is there a conversion tool for Remarkable files that can convert text files into the format Remarkable uses for its notebook pages? Or could I batch-modify my text files so that Remarkable reads one as notebook page?

How to ignore part of a filename

Posted: 30 Jun 2021 08:00 AM PDT

Sorry if this question has been asked before. I am new to all of this.

I would like to concatenate all files from different folders that contain R1 at a specific position in their filenames. My attempts so far are not working as some file names have a different S number.

Folder 1

  952_56890_S91_combined_L001_R1_001.fastq.gz  952_56890_S91_combined_L001_R2_001.fastq.gz  952_53929_S92_combined_L001_R1_001.fastq.gz  952_53929_S92_combined_L001_R2_001.fastq.gz  

Folder 2

  952_56890_S125_combined_L001_R1_001.fastq.gz  952_56890_S125_combined_L001_R2_001.fastq.gz  952_53929_S126_combined_L001_R1_001.fastq.gz  952_53929_S126_combined_L001_R2_001.fastq.gz  

Can't find installed softwares with snap on Fedora

Posted: 30 Jun 2021 08:05 AM PDT

I tried to install PyCharm on Fedora:

[ac@fedora ~]$ sudo snap install pycharm-community --classic  2021-06-30T14:26:23+02:00 INFO Waiting for automatic snapd restart...  pycharm-community 2021.1.2 from jetbrains✓ installed  

But I wasn't able to launch it:

[ac@fedora ~]$ pycharm  bash: pycharm: command not found...  [ac@fedora ~]$ pycharm-community  bash: pycharm-community: command not found...  

I wasn't able to find it in the menu with the windows command ...

So how do you find installed software on Fedora? Should I have done it a different way?

snap run doesn't work for every software?

I tried to do the same with

[ac@fedora Downloads]$ sudo dnf install mysql-workbench-community-8.0.25-1.fc34.src-1.rpm   [sudo] password for ac:   Last metadata expiration check: 1:28:28 ago on Wed 30 Jun 2021 03:23:29 PM CEST.  Package mysql-workbench-community-8.0.25-1.fc34.src is already installed.  Dependencies resolved.  Nothing to do.  Complete!  [ac@fedora Downloads]$ snap run mysql-workbench-community  error: cannot find current revision for snap mysql-workbench-community: readlink /var/lib/snapd/snap/mysql-workbench-community/current: no such file or directory  

how can i print the values from the dcn file after specific pattern found in linux

Posted: 30 Jun 2021 09:58 AM PDT

I have input like this,

[Data.11]  Store,100,,,,,,,,,,,,,,,,,,,5222  Store,101,,,,,,,,,,,,,,,,,,,5235  [Data.12]  TaxSchedulePt,5899,2,110.0100,99999999.99,,8.8750  TaxSchedulePt,5900,1,0,110.00,,0.0000  [Data.13]  TaxSchedulePt,5900,1,0,110.00,,0.0000  TaxSchedulePt,5900,2,110.0100,99999999.99,,8.8750  

first need to find the [Data.] has found in the given input file, If [Data.] found in the given input file need to write that specific [Data.*] values into separate file.


Expected output file for[Data.11]

Store,100,,,,,,,,,,,,,,,,,,,5222  Store,101,,,,,,,,,,,,,,,,,,,5235  

Expected output file for[Data.12]

TaxSchedulePt,5899,2,110.0100,99999999.99,,8.8750  TaxSchedulePt,5900,1,0,110.00,,0.0000  

Expected outputfile for [Data.13]

TaxSchedulePt,5900,1,0,110.00,,0.0000  TaxSchedulePt,5900,2,110.0100,99999999.99,,8.8750  

And this is i have tried,

filename=$1  Var1=Data.18  if grep -wq "$Var1" $filename ;  then   awk '$1 ~ /Data[.]18/' > /ttk/new/data.dcn  else  echo "not Worked"  fi  

How to play a playlist continously?

Posted: 30 Jun 2021 09:21 AM PDT

I have a video file which is 20 seconds long. I cut this video file into segments like

video_file_0 -> starts at 0:00, ends at 0:02  video_file_1 -> starts at 0:02, ends at 0:04  video_file_2 -> starts at 0:04, ends at 0:06  video_file_3 -> starts at 0:06, ends at 0:08  video_file_4 -> starts at 0:08, ends at 0:10  video_file_5 -> starts at 0:10, ends at 0:12  video_file_6 -> starts at 0:12, ends at 0:14  video_file_7 -> starts at 0:14, ends at 0:16  video_file_8 -> starts at 0:16, ends at 0:18  video_file_9 -> starts at 0:18, ends at 0:20  

So my question is, how can I play these video files continously in a single window exactly like playing the whole video file from 0:00 to 0:20, without closing and reopening windows in every switching between video files. Can I use ffplay, ffmpeg or vlcj for this functionality?

I tried

find -type f -name "video_file_*" | while read f; do ffplay -autoexit -- "$f"; done  

But this code closes and reopens the window between every video file, I don't want that. How can I do that?

EDIT: I am building a Java project which the streams are shown inside the JFrame. So I want this functionality is shown inside the JFrame.

Why system go to suspend not power off?

Posted: 30 Jun 2021 10:13 AM PDT

When I press the power button on a machine, I got log:

PM: suspend entry (s2idle)  PM: Syncing filesystems ... done.  Freezing user space processes ... (elapsed 0.003 seconds) done.  

Is it suspending? not powering off?

which setting can change it?

how to trigger an ansible task only if concerned directories are old enough (+30 days for example)

Posted: 30 Jun 2021 08:52 AM PDT

how to trigger an ansible task only if concerned directories are old enough (+30 days for example) ?

whant to do something like

- name: backup biggest files     #get difference between currentdate & last backup    register age   

I know I can get either a string or a defined on when clause but I don't know how to here

my goal is /mnt/backup.YYYYMMDD is older than 30days for example to make a list of tasks to create new dated directory and do the backup itself (synchronize method might be good ?)

how can I get this ?

steps to get :

  • find last backup date

  • find current date

  • arithmetic difference between them

  • apply that difference as a when statement in a task from the yaml file

     - name: Check the last backup date                                                                                                                                                                    shell: |                                                                                                                                                                                              #or find module                                                                                          register: lastone                                                                                                                                                                                 - name: Get current date for arithmetics                                                                                                                                                              shell: |                                                                                                                                                                                              echo $(date +%s)                                                                                                                                                                                  register: currentdate                                                                                                                                                                             - name: find ideal path to create new backup if last one is too old                                                                                                                                  # define & create new directory if currentdate - lastone is over a numeric value (suffisant difference)                                                                                                                                                                                      when: " {{ currentdate | int - lastone | int }} " > 40000    

here I finished to get a dummy start of solution pig style for testing :

---                                                                                                                                                                                             - hosts: localhost                                                                                                                                                                                become: true                                                                                                                                                                                    become_method: sudo                                                                                                                                                                             become_user: francois                                                                                                                                                                           tasks:                                                                                                                                                                                          - name: Check the last backup date                                                                                                                                                                shell: |                                                                                                                                                                                          date +%s -r $(find /mnt{1,2,3}/ -type d -name "backup.*[0-9]" 2> /dev/null | sort | tail -1)                                                                                                  args:                                                                                                                                                                                             executable: /bin/bash                                                                                                                                                                         register: lastone                                                                                                                                                                             - name: Get current date for arithmetics                                                                                                                                                          shell: |                                                                                                                                                                                          date +%s                                                                                                                                                                                      register: currentdate                                                                                                                                                                         - set_fact:                                                                                                                                                                                         difference: " {{ currentdate.stdout | int - lastone.stdout | int }} "                                                                                                                       - name: find ideal path to create new backup if last one is too old                                                                                                                               shell: |                                                                                                                                                                                          find /mnt{1,2,3}/ -type d -name "backup.*[0-9]" 2> /dev/null | sort -n | tail -1 | sed "s/\.[0-9].*/\.$(date +%Y%m%d)/"                                                                       args:                                                                                                                                                                                             executable: /bin/bash                                                                                                                                                                         register: rep                                                                                                                                                                                   when:                                                                                                                                                                                             - difference | int > 4000                                                                                                                                                                   - name: create path                                                                                                                                                                               file:                                                                                                                                                                                             path: "{{ rep.stdout }}"                                                                                                                                                                        state: directory                                                                                                                                                                                mode: "0755"                                                                                                                                                                                  when:                                                                                                                                                                                             - rep is defined                                                                                                                                                                                - difference | int > 4000     

that results well creating the backup.20210630 directory wherever it is mounted behind /mnt1 or 2 or 3 (here 3)

👨francois@💻zaphod🐙:~/GITLAB/dev/dev_ansible_serviceatonce$ ANSIBLE_NOCOWS=1 ansible-playbook -i inventory/hosts roles/filebackup/filebackup.yaml     PLAY [localhost] *****************************************************************************************************************************************************************************    TASK [Gathering Facts] ***********************************************************************************************************************************************************************  ok: [localhost]    TASK [Check the last backup date] ************************************************************************************************************************************************************  changed: [localhost]    TASK [Get current date for arithmetics] ******************************************************************************************************************************************************  changed: [localhost]    TASK [set_fact] ******************************************************************************************************************************************************************************  ok: [localhost]    TASK [find ideal path to create new backup if last one is too old] ***************************************************************************************************************************  changed: [localhost]    TASK [create path] ***************************************************************************************************************************************************************************  changed: [localhost]    PLAY RECAP ***********************************************************************************************************************************************************************************  localhost                  : ok=6    changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0       👨francois@💻zaphod🐙:~/GITLAB/dev/dev_ansible_serviceatonce$ ls -d /mnt3/backup.202106*  /mnt3/backup.20210604  /mnt3/backup.20210610  /mnt3/backup.20210615  /mnt3/backup.20210621  /mnt3/backup.20210629  /mnt3/backup.20210630  👨francois@💻zaphod🐙:~/GITLAB/dev/dev_ansible_serviceatonce$   

Trying to start a .sh on boot

Posted: 30 Jun 2021 10:21 AM PDT

i try to start a "start.sh" file when the Server starts.

Some info:

  • its a headless vServer
  • i tried crontab but that didn work either
  • my current approach is systemctl command
  • when i login the user is root
  • its a Ubuntu server

Content of my systemctl file

[Unit]  Description=MCServer Start  After=multi-user.target     [Service]  Type=simple  ExecStart=/home/mcs/start.sh     [Install]  WantedBy=multi-user.target  

Contend of the start.sh

screen -S minecraft java -Xms1024M -Xmx1024M -jar /home/mcs/server.jar  

When i check the status after reboot the system replies with this:

● mcs.service - MCServer Start       Loaded: loaded (/etc/systemd/system/mcs.service; enabled; vendor preset: enabled)       Active: failed (Result: exit-code) since Wed 2021-06-30 12:12:16 CEST; 32min ago      Process: 700 ExecStart=/home/mcs/start.sh (code=exited, status=203/EXEC)     Main PID: 700 (code=exited, status=203/EXEC)    Jun 30 12:12:16 v25431 systemd[1]: Started MCServer Start.  Jun 30 12:12:16 v25431 systemd[700]: mcs.service: Failed to execute command: Permission denied  Jun 30 12:12:16 v25431 systemd[700]: mcs.service: Failed at step EXEC spawning /home/mcs/start.sh: Permission denied  Jun 30 12:12:16 v25431 systemd[1]: mcs.service: Main process exited, code=exited, status=203/EXEC  Jun 30 12:12:16 v25431 systemd[1]: mcs.service: Failed with result 'exit-code'.  root@v25431:~#  

I see that im missing permission ... how do i fix that?

a little headsup... im pretty new to linux so, explain it to me like im 5 or 80 years old ^^

Edit:

When i change the systemctl to:

[Unit]  Description=MCServer Start  After=multi-user.target     [Service]  Type=simple  ExecStart=sh /home/mcs/start.sh     [Install]  WantedBy=multi-user.target  

the output changes to

● mcs.service - MCServer Start       Loaded: loaded (/etc/systemd/system/mcs.service; enabled; vendor preset: enabled)       Active: failed (Result: exit-code) since Wed 2021-06-30 12:59:08 CEST; 22s ago      Process: 1324 ExecStart=/usr/bin/sh /home/mcs/start.sh (code=exited, status=1/FAILURE)     Main PID: 1324 (code=exited, status=1/FAILURE)    Jun 30 12:59:08 v25431 systemd[1]: Started MCServer Start.  Jun 30 12:59:08 v25431 sh[1325]: Must be connected to a terminal.  Jun 30 12:59:08 v25431 systemd[1]: mcs.service: Main process exited, code=exited, status=1/FAILURE  Jun 30 12:59:08 v25431 systemd[1]: mcs.service: Failed with result 'exit-code'.    

Requested Output

root@v25431:~# ls -l /home/mcs/start.sh  -rwxr-xr-x 1 root root 72 Jun 29 23:39 /home/mcs/start.sh  

powershell update is causing some bash scripts to fail which works fine directly from powershell

Posted: 30 Jun 2021 10:09 AM PDT

The call

instaloader --post-filter="likes > 16720 and not is_video and date_utc >= datetime(2021, 5,   29)" --no-profile-pic --no-videos --count=12 cristiano  

works fine.

But put the same code in test.sh and then run it from powershell like this

sh .\test.sh  

I get error like this

usage:     instaloader [--comments] [--geotags]              [--stories] [--highlights] [--tagged] [--igtv]              [--login YOUR-USERNAME] [--fast-update]              profile | "#hashtag" | %location_id | :stories | :feed | :saved  instaloader --help    instaloader: error: unrecognized arguments: cristiano  

In case you want to test it out firsthand just install instaloader with pip install instaloader==4.7.1

PS: The same script used to work fine from my .sh-files as well few days back, maybe some update to my powershell is causing the issue. The issue I guess is in its ability to escape spaces within quotes.

I am on bash 4.4. I don't remember what it was before reinstalling powershell. And no WSL is being used.

Is there a way to give a user access to a file without adding it to sudoers?

Posted: 30 Jun 2021 08:51 AM PDT

My monitoring system runs with lowered permissions but I want it to run a command that needs access a particular file in a folder that the monitoring system is not allowed to enter.

The usual approach would be for me to add that command–user combination to my sudoers file and change the configuration such that the command is executed with sudo. However, I feel that this will give the command in fact many more rights than are needed (I don't need any write permissions at all).

Is there a sudo-like program that can execute a command as the same user but with the only difference that a particular (pre-defined) file or folder is then accessible? (The file/folder could even have a different name.) Could there be a way to accomplish this with mount namespaces?

Requirements to boot a rootfs.img

Posted: 30 Jun 2021 09:02 AM PDT

I have a Linux image from which I've extracted a "rootfs.img" file, the file seems to contain files and information, I would like to "boot into it" file contents: bin dev etc home lib media mnt proc run sbin service sys tmp usr var lib64

how can I install a bootloader to boot it?

I've tried: getting a live ubuntu image, adding a partition, placing the contents of rootfs.img inside the partition and running "Boot Repair", which did find the other system as another bootable linux, but I can't boot into it, seems like I'm missing something

Exact pattern match in awk

Posted: 30 Jun 2021 10:17 AM PDT

I have a listA which looks like this:

gene1  gene2  gene11  gene22  gene23  

I also have few tab delimited text files(*hist.txt) whose 4th column matches the genes in the list. I want to extract value of every gene in the listA from tab delimited text file

This is what I have written

for i in `cat listA.txt`  do      for a in *hist.txt      do          fn=${a%%_*}          cat $a | awk -v OFS="\t" -v fn="$fn" -v pattern="$i" '$4 ~ pattern{print fn,$0}' >> ${i}_out.txt      done  done  

My pattern match fails in awk not doing exact pattern match. The output for gene1 also include gene11.

Unplugging external monitor forces me to reboot

Posted: 30 Jun 2021 09:48 AM PDT

I use a script that runs xrandr to turn off laptop display, showing only the external monitor screen.

I have another script that basically "reverses" this (showing only laptop display) which I use every time I have to take my laptop to a coffee shop.

Sometimes, in a hurry, I don't do this and just unplug my laptop directly before putting it in the bag. Now when I reach the coffee shop and try to use it, I would only see a blank screen which is due to what I assume to be my video configuration still being in "external screen only" mode. Question: how do I go to "laptop screen only" mode here? Otherwise, is there a way I can avoid having this problem in the first place?

Without knowing this I simply force reboot my laptop, which sucks.

For the record I run NixOS on Thinkpad P71.

How to install Nvidia Drivers in Manjaro 18?

Posted: 30 Jun 2021 10:03 AM PDT

Today I installed the latest version of Manjaro i3 18.0.3 to my MSI GE-60PC laptop which has GeForce GTX 850M. I'm using my laptop with external Monitor (connected via HDMI). After first boot, my laptop screen and external monitor were mirrored. I wasn't able to set my display settings. Then I installed the nvidia package1 using pacman with the following command.

sudo pacman -S linux419-nvidia  

My kernel version is;

Linux my-msi 4.19.28-1-MANJARO #1 SMP PREEMPT Sun Mar 10 08:32:42 UTC 2019 x86_64 GNU/Linux  

In 1, it says;

5. Reboot. The nvidia package contains a file which blacklists the nouveau module, so rebooting is necessary.   

So, i rebooted the pc after installing nvidia drivers. After reboot, my display settings was fixed, so my monitor was extended. Although, when I run the following command;

lspci -k | grep -A 2 -E "(VGA|3D)"  0:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)      DeviceName:  Onboard IGD      Subsystem: Micro-Star International Co., Ltd. [MSI] 4th Gen Core Processor Integrated Graphics Controller  --  01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 850M] (rev a2)      Subsystem: Micro-Star International Co., Ltd. [MSI] GM107M [GeForce GTX 850M]      Kernel driver in use: nouveau  

It says I'm still using nouveau driver. What is the proper and correct way to install nvidia drivers? I want to install cuda and pytorch after that.

When I run nvidia-modprobe command, the following kernel log occur.

[ 1883.794671] nvidia-nvlink: Nvlink Core is being initialized, major device number 237  [ 1883.795017] NVRM: The NVIDIA probe routine was not called for 1 device(s).  [ 1883.795018] NVRM: This can occur when a driver such as:                  NVRM: nouveau, rivafb, nvidiafb or rivatv                  NVRM: was loaded and obtained ownership of the NVIDIA device(s).  [ 1883.795018] NVRM: Try unloading the conflicting kernel module (and/or                 NVRM: reconfigure your kernel without the conflicting                 NVRM: driver(s)), then try loading the NVIDIA kernel module                 NVRM: again.  [ 1883.795018] NVRM: No NVIDIA graphics adapter probed!  [ 1883.795132] nvidia-nvlink: Unregistered the Nvlink Core, major device number 237  

Security of bash script involving gpg symmetric encryption

Posted: 30 Jun 2021 10:24 AM PDT

Notice: the very same vulnerability has been discussed in this question, but the different setting of the problem (in my case I don't need to store the passphrase) allows for a different solution (i.e. using file descriptors instead of saving the passphrase in a file, see ilkkachu's answer).

Suppose I have a symmetrically encrypted file my_file (with gpg 1.x), in which I store some confidential data, and I want to edit it using the following script:

read -e -s -p "Enter passphrase: " my_passphrase  gpg --passphrase $my_passphrase --decrypt $my_file | stream_editing_command | gpg --yes --output $my_file --passphrase $my_passphrase --symmetric  unset my_passphrase  

Where stream_editing_command substitutes/appends something to the stream.

My question: is this safe? Will the variable $my_passphrase and/or the decrypted output be visible/accessible in some way? If it isn't safe, how should I modify the script?

How do I get the fingerprint of an ASCII-armored PGP secret key with gpg?

Posted: 30 Jun 2021 08:46 AM PDT

I have a file secret.asc containing an ASCII-armored (i.e., plain text and starts with -----BEGIN PGP PRIVATE KEY BLOCK-----) PGP/GPG secret/private key, and I would like to know its 40-character key fingerprint without importing it into my GPG keyring. Unfortunately, not a single command I've tried has surrendered that information to me.

What I've Tried

The following failed attempts were run on Ubuntu Xenial 16.04.5 with gpg version 1.4.20 and gpg2 version 2.1.11. The key in question was created solely for experimentation purposes and won't be used in anything, so I don't care if the output reveals too much about it.

$ gpg --with-fingerprint secret.asc  sec  2048R/161722B3 2018-09-12   uid                            Testing <testing@testing.nil>  

Short key ID only, no fingerprint.

$ gpg2 --with-fingerprint secret.asc  gpg: DBG: FIXME: merging secret key blocks is not anymore available  gpg: DBG: FIXME: No way to print secret key packets here  

Error.

$ gpg --with-fingerprint --no-default-keyring --secret-keyring ./secret.asc --list-secret-keys  gpg: [don't know]: invalid packet (ctb=2d)  gpg: keydb_search_first failed: invalid packet  

Error.

$ gpg2 --with-fingerprint --no-default-keyring --secret-keyring ./secret.asc --list-secret-keys  /home/jwodder/.gnupg/pubring.gpg  --------------------------------  ...  

This lists the secret keys in my keyring for some reason.

$ gpg --dry-run --import -vvvv secret.asc  gpg: using character set `utf-8'  gpg: armor: BEGIN PGP PRIVATE KEY BLOCK  gpg: armor header: Version: GnuPG v1  :secret key packet:          version 4, algo 1, created 1536783228, expires 0          skey[0]: [2048 bits]          skey[1]: [17 bits]          skey[2]: [2047 bits]          skey[3]: [1024 bits]          skey[4]: [1024 bits]          skey[5]: [1021 bits]          checksum: 386f          keyid: 07C0845B161722B3  :signature packet: algo 1, keyid 07C0845B161722B3          version 4, created 1536783228, md5len 0, sigclass 0x1f          digest algo 2, begin of digest b6 12          hashed subpkt 2 len 4 (sig created 2018-09-12)          hashed subpkt 12 len 22 (revocation key: c=80 a=1 f=9F3C2033494B382BEF691BB403BB6744793721A3)          hashed subpkt 7 len 1 (not revocable)          subpkt 16 len 8 (issuer key ID 07C0845B161722B3)          data: [2048 bits]  :user ID packet: "Testing <testing@testing.nil>"  :signature packet: algo 1, keyid 07C0845B161722B3          version 4, created 1536783228, md5len 0, sigclass 0x13          digest algo 2, begin of digest 33 ee          hashed subpkt 2 len 4 (sig created 2018-09-12)          hashed subpkt 27 len 1 (key flags: 03)          hashed subpkt 9 len 4 (key expires after 32d3h46m)          hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)          hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)          hashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)          hashed subpkt 30 len 1 (features: 01)          hashed subpkt 23 len 1 (key server preferences: 80)          subpkt 16 len 8 (issuer key ID 07C0845B161722B3)          data: [2046 bits]  gpg: sec  2048R/161722B3 2018-09-12   Testing <testing@testing.nil>  gpg: key 161722B3: secret key imported  gpg: pub  2048R/161722B3 2018-09-12  Testing <testing@testing.nil>  gpg: writing to `/home/jwodder/.gnupg/pubring.gpg'  gpg: using PGP trust model  gpg: key 793721A3: accepted as trusted key  gpg: key 161722B3: public key "[User ID not found]" imported  gpg: Total number processed: 1  gpg:               imported: 1  (RSA: 1)  gpg:       secret keys read: 1  gpg:   secret keys imported: 1  

The only fingerprint to be found is that of the revocation key.

$ gpg2 --dry-run --import -vvvv secret.asc  

Same output as above.

$ gpg --list-packets secret.asc  $ gpg2 --list-packets secret.asc  

Basically the same output as the --dry-run --import -vvvv commands, only without the gpg: lines.

Why is my udev rule not working?

Posted: 30 Jun 2021 08:08 AM PDT

I need to automatically run my script /var/www/html/configWWW when any USB is plugged in to my Raspberry.

UDEV RULE - /etc/udev/rules.d/myRule.rules

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="****",  ATTR{idProduct}=="****", RUN+="/var/www/html/configWWW"  

MY SCRIPT - /var/www/html/configWWW

#!/bin/bash  file="/media/pi/USB/SymSif.xml"  if [ -f "$file" ]  then          (          echo "it works: $(date)" >> /home/pi/Desktop/test.txt          )  else          (          echo "it does not works: $(date)" >> /home/pi/Desktop/test.txt          )  fi  

On the other hand, if i run script from bash /var/www/html/configWWW, it works!

Why doesn't my udev rule work like my bash command?

ClamAV: suppress all output except summary

Posted: 30 Jun 2021 08:47 AM PDT

When using Clam AntiVirus from within GNU Bash, how should one invoke clamscan such that it will reliably suppress all output except the final summary?

These attempts don't work:

  • clamscan --quiet. Suppresses the final summary.
  • clamscan -o -r ~/ 2>/dev/null. Prints lines that aren't "OK" (but which don't necessarily indicate an infection: e.g. files that are simply empty files, or symbolic links) to stdout. Those lines therefore bypass the redirect and are still printed on the terminal in addition to the final summary.