Tuesday, August 31, 2021

OSCHINA 社区最新讨论话题

OSCHINA 社区最新讨论话题


关于 MySQL 中 SELECT 语句的原子性问题

Posted: 18 Aug 2021 08:12 PM PDT

在MySQL数据库中存在一张settings表: sname svalue no 0 no2 0 同时存在以下两个函数: CREATE FUNCTION `fn_inc_no`() RETURNS int(11) BEGIN DECLARE val INT DEFAULT 0; UPDATE settings SET svalue = svalue + 1 WHERE sname = 'no'; SELECT svalue INTO val FROM settings WHERE sname = 'no'; RETURN val; END 和...

《防止成年人沉迷加班工作》

Posted: 31 Aug 2021 08:41 AM PDT

你好,需要还原备份,请问有无来版本的AMH5.8的安装?

Posted: 31 Aug 2021 02:06 AM PDT

@AMH面板 你好,想跟你请教个问题:你好,需要还原备份,请问有无来版本的AMH5.8的安装?现在是6.1的没法还原,我的备份文件有2.5G大小,包含了面板数据。

想问下一般工厂给人员蓝牙定位用什么技术啊?急急急急 在线等

Posted: 31 Aug 2021 01:29 AM PDT

想问下一般工厂给人员蓝牙定位用什么技术啊?急急急急 在线等

echarts鼠标滚动缩放到最大值,如何控制缩放小数点后面的位数,现在最大可到小数点后14位,比如我想控制到小数点后7位,如何控制

Posted: 31 Aug 2021 12:08 AM PDT

echarts鼠标滚动缩放到最大值,如何控制缩放小数点后面的位数,现在最大可到小数点后14位,比如我想控制到小数点后7位,如何控制,如图

微服务架构里如何设置访问权限?

Posted: 30 Aug 2021 11:38 PM PDT

参考文档https://doc.xiaominfo.com/guide/accessControl.html 在gateway 与 服务模块都设置了访问权限,但是不起作用

提供api接口可以二次开发的无人机都有哪些?(飞行平台)

Posted: 30 Aug 2021 07:06 PM PDT

我想往无人机里写自己的开发的程序,控制飞行。。。 但是感觉大疆的那种飞行平台太贵了,有没有便宜一些的呢? 求大佬告知,,,我给您磕头了!

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Using SSH with shell script works with manual input but not with parameters

Posted: 31 Aug 2021 10:57 AM PDT

I have a shell script authenticate.sh that looks like

#!/bin/bash  sshpass -p '$1' ssh $2@localhost  

I call it using

bash authenticate.sh password username  

But I get "Permission denied, please try again" when I run it. If I instead run

#!/bin/bash  sshpass -p 'password' ssh user@localhost  

it works...

Any help?

linux tc's (traffic control) fw filter is not working

Posted: 31 Aug 2021 10:18 AM PDT

I am trying to modify the wondershaper script for a different use-case.

So, I am trying to change the following to filter (Refer to line 253) to fwmark filter so that I can set up different download speed limits based on different iptables mark.

# Add filter to rule for IP address  tc filter add dev "$IFB" protocol ip parent 2: prio 1 u32 \      match ip src 0.0.0.0/0 flowid 2:1;  

so, to test this I have tried the following iptable command to add a mark 6 to every packet.

iptables -t mangle -A PREROUTING -j MARK --set-mark 6  

and then used following tc command instead of the tc command above

tc filter add dev ifb0 protocol ip parent 2: handle 6 fw classid 2:1  

However this is not working and I would appreciate if someone can provide proper help. I'm finding it extremely difficult to learn tc.

Cant use space from a mounted disk in a debian GCP VM

Posted: 31 Aug 2021 09:21 AM PDT

I mounted a SD disk to my Google cloud VM running debian 11. It' mounted on /mnt, and it has 100gb of free space.

But when i try to install anything in the VM, it says i dont have free space. Somehow i need to tell to the vm to use that disk storage, but i don't know how, im a new linux user.

Can someone help me here? The print below shows the situation. I'm listing every command i used to mount the disk below too. Thanks

enter image description here

## Format disk  sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/sdb    ## Make disk directory  sudo mkdir -p /mnt/disks/disk1    ## Using mount tool  sudo mount -o discard,defaults /dev/DEVICE_NAME /mnt/disks/disk1    ## Read and write permissions to every user  sudo chmod a+w /mnt/disks/disk1  

Automating KDE Plasma Settings

Posted: 31 Aug 2021 08:59 AM PDT

I have a dual-monitor setup, and I want games to appear on the second monitor (which has a higher resolution). Unfortunately, only a handful will allow for moving on the second monitor, and the rest will just stick with the resolutions from the first (Kwin rules don't help). My current solution is to temporarily set the second monitor as primary whenever I'm playing a game. However, I wish to be able to automate this in a bash script, along with a few other tasks. Is there some API I need (perhaps via dbus?) or a configuration file I can change that would allow me to do this?

GNS3 can't find VMware vmrun

Posted: 31 Aug 2021 08:50 AM PDT

I am trying to create a topology using GNS3 with VMware. I have already created a virtual machine in VMware, yet when I try to add it to GNS3, I get this error message.

G

I can't find any pertinent info on the troubleshooting page of vmware.

Thanks

Iptables u32 module install Centos 8

Posted: 31 Aug 2021 08:43 AM PDT

On Centos 8 stream the dnf version of iptables seems to be missing the u32 module, how does one obtain this module?

Seems to exist in Fedora 34

enter image description here

rm -rf : is there an all or nothing approach?

Posted: 31 Aug 2021 08:12 AM PDT

Let's say I have the following structure :

$ mkdir d1  $ mkdir d1/d2  $ touch d1/f1  $ touch d1/d2/f2    $ chmod u-w d1/d2  

If I try to remove d1, I can't because I don't have write permissions on d1/d2. But it still deletes d1/f1 :

$ rm -rf d1  rm: cannot remove 'd1/d2/f2': Permission denied    $ ls d1  d2          # f1 has been deleted  

Is there a way to implement an "all or nothing" rm tool ? E.g., if it can not delete everything, then it deletes nothing at all.

How do I run things in /etc/fstab and /etc/crypttab interlocked?

Posted: 31 Aug 2021 07:55 AM PDT

Imagine this there is a cloud storage foo which can get mounted via

mount -t s3fs foo /mnt/s3  

Which in turn contains a file luks_file which has a LUKS container in it. That can be unlocked like with local key file bar.

cryptsetup luksOpen --key-file bar /mnt/s3/luks_file storage  

And then get mounted itself.

mount /dev/mapper/storage /mnt/storage  

All these 3 commands have pendants in /etc/fstab and /etc/crypttab, but the need to be run interlocked as shown.

Can this be achieved?

How to create a new column in tsv files by combining two other columns on linux?

Posted: 31 Aug 2021 10:09 AM PDT

I have 70 directories that have files like below:

STAN002     |______ STAN002_sasions.tsv  PTAN044     |______ PTAN044_sasions.tsv  STAN005     |______ STAN005_sasions.tsv  STAN050     |______ STAN050_sasions.tsv  QRED034     |______ QRED034_sasions.tsv  .  .  .  PREC098     |______ PREC098_sasions.tsv  

Each of the .tsv file which are in above directories have same number of columns (30 columns) and look like below in the picture:

enter image description here

The 1st and 2nd columns in the .tsv files are like below:

#gene1    gene2  VAV1      THAP4  ZNF75A    ZNF263  KRCC1     POLR1A  H2AFV     TANC1  B3GALT6  RP3-340N1.5  SH3BP1   CTD-2013M15.1(192243),EMB(3603711)  PTPRO     VASN  

Now, on linux using awk or any bash script I want to create a new column in all the .tsv files in the directories. The newly created column will be the 31st column in the files.

It should be like combining 1st and 2nd columns where the names are separated by --. The 31st column should look like below:

gene1--gene2  VAV1--THAP4  ZNF75A--ZNF263  KRCC1--POLR1A  H2AFV--TANC1  B3GALT6--RP3-340N1.5  SH3BP1--CTD-2013M15.1(192243),EMB(3603711)  PTPRO--VASN  

I tried this way, but got wrong:

awk '{print $0, $1 "-" $NF}' STAN002_sasions.tsv  

How to do that on linux in a single script on all the files? Any help is appreciated.

how to use sed in a specific column of a tabular file

Posted: 31 Aug 2021 07:36 AM PDT

I have a tabular file A.tsv (separator=\t) :

20655|dkljdjj   66  lala  20644|kmkmoii   75  lolo  20477|kmlkooo   88  lili  

And I want to remove all the things after the | ( | pipe include ) in the first column, in order to have that :

20655   66  lala  20644   75  lolo  20477   88  lili  

I know how to do that with sed : sed 's/|.*//' A.tsv > B.tsv but it remove all after the pipe , not only the first column.

So do you know how to do that ? Maybe with a combination with awk ? Thanks

Directory permission showing d?

Posted: 31 Aug 2021 08:06 AM PDT

I downloaded some files and saved them in a folder on an external hard drive. Later when I am trying to search for the folder I couldn't find it. So I try searching using the terminal. I listed all the files in the location where I had saved that folder previously and noticed the folder was present there but it showed d????????? permission. What does it mean and how can I get my files back.

terminal

'at' job fails: Script not found in the directory (raspberry pi)

Posted: 31 Aug 2021 08:27 AM PDT

I am trying to run an 'at' job. The job is in ~/mydir/first.sh. It executes second.sh using (sh second.sh) which is in the same directory. I get an error saying that the file is not found.

This is very unusual as I am doing the exact same thing on another linux laptop and have no issues.

How to exclude paths from being extracted when extracting an iso using xorriso

Posted: 31 Aug 2021 10:51 AM PDT

As an example I'm trying to extract all the files from the ubuntu live iso except the path /casper/filesystem.squashfs. According to the man page:

       Normally  xorriso  only writes to disk files which were given as stdio:         pseudo-drives or as log files.  But its alter ego osirrox  is  able  to         extract  file  objects  from  ISO  images  and to create, overwrite, or         delete file objects on disk.         Disk file exclusions by -not_mgt, -not_leaf, -not_paths apply.  

I can extract all paths on the iso fine using:

xorriso -osirrox on -indev ubuntu-21.04-desktop-amd64.iso -extract / extract_dir  

But I've been attempting to use the disk file exclusions but to no avail. I've tried different variations or not_leaf and not_paths in different orders both before and after the -extract action. They all extract all paths. Here's a few that I've tried.

Using not_leaf:

xorriso -osirrox on -indev ubuntu-21.04-desktop-amd64.iso -not_leaf 'filesystem.squashfs' -extract / extracted_dir  xorriso -osirrox on -indev ubuntu-21.04-desktop-amd64.iso -extract / extracted_dir -not_leaf 'filesystem.squashfs'  xorriso -osirrox on -indev ubuntu-21.04-desktop-amd64.iso -not_mgt on -not_leaf 'filesystem.squashfs' -extract / extracted_dir  xorriso -osirrox on -indev ubuntu-21.04-desktop-amd64.iso -not_mgt on -extract / extracted_dir -not_leaf 'filesystem.squashfs'  

Using not_paths with reorderings as above:

xorriso -osirrox on -indev ubuntu-21.04-desktop-amd64.iso -not_mgt on -not_paths 'casper/filesystem.squashfs' -- -extract / extracted_dir  xorriso -osirrox on -indev ubuntu-21.04-desktop-amd64.iso -not_mgt on -not_paths '/casper/filesystem.squashfs' -- -extract / extracted_dir  xorriso -osirrox on -indev ubuntu-21.04-desktop-amd64.iso -not_mgt on -not_paths 'extracted_dir/casper/filesystem.squashfs' -- -extract / extracted_dir  

I would accept an answer with not_leaf or not_paths, but would prefer both. And an explanation of the logic behind how this is supposed to work (ie why am I not getting it?) would be nice.

How is it possible that network is still reachable even after disabling the only connection via nmcli?

Posted: 31 Aug 2021 10:44 AM PDT

I've got a system with an ethernet connected over eth1 and managed by Network Manager. The connection has autoconnect set to no in it's settings. After boot the system has no internet access as ping commands fail. I'm able to turn the connection on just fine with nmcli c up eth1 which makes pings successful and has ifconfig report an ip address against eth1.

However, if I want to take the connection down again (with nmcli c down eth1), ifconfig no longer shows an ip address against the interface but pings keep suceeding. How come that's possible? What is it that I'm missing here?

print awk array and replace special characters with comma

Posted: 31 Aug 2021 07:39 AM PDT

I hope the title explains this correctly. I am currently trying to print out an array after counting unique values from a spreadsheet.

My awk command works correctly:

awk -F"," 'NR>1{col[$1,$9]++} END {for (i in col) printf("%s: %d\n", i, col[i])}' my_file.csv | sort  

When printing though I get a special character that looks like a question mark.

output

How do I print this with a comma + space between the year and the season.

eg: 1896, summer: 151

how to run history -a command at regular intervals automatically?

Posted: 31 Aug 2021 10:43 AM PDT

I am using bash shell and I execute history -a command once in a while manually. My typical shell session lasts for weeks if not for months and I rarely exit my shell session. Thus, I force writing my current session history to bash_history using history -a once in a while. I am thinking of writing an automated script to execute history -a regularly once a day. What would be the best way to accomplish this?

is `yes | rm -r` safer than `rm -rf`

Posted: 31 Aug 2021 08:47 AM PDT

I have heard many times that issuing rm -rf is dangerous since users can accidentally remove the entire system. But sometimes I want to remove a directory recursively without being asked every time. I am thinking about using yes | rm -r instead.

The thing I am thinking is that, is yes | rm -r safer than rm -rf? Or essentially they are the same?

How to edit /etc/printcap?

Posted: 31 Aug 2021 10:54 AM PDT

We recently changed domain and host name on a RHEL8 server from old.domain.name to more.better.name.

I happened to notice a reference in /etc/printcap to old.domain.name.

[user@box ~]# cat /etc/printcap   # This file was automatically generated by cupsd(8) from the  # /etc/cups/printers.conf file.  All changes to this file  # will be lost.  office_printer_123|office_printer_123:rm=old.domain.name:rp=office_printer_123:  [user@box ~]#   

Correct hostname shows

[user@box ~]# hostname  more.better.name  [user@box ~]#   

The server has been restarted a few times since changing the hostname.

I found zero other references to old.domain.name with

[user@box ~]# grep -r "old.domain.name" /etc/  [user@box ~]#   

old.domain.name is not found in /etc/cups/printer.conf

[user@box]# cat /etc/cups/printers.conf  # Printer configuration file for CUPS v2.2.6  # Written by cupsd on 2021-08-24 10:01  # DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING  <Printer office_printer_123>  UUID urn:uuid:e74ed8e4-e5e6-30b9-64b9-2283cc9c93e7  AuthInfoRequired none  Info office_printer_123  MakeModel HP LaserJet 600 M601 M602 M603 Postscript (recommended)  DeviceURI ipp://111.222.111.222  State Idle  StateTime 1629813648  ConfigTime 1618257051  Type 8425668  Accepting Yes  Shared Yes  JobSheets none none  QuotaPeriod 0  PageLimit 0  KLimit 0  OpPolicy default  ErrorPolicy stop-printer  </Printer>  [user@box]#   

How do I change what's in the printcap file? And where could it be pulling old.domain.name?

Capture picture after unlocking screen / logging in i3

Posted: 31 Aug 2021 07:52 AM PDT

Running Manjaro with i3wm, and my .i3/config has the following related to locking the screen:

# Lock screen  exec --no-startup-id xss-lock -- ~/.i3/lock.sh  bindsym $mod+Ctrl+l exec --no-startup-id i3exit lock  bindsym $mod+9 exec --no-startup-id blurlock  

The script lock.sh is:

#!/bin/sh  set -e  xset s off dpms 0 10 0  i3lock --color=4c7899 --ignore-empty-password --show-failed-attempts --nofork  xset s off -dpms  

Similar to this post I want to have a picture taken via a script every time the screen is unlocked. I've written a script that captures a picture from the local webcam, and this works perfectly fine - how do I alter the above setup to have the script run after unlocking my screen?

I hope this can be done at the level of the .i3/config rather than messing with pam.d files like the answer in the linked post.

Stuck in selecting columns using regex (in wazuh decoder)

Posted: 31 Aug 2021 08:58 AM PDT

I have this log but I don't know how to select few columns.

04.07.2021 12:11:31.801 [25760] info  MainForm  -  Database(s) loaded: CA_2021,beforetest,FL_2,FL_Jan_2021,jhon,DC_City_Jan_2021,Statetest,Benchmark_2021  

I used (\d\d\d\d) (\d+:\d+:\d+) and able to select

2021 12:11:31  

Can anyone help on selecting

2021 12:11:31 [25760] info FL_Jan_2021 DC_City_Jan_2021 Benchmark_2021  

https://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/regex.html

thunderbird: force encoding for all composed emails to unicode

Posted: 31 Aug 2021 10:33 AM PDT

I am using thunderbird 68.8. on Debian 10.

I have received an email in HTML format, with what looks to be greek ISO encoding (iso-8859-7)

When I click reply, the composed email is automatically set to same (Greek ISO) encoding, even though normally all my compose emails are in unicode.

How can I set to always compose all emails as unicode, regardless what the original email encoding was? I don't want to "inherit" some weird encoding that somebody else has sent me.

Normally, the emails I send are plaintext and unicode.

arch linux hdmi not detected

Posted: 31 Aug 2021 08:03 AM PDT

today I started my laptop, but my external display was not working. I ran the command xrandr:

Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767  eDP1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 340mm x 190mm     1366x768      59.97*+     1280x720      59.74       1024x768      60.00       1024x576      60.00    59.90    59.82       960x540       60.00    59.63    59.82       800x600       60.32    56.25       864x486       60.00    59.92    59.57       640x480       59.94       720x405       59.51    60.00    58.99       680x384       60.00       640x360       59.84    59.32    60.00    VIRTUAL1 disconnected (normal left inverted right x axis y axis)  

As you can see, there is no hdmi. When I run this exact same command on my other computer, it shows this:

Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767  eDP1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 340mm x 190mm     1366x768      59.97*+     1280x720      59.74       1024x768      60.00       1024x576      60.00    59.90    59.82       960x540       60.00    59.63    59.82       800x600       60.32    56.25       864x486       60.00    59.92    59.57       640x480       59.94       720x405       59.51    60.00    58.99       680x384       60.00       640x360       59.84    59.32    60.00   DP1 disconnected (normal left inverted right x axis y axis)  DP2 disconnected (normal left inverted right x axis y axis)  HDMI1 disconnected (normal left inverted right x axis y axis)  HDMI2 disconnected (normal left inverted right x axis y axis)  VIRTUAL1 disconnected (normal left inverted right x axis y axis)  

my os: Linux acer-a515 5.7.12-arch1-1 #1 SMP PREEMPT Fri, 31 Jul 2020 17:38:22 +0000 x86_64 GNU/Linux Can someone help me?

My RAID 1 always renames itself to /dev/md127 after rebooting | DEBIAN 10

Posted: 31 Aug 2021 07:42 AM PDT

PROBLEM

I create a RAID 1 configuration, I name it /dev/md1, but when I reboot, the name always changes to /dev/md127

Disable Internet Access on Eth0

Posted: 31 Aug 2021 09:05 AM PDT

I have a Raspberry with eth0 (192.168.0.2 / static) connected to a router (Fritz Box @ 192.168.0.1). The Router has internet connection. The Raspberry has a mobile usb stick with ppp connect to the internet. Actually if ppp is not connected the internet access from the Raspberry is through the Router over eth0. If ppp is connected the internet access is via ppp. if I del the default route for eth0 there is no internet connection if ppp is not connected and if ppp is connected internet connection is through ppp. So far everything fine. But if restart the raspberry it again has internet connection through eth0. I want to allow the raspberry internet connection only via ppp. eth0 just for internal communication like ssh. Any ideas how to configure that?

/etc/network/interfaces looks like:

source-directory /etc/network/interfaces.d  auto lo  iface lo inet loopback    auto eth0  iface eth0 inet static  address 192.168.178.2  netmask 255.255.255.0      allow-hotplug wlan0  iface wlan0 inet manual      wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf    allow-hotplug wlan1  iface wlan1 inet manual      wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf  

fish shell : exec format error

Posted: 31 Aug 2021 09:48 AM PDT

On an Ubuntu ($ uname -a : Linux kumanaku 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux), I just installed fish ($ fish --version : fish, version 2.7.1) using the following commands :

sudo apt-add-repository ppa:fish-shell/release-2  sudo apt-get update  sudo apt-get install fish  chsh -s /usr/bin/fish  echo /usr/bin/fish | sudo tee -a /etc/shells  

I can launch fish and use it but when I launch a simple shell file like :

echo "something"  

I got the following message :

$ ./myscript.sh    Failed to execute process './myscript.sh'. Reason:  exec: Exec format error  The file './myscript.sh' is marked as an executable but could not be run by the operating system.  

There's no shebang in my script. If I add #!/usr/bin/env fish, everything's ok (i.e. the script is successfully launched) but I'd like to avoid such a line to keep my script compatible with different shells.

Any idea ?

GPG cache options don't work

Posted: 31 Aug 2021 07:32 AM PDT

There is an option named default-cache-ttl that controls how long the agent will remember the password to the private key. However, when I put it in the config file it doesn't work - instead, gpg complains:

gpg: /home/jan/.gnupg/gpg.conf:8: invalid option  

My version of GPG is

$ gpg2 --version  gpg (GnuPG) 2.1.11  

Trying to mount and recover data from a DVD/recorder HDD

Posted: 31 Aug 2021 10:06 AM PDT

I have a old DVD/HDD recorder (Panasonic DMR-EH58) with RCA inputs & outputs etc. I want to recover all the recordings off its HDD. The HDD is a 2008 ATA/IDE 7200RPM Hitachi deskstar Model no:HDP725025GLAT80 250 GB has a DVD drive.

It has been used at a conference center for many years recording camera RCA input. It is in good condition but it is outdated so I am trying to copy the recordings to a computer. I also would like to recover the deleted files if possible as they would not have been overwritten yet.

I have borrowed a universal drive adapter and tried to mount it on both Windows 8.1 and ChaletOS Linux (Ubuntu based XFCE type distro). Windows showed it as a grayed F: drive and Linux did not auto mount it either.

GParted shows it as "/dev/sdb: unrecognised disk label":
GParted

Command line attempts follow:

joel@joel-laptop:~$ mount dev/sdb  mount: dev/sdb: No such file or directory    joel@joel-laptop:~$ sudo mount /dev/sdb /mnt/usbdisk  [sudo] password for joel:   mount: special device /dev/sdb does not exist    joel@joel-laptop:~$ mount dev/sdb  mount: dev/sdb: No such file or directory    joel@joel-laptop:~$ ls -alh /dev/disk/by-path/  total 0  drwxr-xr-x 2 root root 160 Apr 30 22:05 .  drwxr-xr-x 6 root root 120 Apr 30 18:41 ..  lrwxrwxrwx 1 root root   9 Apr 30 21:31 pci-0000:00:1f.2-ata-1 -> ../../sda  lrwxrwxrwx 1 root root  10 Apr 30 21:31 pci-0000:00:1f.2-ata-1-part1 -> ../../sda1  lrwxrwxrwx 1 root root  10 Apr 30 21:31 pci-0000:00:1f.2-ata-1-part2 -> ../../sda2  lrwxrwxrwx 1 root root  10 Apr 30 21:31 pci-0000:00:1f.2-ata-1-part3 -> ../../sda3  lrwxrwxrwx 1 root root  10 Apr 30 21:31 pci-0000:00:1f.2-ata-1-part5 -> ../../sda5  lrwxrwxrwx 1 root root  10 Apr 30 21:31 pci-0000:00:1f.2-ata-1-part6 -> ../../sda6  
  • Root directory is dev/sda5
  • Swap is dev/sda6
  • Windows is dev/sda1
  • Spare data partition is dev/sda2

Looks like an unsupported file system error...

How can I monitor the length of the accept queue?

Posted: 31 Aug 2021 08:23 AM PDT

I have a hypothesis: sometimes TCP connections arrive faster than my server can accept() them. They queue up until the queue overflows and then there are problems.

How can I confirm this is happening?

Can I monitor the length of the accept queue or the number of overflows? Is there a counter exposed somewhere?

"psql: could not connect to server: No such file or directory"

Posted: 31 Aug 2021 07:32 AM PDT

Actually, I installed PostgreSQL 9.4 (with postGIS extension), and when installed, everything used to work fine.

As said on many tuts, I've set the /data folder, checked configuration files, and so on. Worked on other projects so I did not work on psql for a while But when installation was done, it used to work correctly, I made a test database, initialized postgres user, etc.

Now, I try to start psql (with "default" postgres user) and cannot connect! Start/stop/restart service do not change anything...

Result of "psql" command (with postgres user) :

psql: could not connect to server: No such file or directory  Is the server  running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?  

When I check service status, I get this :

postgresql.service - PostgreSQL RDBMS  Loaded: loaded (/lib/systemd/system/postgresql.service; enabled)  Active: active (exited) since tue 2016-05-24 09:24:13 CEST; 3s ago  Process: 5658 ExecStart=/bin/true (code=exited, status=0/SUCCESS)  Main PID: 5658 (code=exited, status=0/SUCCESS)  

Starting/Stopping/Restarting service with command

sudo service postgresql start (or restart or stop)  

Does not change anything to actual system behaviour..

Log says:

DETAIL:  Permissions should be u=rwx (0700).  FATAL:  data directory "/var/lib/postgresql/9.4/main" has group or world access  

OSCHINA 社区最新专区文章

OSCHINA 社区最新专区文章


MySQL 学习三:来教你如何完全卸载掉本地“头大的” MySQL 数据库!

Posted: 31 Aug 2021 02:45 AM PDT

文章目录 前言 一、控制面板卸载 MySQL 二、删除 MySQL 数据库安装文件夹 三、打开注册表编辑器 四、删除残留注册表文件 五、删除系统盘残留数据文件 总结 前言 如果我们 MySQL 数据库密码遗忘需要重新安装 MySQL 数据库时,就需要先卸载掉本地的文件。而 MySQL 并不是像其他应用程序一样容易卸载,这个步骤是相当繁琐的...

带你走进MySQL全新高可用解决方案-MGR

Posted: 30 Aug 2021 07:31 PM PDT

一、初识MGR 相信很多人对MGR这个词比较陌生,其实MGR(全称 MySQL Group Replication 【MySQL 组复制】)是Oracle MySQL于2016年12月发布MySQL 5.7.17推出的一个全新高可用和高扩展的解决方案。具备以下特性: 高一致性,基于原生复制及Paxos协议的组复制技术,并以插件的方式提供,提供一致数据安全保证; 高容错性,只要...

MySQL中timestamp和datetime,你用的对么?

Posted: 30 Aug 2021 06:07 PM PDT

在MySQL中,时间是咱们用到最多的类型,建表时,对于时间字段类型的选择,你是如何选择的呢?有人会说timestamp,也有人会说datetime,那么我们到底如何选择呢,它们又有什么区别?今天就和大家一起来看看。 一、MySQL中如何表示当前时间? 其实,表达方式还是蛮多的,汇总如下: CURRENT_TIMESTAMP CURRENT_TIMESTAMP(...

Apache Tika 2.1.0 发布,内容检测和分析框架

Posted: 30 Aug 2021 03:34 PM PDT

Apache Tika 2.1.0 现已发布,这是一个用于检测和提取元数据和结构化文本内容的工具包。 主要更新内容 优化了 tika-parsers-extended 的打包 当没有指定编码时,Tika 应用程序会以 UTF-8 格式写入 将 PDF 的默认渲染策略从 NO_TEXT 更改为 ALL 修复了当用户指定了 tesseract 路径但未同时指定 TesserData 路径时,指向错...

DBeaver 21.2.0 发布,可视化数据库管理平台

Posted: 30 Aug 2021 02:36 PM PDT

DBeaver 21.2.0 现已发布。DBeaver是一个免费开源的通用数据库工具,适用于开发人员和数据库管理员。 主要更新内容 数据传输: 添加了值绑定模式切换器(注意会影响性能) 修复了自动列映射 修复了从文件/关系表导入到面向文档的数据库 优化了列长检测 SSH tunnel:添加了跳转服务器支持 任务管理视图:添加了任务文件夹...

pgmoneta 0.5.0 发布,PostgreSQL 备份/恢复解决方案

Posted: 30 Aug 2021 02:19 PM PDT

特性 #20 添加 retain/ expunge 命令以保留备份直到被 expunge 或 deleted #21 支持 postgresql.conf 和 recovery.conf 中的各种 recovery_target 设置 #22 如果 "follow" 的服务器失败,则为服务器添加功能以启动 WAL streaming 增强 #19 显示在 list-backup 和 details 中生成了多少 WAL #24 将正在进行的备份标记为...

Recent Questions - English Language & Usage Stack Exchange

Recent Questions - English Language & Usage Stack Exchange


How to request relive early

Posted: 31 Aug 2021 09:38 AM PDT

I have received a reliving date from my current employer but actually, it's a holiday and also it's Monday .so, I need to request them to relive on friday

How to positively describe somebody who misled you by accident?

Posted: 31 Aug 2021 09:51 AM PDT

Consider this scenario, of two people talking:

A: Did you go to the shops?
B: No, it was closed even though you said it would be open
A: Oh no, I misled you!
B: No, you didn't mislead me, you just _____ me.

'A' was mistaken, but what did they did wasn't mislead 'B' (intentionally), but made a genuine mistake in trying to help out. I want 'B' to imply the help was appreciated even if it didn't help out in the end.

If picture belongs to someone , Can we say? "Send me a picture of Sally's", "This is a picture of Sally's"

Posted: 31 Aug 2021 08:38 AM PDT

If you use a noun rather than a pronoun. "Send me a picture of Sally", I want a picture that shows what Sally looks like.

But is this correct? "Send me a picture of Sally's", I want a picture that belongs to Sally or that was taken by Sally.

If this is correct then whether we can also say."This is the picture of Sally's (as in, this picture belongs to Sally or was taken by Sally)

Does capitalisation change when a word moves from proper noun to adjective?

Posted: 31 Aug 2021 07:32 AM PDT

For the sake of this question I'll use the word Linux as an example, but I really want to ask about the principle generally.

The word Linux started as the name of an operating system kernel written by Linus Torvalds. The name is a contraction of a previous operating and the author's name.

In language the word is commonly use as an adjective. Eg:

Linux system

or

Linux machine

There's a subtlety here that a term like "Linux system" doesn't just refer to systems from a specific vendor in the way you might expect with "Ford car". It is often used to refer to systems with specific behaviour. Though that use may be technically incorrect - this is a language question not a technical one.

This has got me wondering what the rules are around when (if ever) the capitalisation should change from "Linux" to "linux".

Similarly I'm interested in other transitions such as English people will use a phrase

hoover the carpet

to mean cleaning a carpet with any vacuum cleaner, not just one from the brand Hoover.

There's clearly a tipping point at which the original proper noun becomes lost and only the other uses remain. However I was wondering if it's permissible before that to begin to use lower case instead of upper case.

Is "I'm so hot" a good expression when I'm talking about the weather?

Posted: 31 Aug 2021 05:52 AM PDT

I'm told that I can't say "I'm so hot" because it can also mean "I'm so sexy"(so boys may misunderstand that I'm picking up them?), and the alternatives might be "It's so hot" or "I feel so hot".

I wonder if the native speakers would think "I'm so hot" is a good expression when I'm talking about the weather. Or would you advise me to use "It's so hot" or "I feel so hot" instead of "I'm so hot"?

btw: if it is, is directly saying "I'm so hot" a good picking up topics? lol

Is there a word for the pattern on pancakes and grilled cheese?

Posted: 31 Aug 2021 06:06 AM PDT

I'd like to know if there's a word to describe the somewhat similar pattern that appears when you brown pancakes and buttered slices of bread on a pan. Does "freckled" work?

pancake

grilled cheese

Question on semantic roles [closed]

Posted: 31 Aug 2021 05:46 AM PDT

What are the semantic roles of the subject and direct object in the below sentence?

He has a car.

If I am not mistaken, 'a car' is a theme (at any rate, according to Wikipedia [see https://en.m.wikipedia.org/wiki/Thematic_relation, where it is stated that 'two children' is a theme in the sentence 'He has two children]. But the explanation here is not very clear.

How to use the word "had"? [migrated]

Posted: 31 Aug 2021 01:53 AM PDT

For example,

Yesterday evening they did not have dinner with their teacher.

How can it be changed into past perfect tense?

How did "realize" change from "make real" to 2 new senses: 'understand', 'come to understand'?

Posted: 31 Aug 2021 09:33 AM PDT

Millar concedes that "It is not at all obvious how this change could have occurred", and he's a historical linguistics professor! Alas he doesn't expatiate it. Can someone please expound this semantic shift then?

      It is not always easy to understand why a word changes its meaning. The word realize formerly meant 'make real', and still sometimes does, as in She finally realized her childhood ambition. But the word has acquired two new senses: 'understand', as in I realize that time is short, and 'come to understand', as in She suddenly realized that she had forgotten her keys. It is not at all obvious how this change could have occurred [Embolding mine], since the new senses actually require a different construction (a that-complement clause) from the old sense (a simple transitive construction). The change in meaning has been so dramatic that few people are now aware that realize is related to real.

Revised by Robert McColl Millar, Trask's Historical Linguistics (2015 3e), pp 8-9. Trask died in 2004.

Graduation in/from/at

Posted: 31 Aug 2021 12:58 AM PDT

I read this sentence somewhere

After his graduation in the field of medicine at Harvard University, he was offered a great job.

Is this sentence grammatically correct? Aren't we supposed to use the preposition from instead of at and say:

After his graduation in the field of medicine from Harvard University, he was offered a great job

Why do we sometimes omit and sometimes retain the conjunctions "because/while/when etc" when reducing adverb clauses?

Posted: 31 Aug 2021 12:55 AM PDT

We can reduce this sentence

"Because she has a test next week, she is studying very hard." (1-1) -> "Having a test next week, she is studying very hard." (1-2)

"Before he bought the house, he did a lot of research." (2-1)-> "Before buying the house, he did a lot of research." (2-2)

"After she had lunch, she went back to work." (3-1)-> "After having lunch, she went back to work." (3-2)

"While I was walking home from work, I saw an old friend" (4-1) -> "While walking home from work, I saw an old friend" (4-2)

"As I was walking home from work, I saw an old friend" (5-1) -> "Walking home from work, I saw an old friend" (5-2)

We know that a gerund plays a role of a noun and a present participle plays a role of an adjective. But a noun or an adjective can play a role of an adverb.

Is "Having a test next week" in (1-2) a gerund or a present participle?

Is "before" in (2-2) a preposition and "buying the house" is a gerund?

Is "after" in (3-2) a preposition and "having lunch" is a gerund?

Is "while" in (4-2) a preposition and "walking home from work" is a gerund?

Is "Walking home from work" in (5-2) a gerund or a present participle?

Why do we sometimes omit and sometimes retain the conjunctions "because/while/when etc" when reducing adverb clauses?

In 17C. English, why could the present progressive be used on inanimate Objective Functional Roles?

Posted: 31 Aug 2021 12:45 AM PDT

  1. What's the Functional Role of the nouns in these sentences? OBJECTIVE? I don't think INSTRUMENTAL.

(ii) INSTRUMENTAL: The inanimate force of object causally involved in the state of action identified by the verb. [John used the hammer to break the window.] [The hammer broke the window.]

Alan Cruse (died 2020), Meaning in Language (2011 3e), p 288.

(vi) OBJECTIVE: The inanimate entity affected by the action or state identified by the verb: [Mary opened the door.] [The door opened.]

Op. cit. p 289.

  1. Now here's my main question. Below, Millar and McWhorter don't expatiate why "there's an English-speaker alive who regards these as other than normal", and utilizing the present progressive on Inanimate Objectives "is almost incomprehensible to us at first reading". To wit, why did 17th-century Anglophones like Samuel Pepys find this natural?

      Lest you suspect that my example of hopefully might be atypical, let's look at something quite different. Consider these examples:

1.9 My car is being repaired.
1.10 My house is being painted.
1.11 This problem is being discussed at today's meeting.

Anything strange here? I doubt it – I don't think there's an English-speaker alive who regards these as other than normal.
      But it wasn't always so. Until the end of the eighteenth century, this particular construction did not exist in Standard English, and an English-speaker would have had to say My car is repairing, My house is painting and This problem is discussing at today's meeting – forms that are absolutely impossible for us now. (For example, the seventeenth-century civil servant Samuel Pepys wrote in his famous diary the sentence 'I met a dead corpse of the plague, just carrying down a little pair of stairs', which is almost incomprehensible to us at first reading – we have to say just being carried.)
      This curious (to us) construction was the only possibility in the eighteenth century, and when a few innovating speakers began to say things like My house is being painted, the linguistic conservatives of the day could not contain their fury. Veins bulging purply from their foreheads, they attacked the new construction as 'clumsy', 'illogical', 'confusing' and 'monstrous'. But their efforts were in vain. Today all those who objected to the 'illogical' and 'monstrous' new form are long dead and the traditional form they defended with such passion is dead with them. The 'illogical' and 'monstrous' new form has become the only possibility, and even the most careful and elegant writer of English would not dream of trying to get away with the defunct older form. And you are probably marvelling at this eighteenth-century fury and wondering what all the fuss was about, just as the next generation will read in puzzlement about the attacks on hopefully and wonder what all the fuss was about.

Revised by Robert McColl Millar, Trask's Historical Linguistics (2015 3e), pp 8-9. Trask died in 2004.

At classier affairs one would also have been advised to avoid popping up with louche vulgarities such as The house is being built — until then, one said The house is building — and if you said stacked and fixed the way we say them instead of "stack-ed" and "fix-ed," to many it sounded like you were clipping the end of the word!!

McWhorter, Our Magnificent Bastard Tongue The Untold History of English (2009), pp 74-5.

What is the name of the literary technique for this?

Posted: 31 Aug 2021 01:01 AM PDT

So the common adage is "The apple never falls far from the tree."

So what would you call: "Sometimes the apple falls very far from the tree."

It points out an exception to the rule. What is the name of the literary device for this?

Thanks!

He went to the cinema if a good movie was "on". He went to the theater if a good play was "on" or "up"?

Posted: 31 Aug 2021 07:12 AM PDT

A good movie was "on", sounds alright. A good play was "on" doesn't sound right to me. Does "up" work like coming up/scheduled/soon to appear?

The correct use of was or were, when we group items and people

Posted: 30 Aug 2021 10:51 PM PDT

Here is an example in the Cambridge English Dictionary.

A string quartet was playing Mozart.

Is this correct? or should it be "A string quartet were playing Mozart. Is a quartet an "it" or a "they"?

The definition of a "Quartet" being

a group of four people who play musical instruments or sing as a group:

If we were to presume that the quartet was playing, then, would it not then follow, if we are not in a "Subjunctive Mood", that we should say

"That pair of black trousers was too short" as opposed to "That pair of black trousers were too short"?

Even more confusingly, in our "soirée musicale", we seem to be dehumanising people, relegating them to being mere objects," whilst our trousers seem to be given the benefit of the doubt, even if "they" were too short". Should not a musician's humanity take preference over a group's singularity?

How to express "at least one" or "at least some" (of a countable or uncountable collection respetively), as in antivacuous statements?

Posted: 30 Aug 2021 10:18 PM PDT

Discrete (countable) case example: All/Some of the trees on this block are oak. [And there is at least one oak tree on the block, but possibly two or more.]

Continuous (uncountable) case example: All/Some of the milk in the fridge is spoiled. [And at least some small volume of milk remains in said fridge.]

Note that "all" typically entails "some", unless interpreting 'some' as "some but not all" (more than none but less than all) instead of "at least some" (up to all). The semantic intent here is to leave it intentionally ambiguous, in a similar way that "sheep" can refer to a singular sheep or multiple sheep (whereas 'single sheep' vs 'sheeps' is a possible resolution where explication is desired), as contrasted to 'cat' vs 'cats' (or 'tree' vs 'trees') which can have the opposite potential problem trying to be addressed.

At any rate, I'm wondering how linguistically to express existence unto some object or objects (quantity = cardinality or amount := >0) possessing a common set of characteristic[s]. I am also wondering if there is an optimal way to express similar concept with a vacuous existence status explicitly, e.g. "Some\All our milk from last month is spoiled [although there might not be any of said milk remaining]".

Semantic roles of 'direct object'

Posted: 31 Aug 2021 01:21 AM PDT

What are the primary semantic roles of 'direct object'? In particular, I was wondering what the semantic roles of 'direct object' are in such sentences as:

They crossed the river.
He promised her that he would do it.
He did not mention the matter at all.
She left her room.
He would say nothing.
They ate the pie.

Is this the correct use of percentages? "600% smaller"

Posted: 31 Aug 2021 09:53 AM PDT

"600% smaller when compared to GIF"

This doesn't make sense. I can understand 600% larger (it is 6 times larger), but not 600% smaller. If it is acceptable English, what does it mean? 1/6 the size? I am seeing this construct more and more often.

What does 'only' represent in following sentences?

Posted: 31 Aug 2021 04:08 AM PDT

What does the word 'only' represent in the following sentences:

  1. I can only dream of becoming someone like Dr. Stone.

  2. I can only do this for so long.

Is it correct to say: "I got plunged into a mass of struggling bodies that were swimming..."

Posted: 31 Aug 2021 07:01 AM PDT

Is it correct to say: "I got plunged into a mass of struggling bodies that were swimming...". My doubt is about the correctness of the expression "to get plunged".
Thank you for your help!

Having + past tense as a subject in a sentence?

Posted: 30 Aug 2021 10:04 PM PDT

is it possible to use the form "having + past tense" as a subject in a sentence? For example, is it grammatically correct to say:

Having applied at the right time resulted in getting an admission.

Is having applied considered the subject in this sentence? My gut feeling tells me this sentence is correct, but I would like to be 100% sure. Thank you for help.

Best regrads, Kate

Type of usage/accuracy

Posted: 31 Aug 2021 03:07 AM PDT

As the boy tames the wild bird, it evokes pleasure in him away from his hardship in society; the bird is bettering us here.

verb gerund or present participle: bettering

improve on or surpass (an existing or previous level or achievement).  

Bird (animal) substituting human failure: that is what it means.

Can this clause be reduced as the bird bettering us here and use a comma instead of a semi-colon.

Or is that wrong.

Use of articles - I passed with a/the percentage of 80?

Posted: 31 Aug 2021 12:01 AM PDT

If I want to write I got 80 percent, which of these two is the correct way to do so?

  1. I passed with a percentage of 80.

  2. I passed with the percentage of 80.

How to positively describe something, such as a war memorial, which doesn't invoke positive feelings?

Posted: 31 Aug 2021 12:45 AM PDT

If I wanted to express that something such as a holocaust memorial was good to visit I would want to avoid saying something such as "it was great" or "I enjoyed visiting it".

Is there a word that can positively describe something like a memorial without suggesting it was pleasurable?

Some words I've considered, but do not quite fit my needs:

  • Tasteful: Something could be tasteful, and I could still wish I hadn't visited it.

  • Thought provoking has the same issue, as it doesn't really describe the quality of the experience.

Should I describe a book I've read in the past or present tense?

Posted: 31 Aug 2021 02:20 AM PDT

For example, should I say, "Recently, I finished a novel that was called The Pyrates. The plot of it was that a hero called Avery was sent by the King of England blah, blah, blah."

OR

"Recently I finished a novel that is called The Pyrates. The plot of it is that a hero called Avery is sent by the King of England blah, blah, blah."

If the sentence should be a mixture of past and present tense verbs, be notify me. For example, it was called The Pyrates, the plot of it is that blah, blah, blah,

How can one choose between "tunable" and "tuneable"?

Posted: 31 Aug 2021 08:05 AM PDT

Both "tunable" and "tuneable" seem to be in common usage.

Is there a source which can be used to justify a preference for one or the other for general usage, possibly as a function of whether one is considering a particular nationality or dialect of English?

What's the etymology of the word "zilch"?

Posted: 31 Aug 2021 09:35 AM PDT

What's the origin of the word "zilch" and how it came to mean nothing?