Friday, July 8, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How are ulimits determined for processes running in unpriviledged containers?

Posted: 08 Jul 2022 12:08 PM PDT

Recently, while I was building something in an unprivileged nspawn container (for CI), I repeatedly ran into errors related to limits on the number of open files.

I tried:

  1. increasing ulimit -n in the container and host, and tweaking /etc/limits.conf. But, no dice - higher limits were reported, but the errors still occurred.
  2. Setting LimitNOFILE in the .nspawn file for the container to a very high value. Still nothing (with the nspawn invocation including --settings=override).
  3. setting LimitNOFILE=infinity in ulimit.conf, following this advice: https://serverfault.com/questions/848088/how-to-set-max-file-descriptors-for-a-container

What worked in the end was switching to a privileged container by setting PrivateUsers=off, following the conversation here: https://bbs.archlinux.org/viewtopic.php?id=232804

So, my question is: HOW does usernamespacing interact with ulimits, and WHY did this fix my problem when the previous steps didn't?

Bonus points for a good mental model that will help the next person who has to debug this kind of thing.

set different wallpaper for each desktop in ubuntu?

Posted: 08 Jul 2022 12:06 PM PDT

In Ubuntu if you press Ctrl+Alt+Arrow Down, a new desktop would be created. However, it seems all desktops share the same wallpaper. Is it possible to set a different wallpaper for each desktop?

iostat returns disk utilization greater than 100% while profiling a Beaglebone Black board

Posted: 08 Jul 2022 11:31 AM PDT

I need to profile the performance of software running on a BeagleBone Black (BBB). The BBB has an ARM Cortex-A8 up to 1GHz frequency, 512MB RAM, and 4GB eMMC onboard flash storage. You can find more information here: https://beagleboard.org/black

The BBB runs Debian bullseye booted from a 14GB MicroSD:

debian@BeagleBone:~$ uname -a  Linux BeagleBone 5.10.109-ti-r45 #1bullseye SMP PREEMPT Fri May 6 16:59:02 UTC 2022 armv7l GNU/Linux  

Problem

As first trial, I'm running in parallel iostat with dd:

dd if=/dev/urandom of=~debian/ddtest/200MBfile bs=1M count=200 & iostat -xdz 1 20

I don't understand why iostat returns utilization values greater then 100%. I'm getting the metrics each second specifying 1 as argument in the command line. This is an excerpt of what I see in the terminal:

Device            r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz     d/s     dkB/s   drqm/s  %drqm d_await dareq-sz     f/s f_await  aqu-sz  %util    mmcblk0          0.00      0.00     0.00   0.00    0.00     0.00   18.00   9216.00     0.00   0.00 1062.00   512.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00   19.12  92.80     Device            r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz     d/s     dkB/s   drqm/s  %drqm d_await dareq-sz     f/s f_await  aqu-sz  %util    mmcblk0          0.00      0.00     0.00   0.00    0.00     0.00   16.00   8192.00     7.00  30.43 2058.25   512.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00   32.93 101.20     Device            r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz     d/s     dkB/s   drqm/s  %drqm d_await dareq-sz     f/s f_await  aqu-sz  %util    mmcblk0          0.00      0.00     0.00   0.00    0.00     0.00   25.00  12800.00     0.00   0.00 2295.64   512.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00   57.39 103.60    Device            r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz     d/s     dkB/s   drqm/s  %drqm d_await dareq-sz     f/s f_await  aqu-sz  %util    mmcblk0          0.00      0.00     0.00   0.00    0.00     0.00   33.00  15908.00     0.00   0.00 1136.58   482.06    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00   37.51  89.60  

mmcblk0 is the name of the 14GB memory (as stated by lsblk).

I've downloaded sysstat, namely the package including iostat, directly from https://packages.debian.org/stable/sysstat and installed the version 12.5.2-2:

sudo apt list | grep sysstat sysstat/stable,now 12.5.2-2 armhf [residual-config]

I checked the source code in sysstat and I saw that the utilization is computed at line 381 of rd_stats.c: xds→util = S_VALUE(spd→tot_ticks, sdc→tot_ticks, itc);

S_VALUE is a MACRO defined at line 154 of common.h: #define S_VALUE(m,n,p) (((double) ((n) - (m))) / (p) * 100)

Each second iostat reads the ms spent doing IO from /proc/diskstats. The variable sdc->tot_ticks represents the last value read, sdp->tot_ticks the one read the previous one, while itc is the time interval we set from the command line (i.e., one second).

I cannot understand why iostat returns values greater than 100%. I noticed that the time spent doing IO (sdc->tot_ticks - sdp->tot_ticks) is often greater than itv. My guess is that between two /proc/diskstat reads, iostat does other disk operations or that it is preempted by the scheduler.

What do you think?

Thanks.

VLC Crashing when loading any video

Posted: 08 Jul 2022 10:57 AM PDT

When trying to open any video in my Linux distro, be it an mp4 file or movie ISO, VLC would immediately crash. None of the current resources online helped my case. Does anyone have any fixes?

IP tables forwarding with initial delay

Posted: 08 Jul 2022 10:25 AM PDT

I have a situation where I would like to forward traffic on a machine to another IP, but with an initial connection delay of x seconds. More specifically, I have a rule like

iptables -t nat -A POSTROUTING -p tcp --dport 3306 -d 1.1.1.1  -o eth0 -j MASQUERADE  

I want that rule to take effect immediately, but I also want to delay actually sending traffic to 1.1.1.1 for x seconds, so clients would see a delay of up to x seconds in getting a response from 1.1.1.1, but only initially. Is there a way to achieve this with iptables (or any other unix networking tools)?

Malformed hostname in an MX record, possible?

Posted: 08 Jul 2022 11:41 AM PDT

I'm wondering if it's possible to publish (and receive) a malformed hostname (e.g. a hostname starting with a digit or with a hyphen, etc.) in MX lookups? Does the DNS server usually validate MX records before accepting them?

For example,

  • 0mx.example.com
  • -host.domain.com
  • host. domain.com

Even if it's not allowed, let's assume that a malformed hostname was published somehow. Can I assume that a "good" DNS server (e.g., Google DNS) will not forward such a malformed hostname in MX lookup?

I'm implementing something relevant and need to know if I can "trust" MX lookups to return well-formatted hostnames all the time.

PXE server on centOS 7 to network boot to a separate physical client machine with no virtualization

Posted: 08 Jul 2022 09:20 AM PDT

I am trying to setup a PXE server on my laptop on CentOS 7 to network boot to a separate physical client machine with no virtualization, following the tutorial on: https://www.linuxtechi.com/configure-pxe-installation-server-centos-7/#comment-35567

All of the configuration files and setup procedures are from this website. I also received some help from the user telcoM from a previous question I posted: "systemctl start dhcpd.service" command not working for PXE server setup virtual

There are the files that were edited based on telcoM's suggestions.

/etc/dhcp/dhcpd.conf

# internal subnet for my DHCP Server  subnet 192.168.1.0 netmask 255.255.255.0 {  range 192.168.1.21 192.168.1.151;  option domain-name-servers 192.168.1.1;  option domain-name "pxe.domain.example";    # this should match the IP address of the virbr0 interface  option routers 192.168.1.1;    option broadcast-address 192.168.1.255;  default-lease-time 600;  max-lease-time 7200;    # IP of PXE Server; this should also match the IP address of the virbr0 interface  next-server 192.168.1.1;    filename "pxelinux.0";  }  

Virsh net-edit default

Terminal command

For /etc/libvirt/qemu/networks

<network>    <name>default</name>    <uuid>6dbd4a13-100e-4f14-8ad4-01908d634355</uuid>    <forward mode='nat'/>    <bridge name='virbr0' stp='on' delay='0'/>    <mac address='52:54:00:24:7e:22'/>    <ip address='192.168.1.1' netmask='255.255.255.0'>      <dhcp>        <range start='192.168.1.2' end='192.168.1.224'/>      </dhcp>    </ip>  </network>  

With telcoM's advice and edits, I was able to get through the tutorial to:

Step:7 Boot the clients with pxe boot option

I connect the PXE server laptop to my separate physical client machine, I turn on the server laptop first to load it up. I manually turn on xinetd, dhcp, and vsftpd according to "Step:6 Start and enable xinetd, dhcp, vsftpd service."

Then I turn on the separate client machine and I receive the following message when booting up:

  Initializing and establishing link    XE-E01: Media test failure, check cable    XE-M0F: Exiting Intel Boot Agent.  

[This message repeats itself]

What configuration files do I need to edit and what do I need to change/add/remove in those configuration files to make the PXE server laptop with separate physical client machine with no virtualization setup to actually work?

disable S0 standby and enable S3 on ubuntu?

Posted: 08 Jul 2022 09:06 AM PDT

This article explains how to disable S0 and replace it by S3 on windows: https://www.notebookcheck.net/Useful-Life-Hack-How-to-Disable-Modern-Standby-Connected-Standby.453125.0.html

What are the equivalent commands for Ubuntu? How to check what standby is currently used on Ubuntu and how to change it?

can sed add a new line after matching a pattern while not editing line pattern is on?

Posted: 08 Jul 2022 10:12 AM PDT

I need to find a way to add a line to files after a pattern, but I don't want to edit the line the pattern is on.

For example, my original file will look something like

group: misc  host: server1  job: internal  

and I'd like to get it to something like

group: misc  host: server1  role: webserver  job: internal  

The difficulty is i need to match on "host:" but the name after host will be different every time. I haven't found a way for sed to respect the rest of the line, and instead dumps the new lines immediately after finding "host:" leaving the hostname orphaned after the new line.

how to combine the two file by awk

Posted: 08 Jul 2022 09:07 AM PDT

Here is my 1.file

             id               a1               a2               a3               a4  

Here is my 2.file

             DW  1  2  3  4               KD  2  3  4  5               LBJ 4  4  4  4  

I want to get my final file

             id  a1 a2 a3 a4               DW  1  2  3  4               KD  2  3  4  5               LBJ 4  4  4  4                

And I try to

cat 1.file |tr "\n" "\t"|sed -e 's/,$/\n/'  

and then

cat 1.file 2.file >> fina.file  

but I want to get the awk way

What option provide to CMake to demangle stackframe output?

Posted: 08 Jul 2022 09:33 AM PDT

To print the stackframe this method is used. But it prints mostly executable name with addresses.

0   ./fish(+0xa307b) [0x556c9198c07b]  1   ./fish(+0xb0cf2) [0x556c91999cf2]  2   ./fish(+0xb218a) [0x556c9199b18a]  3   ./fish(+0x151c2) [0x556c918fe1c2]  4   /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7fb0f2973d90]  5   __libc_start_main + 128  6   ./fish(+0x16ff5) [0x556c918ffff5]  

The project itself uses CMake, generating with -DCMAKE_BUILD_TYPE=Debug doesn't help.
What option do I need to provide to CMake to get more clear output?

How do I get the version of a command inside a bash script

Posted: 08 Jul 2022 10:43 AM PDT

So as the question suggests, I want to get the version of a command inside a bash script, instead of using the terminal.

I know that all available commands are present as files inside the directory /usr/bin. But it does not give the versions and it gives some funny information when you use cat for one of the (command) files.

for example - cat /usr/bin/man gives -

funny output

What is this and how do I get the version?

I am using Ubuntu 20.04.

I know its a stupid question to ask here but I wasn't able to find anything :/

Supposedly the final edit - the accepted answer works for me, I am using the function.

I did also realise later that something like foo --version will work too

But, if you are using a variable to store the version then you need to be careful about the syntax, I was doing it the wrong way. Thanks to @Romeo Ninov for pointing out that
foo --version works too.

I am really sorry for these silly mistakes.

Why does `ip route replace` add a duplicate new route?

Posted: 08 Jul 2022 09:00 AM PDT

These are my ip routes,

default via 172.16.42.1 dev ens5 proto dhcp src 172.16.42.248 metric 100   default via 172.16.42.1 dev ens3 proto dhcp src 172.16.42.79 metric 100   default via 10.2.64.1 dev ens4 proto dhcp src 10.2.69.64 metric 100  

I used ip route replace with the intent to lower the metric and raise the priority, like this,

sudo ip route replace default via 10.2.64.1 dev ens4 metric 90  

However, this didn't replace the route, it added to it, now I've got,

default via 10.2.64.1 dev ens4 metric 90   default via 172.16.42.1 dev ens5 proto dhcp src 172.16.42.248 metric 100   default via 172.16.42.1 dev ens3 proto dhcp src 172.16.42.79 metric 100   default via 10.2.64.1 dev ens4 proto dhcp src 10.2.69.64 metric 100  

Is there anyway to change the metric on this line,

default via 10.2.64.1 dev ens4 proto dhcp src 10.2.69.64 metric 100  

Without adding a new route?

Exclude matched rows based on first column of two files

Posted: 08 Jul 2022 09:49 AM PDT

I have two tab delimited text file. The larger main file 1 with multiple columns and the file 2, smaller file, that only share the first two columns for limited rows with file 2.

I want a file 3 as an output that exclude the rows that match between first column of these two files and print all other columns in file 1 as well.

I tried grep -vf but doesn't seem to work. please also note that I need match for both column.

file 1:

BP  CHR SNP REF ALT A1  OBS_CT  OR  LOG(OR)_SE  Z_STAT  P  1650048 1   rs112618790 C   T   T   12387   1.00246 0.0877604   0.0279678   0.977688  1856473 1   rs6684487   G   A   A   12387   1.02222 0.0836593   0.262689    0.79279  

file 2:

BP  CHR  1650048 1  1650483 1  

output (file 3):

BP  CHR SNP REF ALT A1  OBS_CT  OR  LOG(OR)_SE  Z_STAT  P  1856473 1   rs6684487   G   A   A   12387   1.02222 0.0836593   0.262689    0.79279  

Why does awk -F work for most letters, but not for the letter "t"?

Posted: 08 Jul 2022 11:50 AM PDT

 July 2022      mac os Monterey V12.1      awk --version 20200816     GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin21)  

Why does awk -F work for most letters, but NOT for the letter t? I have the solution, but I would like to understand why awk fails for the letter t.

echo " kount t's in total  <== FAILS"  echo "total" | awk -F "t" '{print NF-1}'    echo " kount o's in toot"  echo "toot"  | awk -F "o" '{print NF-1}'    echo " kount e's in tweet"  echo "tweet"  | awk -F "e" '{print NF-1}'    echo " use gsub(regexp, replacement [, target])  "  echo "toot" | awk '{print gsub(/t/, "")}'   

How to convert aggregated data to narrow 2 columns table by the first column of numbers

Posted: 08 Jul 2022 12:01 PM PDT

I have a big data with rows like this:

0   1 5 6 4  1   4 5 2 3  5   4 5 6 7  

This data is in txt format And I want to create new file and convert this data into 2 columns like this:

0 1  0 5  0 6  0 4  1 4  1 5  1 2  1 3  5 4  5 5  5 6  5 7  

I will appreciate any help!

Virt-Manager internal error: process exited while connecting to monitor

Posted: 08 Jul 2022 11:46 AM PDT

Arch Linux

I created a qcow2 on the other drive using Virtual Manager.

I'm trying to use another drive for my VM's, But When i try to create a new VM From an ISO i get:

'internal error: process exited while connecting to monitor: 2022-05-22T20:39:03.671212Z qemu-system-x86_64: -blockdev {"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage","backing":null}: Could not open '/run/media/myuser/New Volume/VMS/kali.qcow2': Permission denied'

Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper callback(asyncjob, *args, **kwargs) File "/usr/share/virt-manager/virtManager/createvm.py", line 2008, in _do_async_install installer.start_install(guest, meter=meter) File "/usr/share/virt-manager/virtinst/install/installer.py", line 695, in start_install domain = self._create_guest( File "/usr/share/virt-manager/virtinst/install/installer.py", line 637, in _create_guest domain = self.conn.createXML(initial_xml or final_xml, 0) File "/usr/lib/python3.10/site-packages/libvirt.py", line 4408, in createXML raise libvirtError('virDomainCreateXML() failed') libvirt.libvirtError: internal error: process exited while connecting to monitor: 2022-05-22T20:39:03.671212Z qemu-system-x86_64: -blockdev {"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage","backing":null}: Could not open '/run/media/myuser/New Volume/VMS/kali.qcow2': Permission denied

I have tried the following:

adding user=root and group=root to /etc/libvirt/qemu.conf, user=myuser group=kvm,

made sure my user is part of the kvm and libvirt group,

running "sudo virt-manager"

also tried "chown qemu:qemu /run/media/myuser" and messing around with those permissions but still no change.

Enable libvirt using sysvinit

Posted: 08 Jul 2022 11:38 AM PDT

I am trying to install qemu and KVM on my MX-Linux 21, however my system is booted with sysvinit. As all the articles regarding installing and setting KVM use systemctl, I cannot find one to enable libvirt using sysvinit.

  • When I run
    sudo /etc/init.d/libvirt start  
    it gives me this output:
    sudo: /etc/init.d/libvirtd: command not found  
  • When I run this command
    sudo service libvirtd start  
    it shows this output:
    libvirtd: unrecognized service  

Is there any way to start and enable libvirt in sysvinit? I know alternatively I can boot with systemd and it would sort out the issue, but I am comfortable in sysvinit as the default setting of MX-Linux, so I am curious and eager to find a solution to this problem.

Makefile command substitution

Posted: 08 Jul 2022 09:19 AM PDT

My Makefile:

all: ...(other rules) clean    clean:      rm $(find . -type f -executable)  

When I delete clean rule from the above Makefile everything works as expected. After adding, make (also make clean) command results in:

rm   rm: missing operand  Try 'rm --help' for more information.  make: *** [Makefile:46: clean] Error 1  

What causes problem here and how can I solve?

Failed to restart nfs-server.service: Transaction order is cyclic

Posted: 08 Jul 2022 10:33 AM PDT

NFS has been working for more than a year with the current configuration but has recently developed this issue:

Ubuntu 20.04 Kernel 5.40.0-40 NFS nfs-kernel-server/focal-updates,focal-security,now 1:1.3.4-2.5ubuntu3.3 amd64 [installed]

systemctl restart nfs-server    Failed to restart nfs-server.service: Transaction order is cyclic. See system logs for details.  See system logs and 'systemctl status nfs-server.service' for details.  

systemctl status :

 systemctl status nfs-server   nfs-server.service - NFS server and services   Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)   Drop-In: /run/systemd/generator/nfs-server.service.d           └─order-with-mounts.conf   Active: inactive (dead)     Jul 03 06:37:38 acer systemd[1]: export-3T.mount: Found ordering cycle on nfs-server.service/start   Jul 03 06:37:38 acer systemd[1]: export-3T.mount: Found dependency on export-3T.mount/start   Jul 03 06:37:38 acer systemd[1]: export-3T.mount: Unable to break cycle starting with export-3T.mount/start   Jul 03 06:43:47 acer systemd[1]: export-3T.mount: Found ordering cycle on nfs-server.service/start   Jul 03 06:43:47 acer systemd[1]: export-3T.mount: Found dependency on export-3T.mount/start   Jul 03 06:43:47 acer systemd[1]: export-3T.mount: Unable to break cycle starting with export-3T.mount/start     

From journal

systemd[1]: Requested transaction contains an unfixable cyclic ordering dependency: Transaction order is cyclic. See system logs for det>  systemd[1]: export-3T.mount: Unable to break cycle starting with export-3T.mount/start  systemd[1]: export-3T.mount: Found dependency on export-3T.mount/start  systemd[1]: export-3T.mount: Found ordering cycle on nfs-server.service/start  

/etc/fstab

UUID=uid /mnt/3T ext4 defaults 0 0   /mnt/3T /export/3T nfs bind 0 0   

/etc/exports

/export/3T 10.0.0.0/24(rw,nohide,insecure,no_subtree_check,async)   

How to recursively remove all SELinux contexts?

Posted: 08 Jul 2022 11:22 AM PDT

I am trying to make my production environment equivalent to my staging environment. On production, SELinux contexts were applied. If I list the files in a directory, I see the dot at the end of the permission string, like...

drwxrwxr-x.  

How can I recursively remove all contexts? I have disabled SELinux at /etc/selinux/config, but when I reboot, the contexts still are visible when I list the files in a directory.

X11 forwarding from Linux cluster to windows 10 personal computer via SSH

Posted: 08 Jul 2022 10:02 AM PDT

Our cluster runs Linux, and I can successfully ssh login to it using my windows 10 PC. However, when I'm trying to use X11 forwarding I always get the error:

qt.qpa.screen: QXcbConnection: Could not connect to display localhost:0.0  Could not connect to any X display  

I've tried everything: using Xterminal, PuTTY, Ubuntu (from the windows 10 store), MobaXterm - and nothing works. I've tried the export display command, and when I'm logging in I'm using -X (also tried -Y). I read online but couldn't find anything to work. Also, my colleague has a personal Macbook with the same user properties, and she managed to do X11 using XQuartz.

Any ideas what can I try?

ssh through authentication requiring proxy

Posted: 08 Jul 2022 11:53 AM PDT

At work we have of course a company's-proxy. I need to ssh to some machines out of the company's network. The proxy, though, requires authentication.

Let's assume we have the following variables:

proxy_user="<username I need to authenticate at the proxy>"  proxy_pass="<password I need to authenticate at the proxy>"  proxy_serv="<hostname of the proxy>"  proxy_port=<port of the proxy>  ssh_user="<remote username I need to login on the ssh-machine>"  ssh_serv="<remote password I need to login on the ssh-machine>"  ssh_port=<ssh-port>  

When setting the env-variable http_proxy and https_proxy as follows, tools like wget work fine (on the remote server, there is also a web_server installed):

$ export env http_proxy="http://$proxy_user:$proxy_pass@$proxy_serv:$proxy_port"    $ wget $ssh_serv  Connecting to <proxy_serv>... connected.  Proxy request sent, awaiting response... 200 OK  Length: unspecified [text/html]  Saving to: 'index.html'  

But with ssh it does not work:

$ ssh $ssh_user@$ssh_server:$ssh_port  ssh: Could not resolve hostname <ssh_server>:<ssh_port> Temporary failure in name resolution  

After googl-ing a little, I found out, that ssh needs a "ProxyCommand".  "nc" is not longer recommended here; "ssh -W" shall be used.  But I couldn't find an example where authentication was needed.  I tried so far:

ssh -o "ProxyCommand='ssh -W %h:%p $proxy_user:$proxy_pass@$proxy_serv:$proxy_port'" $ssh_user@$ssh_serv:$ssh_port  

I guess I'm missing something somewhere, but couldn't find a good hint (neither in the manuals, nor on Google).

I hope that some of you guys might help me out.

Is -d64 required for java on linux?

Posted: 08 Jul 2022 09:06 AM PDT

We are generating scripts for running java on RHEL or an Amazon Linux ami. The scripts all now contain the -d64 option. We are using OpenJdk 1.8 64-bit. The oracle faq question When you download the SDK or JRE, must you choose between the 32 and 64-bit versions? indicates that this option is only on Linux for compatibility reasons. It says

All other platforms (Windows and Linux) contain separate 32 and 64-bit installation packages. If both packages are installed on a system, you select one or the other by adding the appropriate "bin" directory to your path. For consistency, the Java implementations on Linux accept the -d64 option.

So it seems like -d64 is not needed for scripts running on Linux. It may be better to only add that option when running on solaris.

Is it required? What would be the harm in removing it from our scripts?

Recover overwritten CCTV footage from hard drive

Posted: 08 Jul 2022 11:20 AM PDT

I am trying to recover deleted footage from a DVR. I pulled the hdd(Toshiba DT01ABA100v) from the DVR to look at the data in the drive and run carving tools(foremost and scalpel). My problem is that I am unable to mount the hdd. The following are the outputs of some of the commands I tried

file -s /dev/sdb  /dev/sdb: DOS/MBR boot sector MS-MBR Windows 7 english at offset 0x163 "Invalid partition table" at offset 0x17b "Error loading operating system" at offset 0x19a "Missing operating system", disk signature 0x26a0a7cf    mount /dev/sdb /mnt/recdrive  mount: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error  

Is there something I can use to find the file system and be able to mount the hdd?

How can I assign the last element of an array to a another array?

Posted: 08 Jul 2022 09:22 AM PDT

Let say I have an array $Info whose elements are ;

!    total energy              = -1090.13343774 Ry  !    total energy              = -1090.20757070 Ry  !    total energy              = -1090.24296462 Ry  !    total energy              = -1090.25563488 Ry  !    total energy              = -1090.27085564 Ry  !    total energy              = -1090.27693129 Ry  !    total energy              = -1090.28213580 Ry  !    total energy              = -1090.29131927 Ry  

and I want to take its last element , split it with spaces and give to an another array $LastInfo. How can I do that ?

I tried this;

lst=$((${#Info[@]} -1))  IFS=' ' LastInfo=($en[$lst])  

But as posted in here the code doesn't work.

how to use libreoffice --headless export more than one png image from ppt or pptx

Posted: 08 Jul 2022 12:05 PM PDT

I use libreoffice export images, command like: $ libreoffice --headless --convert-to png ./ /tmp/example.ppt

but this command only export one page, is first page image, how can export few image or specify page image?

Is there any way to resize scale application GUI window?

Posted: 08 Jul 2022 10:13 AM PDT

Is there any way to run an application scaling its GUI window? (Well, I'm using MATE but hope for universal solution). For example, up scale small window of an old game running under wine on high-resolution display or shrink windows that doesn't fit low-resolution display and so on.

I'm not looking for any way of changing running Xorg resolution. I'm looking for a way to scale specific program. I'm not looking for any type of VM solution. However there might be an X server displaying and scaling applications inside a window.

Magnifying part of the screen to whole screen might be acceptable solution also. But screen magnifiers like kmag is not suitable since it makes duplicate of picture and do magnify its own windows too disabling be full-screen expanded and doesn't support mouse clicks on magnified area.

P.S. Well, if there is no such way, is there a way to force application running full screen?

Is it possible to use the meta-files in rtorrent?

Posted: 08 Jul 2022 10:22 AM PDT

I've used rtorrent on some magnetic-links and it created some "meta"-files, which seemed to be named by the hash...

Is there a way to somehow use these meta-files to start rtorrent to download the torrents, rather than having to locate the actual magnet? E.g. rtorrent 637778299.meta or somethin?

No comments:

Post a Comment