Monday, January 3, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Wifi Repeated Disconnect & Reconnect Issue

Posted: 03 Jan 2022 10:28 AM PST

Only recently there has been an issue for me where on Arch my Wifi works for a few minutes, and then disconnects for 1 or 2 minutes. After that it connects back and then disconnects after a few minutes. The cycle goes on...

This used to be a problem but for some reason it has grown to be even worse and I have not made many changes network wise. Everything works perfectly fine when on Windows.

journalctl -f output (StackExchange flagged this as spam): https://pastebin.com/v54RKrLb

I tried disabling some services but they didn't seem to do anything so I re-enabled them. Any idea what the issue might be?

Sub-directory doesn't appear until I cd into it

Posted: 03 Jan 2022 10:17 AM PST

There is a shared directory with sub-directories, but when I run the command ls, it doesn't appear. It only appears once I have cd into it, why is this?

How to change alert sound in popos?

Posted: 03 Jan 2022 10:02 AM PST

I see latest version of popos settings doesnt includes alert sound such as bark, sonar, bell.

I could have install gnome-tweaks but , in latest version of gnome 41, In popos it is only managed by extensions not tweaks, i'm afraid to change anything and break popos.

so is there any other way around to change that?

docker build runs as a normal user instead of root

Posted: 03 Jan 2022 10:13 AM PST

I added a user to my docker image, and my next docker build that depends on such image will run the commands in my Dockerfile as such normal user, instead of root.

How to fix that?

Proof (that my next docker build that depends on such image will run the commands in my Dockerfile as such normal user, instead of root):

Step 6/8 : RUN apt-get update   ---> Running in 6582e7c149c6  Reading package lists... Done  E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)  E: Unable to lock directory /var/lib/apt/lists/  The command '/bin/sh -c apt-get update' returned a non-zero code: 100  

and I've also confirmed that from "Set current host user for docker container".

and I cannot fix the problem at docker build time:

$ docker build --rm --user root -t ...  go/Dockerfile --build-arg PACKAGES= .  unknown flag: --user  See 'docker build --help'.  

The problem of running docker build as such normal user is that I cannot even use sudo:

Step 6/8 : RUN hostname && sudo apt-get update   ---> Running in 5f643a24a84e  0f1275cbc0a8  sudo: unable to resolve host 0f1275cbc0a8: Temporary failure in name resolution  sudo: error initializing audit plugin sudoers_audit  The command '/bin/sh -c hostname && sudo apt-get update' returned a non-zero code: 1  

which needs sudo to fix in the first place.

Bind with RPZ broke domain forwarding?

Posted: 03 Jan 2022 09:56 AM PST

I wanted to take my existing internal DNS Bind servers and add some RPZ security. Previously I had split DNS with my internal view set to forward 3 specific domains to my offices internal DNS servers.

    zone "company.tld" IN {              type forward;              forward only;              forwarders {                       10.10.161.1;                      10.11.161.1;                      };  

Which worked great. Once I added RPZ after signing up with a transfer provider:

    response-policy {      zone "oisd-full.ioc2rpz" policy nxdomain;      }       qname-wait-recurse no break-dnssec yes;  

I can see my RPZ working great, but my forwarded zone is being caught in the RPZ. (Yeah, one of many companies I have worked for that inadvertently used an internal TLD that is now on someone's naughty list).

I tried making this domain a whitelist, but bind requires that my zone definition be a MASTER or SLAVE type, not a forward.

I am not finding a good example of anyone that has got both features to work.. IE: Allow Bind to either look at all it's local zones first, before RPZ, or tag a whitelist so that it still looks at it's view configuration for answers if it is marked passthru.

Ideas?

How to install OpenGl and SDL2 libraries on ubuntu

Posted: 03 Jan 2022 10:02 AM PST

I am trying to build Cube2 Sauerbraten, But I need the OpenGL and SDL2 libraries to run the makefile. (I am using ubuntu here) I tried running sudo apt-get install --yes software-properties-common g++ make then sudo apt-get install --yes libsdl2-dev then sudo apt-get install --yes freeglut3-dev and lastly, to compile, g++ main.cpp -I /usr/include/SDL2/ -lSDL2 -lGL. I got these commands from https://gist.github.com/dirkk0/cad259e6a3965abb4178. When I run them, the first three commands work fine, but the last one did not work, giving me this error. optiplex780@super-OptiPlex-780:~$ g++ main.cpp -I /usr/include/SDL2/ -lSDL2 -lGL cc1plus: fatal error: main.cpp: No such file or directory compilation terminated. optiplex780@super-OptiPlex-780:~$ Should I replace main.cpp with the makefile? Am I just a dunce, or is there a problem here?

Detect Frame Per Second of an LCD screen

Posted: 03 Jan 2022 09:20 AM PST

I am trying to find the frame per second of an LCD display in a Linux system. The display resolution is 640*480. The display is a 24 bit LCD screen and we use 32-bit frame reader driver(/dev/fb0) to draw.

We tried xrandr tool but it shows the refresh rate to zero.

Searched on the internet and couldn't find a clear solution. How I can find the frame per second of my LCD screen?

Any help is greatly appreciated

Custom Build - Unable to mount filesystem

Posted: 03 Jan 2022 09:27 AM PST

So I'm building a custom Linux-based OS, and I chose to run it as a RAM disk (initramfs). Unfortunately, I keep getting a Kernel Panic during boot.

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)  

Any chance this is something missing in my kernel build?

Here's how I've designed the OS:

Component My Choice
Init Daemon initrd
Commands busybox 1.35.0
Kernel Linux 5.15.12
filesystem msdos, fat, exfat, ext2, ext3, or ext4
Bootloader syslinux or extlinux

NOTES: I tried each file system one at a time, and all provide the same response, which leads me to believe that it is not an issue with the filesystem itself. I also tried both syslinux and extlinux for testing purposes.

Here's how I've structured my disk:

/media/vfloppy  └── [        512 Jan  3 08:06]  boot      ├── [      36896 Jan  3 08:06]  initramfs.cpio.gz      ├── [        512 Jan  3 08:06]  syslinux      │   ├── [        283 Jan  3 08:06]  boot.msg      │   ├── [     120912 Jan  3 08:06]  ldlinux.c32      │   ├── [      60928 Jan  3 08:06]  ldlinux.sys      │   └── [        173 Jan  3 08:06]  syslinux.cfg      └── [     939968 Jan  3 08:06]  vmlinux  

Here is my syslinux.cfg:

DISPLAY boot.msg  DEFAULT linux  label linux      KERNEL /boot/vmlinux      INITRD /boot/initramfs.cpio.gz      APPEND root=/dev/ram0 init=/init loglevel=3  PROMPT 1      TIMEOUT 10  F1 boot.msg  

I've also enabled the following filesystem options in my kernel's .config file:

CONFIG_BLK_DEV_INITRD=y  CONFIG_INITRAMFS_SOURCE=""  CONFIG_FS_IOMAP=y  CONFIG_EXT2_FS=y  CONFIG_EXT2_FS_XATTR=y  CONFIG_FS_MBCACHE=y  CONFIG_EXPORTFS_BLOCK_OPS=y  CONFIG_FAT_FS=y  CONFIG_MSDOS_FS=y  CONFIG_PROC_FS=y  CONFIG_BLK_DEV_RAM=y  CONFIG_BLK_DEV_RAM_COUNT=16  CONFIG_BLK_DEV_RAM_SIZE=4096  CONFIG_HAVE_KERNEL_GZIP=y  CONFIG_RD_GZIP=y  CONFIG_DECOMPRESS_GZIP=y    

Ufw, allow in/out on enp0s3 192.168.0.0/16

Posted: 03 Jan 2022 08:05 AM PST

is it possible work ufw to allow in and out on a specific interface AND ip range at the same time?

ufw allow in/out from enp0s3 192.168.0.0/16 ?

e.g allowing everything on local network, but only on interface enp0s3

Full command line in ps -o call

Posted: 03 Jan 2022 08:40 AM PST

On Ubuntu 20.04.3, calling ps -e -o args,pid,etime,%cpu,%mem --forest | egrep "firefox|PID" | grep -v grep gives me the following result:

COMMAND                         PID     ELAPSED %CPU %MEM   \_ /usr/lib/firefox/firefo    5730    01:58:40 20.8  4.9   |   \_ /usr/lib/firefox/fi    5811    01:58:39  0.0  0.2   |   \_ /usr/lib/firefox/fi    5841    01:58:39  0.1  0.7   |   \_ /usr/lib/firefox/fi    5895    01:58:39  0.0  0.9   |   \_ /usr/lib/firefox/fi    5926    01:58:39  4.3  2.0   |   \_ /usr/lib/firefox/fi    6000    01:58:38 21.7  2.0   |   \_ /usr/lib/firefox/fi    6094    01:58:32  4.2  0.3   |   \_ /usr/lib/firefox/fi    7004    01:54:00  1.4  2.0   |   \_ /usr/lib/firefox/fi    7648    01:37:06  0.8  1.9   |   \_ /usr/lib/firefox/fi    8351    01:31:35  1.0  1.0   |   \_ /usr/lib/firefox/fi   12159       45:04  3.5  2.3   |   \_ /usr/lib/firefox/fi   15712       03:56  2.0  0.9   |   \_ /usr/lib/firefox/fi   15833       03:25  1.4  0.9   |   \_ /usr/lib/firefox/fi   16878       02:39  0.0  0.4   |   \_ /usr/lib/firefox/fi   16924       02:30  0.0  0.4   |   \_ /usr/lib/firefox/fi   16962       02:24  0.0  0.4  

which is what I want except for the shortened command line. Adding ww to ps (ps -eww) does not change the output. ps auxww --forest | egrep "firefox|PID" | grep -v grep works, but in BSD style and not with the columns I want.

Why avoid using "&&" in bash script?

Posted: 03 Jan 2022 08:18 AM PST

I am writing a bash script which contains a simple if section with two conditions:

  if [[ -n $VAR_A ]] && [[ -n $VAR_B ]]; then      echo >&2 "error: cannot use MODE B in MODE A" && exit 1    fi  

A senior engineer reviewed my code and commented:

please avoid using && when you could simply execute the two commands in subsequent lines instead.

He didn't further explain. But out of curiosity, I wonder if this is true, and what is the reason for avoiding using &&.

Are USB c headsets compatible with Linux?

Posted: 03 Jan 2022 07:37 AM PST

just a quick question: In the past I had problems with 3.5 because the audio worked but the microphone didn't work. I switched to a headset with USB A, where I no longer had any problems. Unfortunately, I am forced to buy a new headset. At the moment I prefer one with USB c because my laptop has this connection and it would also be advantageous for mobile devices. Is there anyone who can help me and who knows if I will have problems with usb c? A working microphone is important to me for conferences. Or should I stick with USB A? Hope I haven't forgotten any important information, of course I will update the post if I did. Thank you!

Running Linux for development: pros and cons of VM vs docker?

Posted: 03 Jan 2022 07:30 AM PST

My main workmachines these days are an iMac and a Macbook, because I work as a mobile app dev and for building iOS apps, you need a Mac system.

That said, for the sake of fun and knowledge, I want to re-learn OS kernel dev. I've found some repos that are easily buildable on Linux (still have a PC running Debian ready). These repos require some tools that are unfortunately Linux only, so I'd like to install Linux "inside" my Mac. At the moment, not interested in dual-boot.

Now I've installed Debian on VirtualBox, and so far it works OK. I wonder, though, if there's a less resource approach for running Linux: perhaps docker? What are the pros and cons? My understanding so far is docker is suited for reproducibility, to avoid the classic "this setup works OK on my machine but not sure why it crashes on yours". Not sure if it fits my case.

Is it possible to set different default gateways on a per-application basis?

Posted: 03 Jan 2022 07:23 AM PST

Suppose I have a machine on a network with two different valid, working gateways. Let's call 10.0.0.1 the "normal" gateway to the internet as supplied by an ISP and 10.0.0.2 a standalone VPN appliance that routes everything to a company's network before the big wider internet world. A side-effect of this is that they appear online from a different geographical location.

On this network, users (or their administrators) could choose which gateway to use on the basis of essentially what their DHCP server tells them, or they decide to set. This is a convenience for many -- you can have slightly faster, lower-latency access to the native country's internet via gateway A and access to internal resources (and the US internet) via gateway B.

For a machine running linux on this network, is it possible to change routes on a per application basis? I know that we could set a specific route on a per host basis with ip route if we knew in advance where we'd like to send off the packets to, but what if we want to open one application (e.g. firefox) sending all of its packets to gateway A and another (e.g. Chromium) to gateway B?

This is obviously possible with vlans, VMs (or containers) and virtual network adapters, but I'm interested to know if there's a "bare metal" answer.

Why I can't login in my linux using my account?

Posted: 03 Jan 2022 06:42 AM PST

I had recently wanted to use xfce instead of gnome, so I just uninstalled gnome and installed xfce, with lightdm, later I couldn't login in my work account but was able to login in another account of mine. Later I had to uninstall xfce and lightdm, but still I couldn't login in my account using GUI, when I try to enter my password and username, it goes in the loop once again...

This only happens with my work account, but on the otherhand when I try to login with my normal account it just works...

I have debian 11.2 installed in my laptop, and gnome version is 3.38.6 installed.

Any help is highly appreciated...

how to enable debug logs in stdout for logstash?

Posted: 03 Jan 2022 06:27 AM PST

I'm struggling as newbie in logstash, below is some info of my env

Logstash Version: logstash-7.16.2-1.x86_64  java Version: openjdk version "11.0.13" 2021-10-19 LTS  

Logstash Conf

input {    stdin { }  }  output {    stdout {      debug => true      }  }  

I run logstash with below command, I get error:

# /usr/share/logstash/bin/logstash -f simple.conf    [ERROR] 2022-01-03 08:26:36.742 [Converge PipelineAction::Create<main>] stdout - Unknown setting 'debug' for stdout  

how do I enable debug logs in logstash, outputting events, as well as message section?

network access lost when I connect to VPN

Posted: 03 Jan 2022 09:51 AM PST

When I connect to a VPN using forticlient I lose access to all other sites (outside of the VPN). I thought the problem was with my DNS and resolved but now I realise that I cannot even ping 8.8.8.8 so it must be something even more fundamental, right?

When I'm connected to the VPN here's what ifconfig -a tells me (loopback edited out):

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500          inet 192.168.1.5  netmask 255.255.255.0  broadcast 192.168.1.255          inet6 fe80::279f:54fe:977f:4e6c  prefixlen 64  scopeid 0x20<link>          ether 18:03:73:e6:32:f2  txqueuelen 1000  (Ethernet)          RX packets 74896  bytes 58598268 (55.8 MiB)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 59257  bytes 11405705 (10.8 MiB)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          device interrupt 20  memory 0xe1500000-e1520000     vpn: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1400          inet 10.50.192.11  netmask 255.255.255.255  destination 10.50.192.11          unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 500  (UNSPEC)          RX packets 59  bytes 13713 (13.3 KiB)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 2155  bytes 172229 (168.1 KiB)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  

And after I disconnect from the VPN, when I can use my default DNS, etc ifconfig tells me

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500          inet 192.168.1.5  netmask 255.255.255.0  broadcast 192.168.1.255          inet6 fe80::279f:54fe:977f:4e6c  prefixlen 64  scopeid 0x20<link>          ether 18:03:73:e6:32:f2  txqueuelen 1000  (Ethernet)          RX packets 75682  bytes 58794111 (56.0 MiB)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 59981  bytes 11559277 (11.0 MiB)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          device interrupt 20  memory 0xe1500000-e1520000  

Edit (to improve readability): ip route gives

$ ip route  default via 10.50.192.14 dev vpn scope link default via 192.168.1.254 dev eno1 proto dhcp metric 100  192.168.1.0/24 dev eno1 proto kernel scope link src 192.168.1.5 metric 100  193.1.103.33 via 192.168.1.254 dev eno1  

and

resolvectl gives

Global Protocols:  +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported resolv.conf mode: foreign Current DNS Server: 8.8.8.8 DNS Servers: 8.8.8.8 8.8.4.4 DNS Domain: google.com Link 2    (eno1) Current Scopes:   DNS LLMNR/IPv4 LLMNR/IPv6 Protocols:  +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported DNS Servers: 8.8.8.8 8.8.4.4 Link 9     (vpn) Current Scopes: DNS LLMNR/IPv4 Protocols:  +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported DNS Servers: 10.220.1.10 10.220.1.11  

FWIW I'm running Debian with

$ uname -a  Linux foirfe 5.15.0-2-amd64 #1 SMP Debian 5.15.5-1 (2021-11-26) x86_64 GNU/Linux  

All suggestions gratefully appreciated.

What rd.live.image means?

Posted: 03 Jan 2022 06:21 AM PST

I've recently started to use Fedora more. I want to understand boot options. I'm currently unable to find meaning of rd.live.image. Where is it documented?

dracut.cmdline - dracut kernel command line options mentions it only in below and an example:

Deprecated, renamed Options Here is a list of options, which were used in dracut prior to version 008, and their new replacement.

  liveimg         rd.live.image  
   Example.       menuentry 'Live Fedora 20' --class fedora --class gnu-linux --class gnu --class os {         set isolabel=Fedora-Live-LXDE-x86_64-20-1         set isofile="/boot/iso/Fedora-Live-LXDE-x86_64-20-1.iso"         loopback loop $isofile         linux (loop)/isolinux/vmlinuz0 boot=isolinux iso-scan/filename=$isofile root=live:LABEL=$isolabel ro rd.live.image quiet rhgb         initrd (loop)/isolinux/initrd0.img     }  

Can we use "${a:-b}" for variable assignment in bash, with "a" a command?

Posted: 03 Jan 2022 08:02 AM PST

I'm writing a bash script.

Per this original post I have learned that c=${a:-b} can be used to set the variable c if var a turns out to be unset or empty.

I wonder if we can extend this case into assigning the output of a command to a var. For example, I have a bash command some command, and I can assign it to the var c with

c=$(some command)  

But I also want to include the case that if the output of some command is empty, I assign another default value to c.

I know that I can write vanilla if-else in the bash script, but just wonder if there's any more elegant way similar to c=${a:=b}?

Some Emojis not appearing on browser and some applications in Endeavour OS

Posted: 03 Jan 2022 08:51 AM PST

I just shifted to arch from ubuntu budgie. and I am getting some issues loading/displaying emojis on some websites and applications. I have provided some screenshots of the issue. The Os I am using is Endeavour OS with KDE Plasma Desktop and my browser is Brave (stable).

  1. A post on Facebook which probably had emojis

A post on Facebook which probably had emojis

  1. VS Code Terminal there should have been arrows which do show up on konsole (kde terminal) shown below

There should have been arrows which show do show up on konsole kde terminal shown below

  1. The konsole which shows the arrows

enter image description here

Extrating timestamps from filename to split mp3s

Posted: 03 Jan 2022 08:44 AM PST

I have a bunch of mp3 files in a folder. They are recorded from cassette tape, and the individual tracks need to be separated out. This is one one the filenames:

Gobbolino the Witch's Cat, 10:52 The Hare & Tortoise, 14:52 The Shoe Tree, 24:22 The Emperors New Clothes, 34:11 The Red Nightcaps, 37:07 Aldo in Arcadia (1), 40:37 The Forest Troll.mp3  

You can see it has timestamps within the filename, indicating the start of each track. The first track is not timestamped since it always starts at 00:00. And the last track should always go to the end of the mp3. Somehow, I want to extract these timestamps in order to create separate files.

If the file above were split correctly the output would be:

Gobbolino the Witch's Cat.mp3  The Hare & Tortoise.mp3  The Shoe Tree.mp3  The Emperors New Clothes.mp3  The Red Nightcaps.mp3  Aldo in Arcadia (1).mp3  The Forest Troll.mp3  

I know how to loop thru files, and how to cut a file with ffmpeg, but I don't know how to extract the timestamps and track names from the filename. I'm using zsh, and here is my current code:

for file in *; do    if [[ -f "$file" ]]; then      # extract timestamps and loop thru, for each timestamped section      ffmpeg -ss TIMESTAMP_START -to TIMESTAMP_END -I "$file" -acodec copy TRACK_NAME.mp3    fi  done  

UPDATE

My spec for this problem has changed. The filename looks like this:

Tape 1 - Gobbolino the Witch's Cat, 11-06 The Hare & Tortoise, 14-25 The Shoe Tree, 24-06 The Emperors New Clothes, 34-27 The Red Nightcaps, 37-29 Aldo in Arcadia (1), 40-40 The Forest Troll.mp3  

i.e it has an Album name at the beginning, and there are hyphens in the timestamps instead of colons (filenames can't have colons in macOS). Also, I wanted to insert some mp3 tags into the files, and put the tracks for each album in its own album folder.

I based my solution on Gilles one below. The script looks like this:

setopt interactive_comments  for file in *(.); do      extension=$file:e      rest=$file:r      timestamp_start=0:00      timestamp_duration=$(ffprobe -i "$file"  -show_entries format=duration -v quiet -of csv="p=0" -sexagesimal -sexagesimal)      timestamp_duration=${timestamp_duration%.*}      tracknum=1      while [[ $rest =~ ,\ *([0-9:]+-[0-9][0-9])\ * ]]; do          track_name="$rest[1,$MBEGIN-1]"          if [[ "$track_name" == *"Tape "* ]]; then         albumname="${track_name%% - *}"             track_name="${track_name#* - }"             echo "\n\nALBUM NAME $albumname\n"             mkdir $albumname          fi          rest=$rest[$MEND+1,-1]          timestamp_end=$match[1]          timestamp_end="${timestamp_end//-/:}"        # echo "$timestamp_start $timestamp_end $track_name.$extension"          ffmpeg -ss $timestamp_start -to $timestamp_end -i $file -acodec libmp3lame -ac 2 -ab 256k -ar 44100 -metadata album="$albumname" -metadata title="$track_name" -metadata track="$tracknum" $track_name.$extension          mv $track_name.$extension $albumname          timestamp_start=$timestamp_end          tracknum=$((tracknum+1))          last_track_name="$rest:r"      done      if [[ -n $timestamp_end ]]; then          # echo "$timestamp_start $timestamp_duration $last_track_name.$extension"          ffmpeg -ss $timestamp_start -to $timestamp_duration -i $file -acodec libmp3lame -ac 2 -ab 256k -ar 44100 -metadata album="$albumname" -metadata title="$last_track_name" -metadata track="$tracknum" $last_track_name.$extension          mv $last_track_name.$extension $albumname      fi  done  

Automatically moving forked processes in a different cgroupv2

Posted: 03 Jan 2022 09:45 AM PST

I've been using apache2-mpm-itk with cgrulesengd in cgroupv1 to automatically classify the child processes that apache2-mpm-itk spawns when servicing web requests for different vhosts for about 3 years, and it's been working great, when a vhost starts using up too much CPU/RAM, oom killer takes care of that specific vhost and leaves the others alone.

I'm now preparing a new Debian 11 server, and I'm finding out that I need to use cgroup v2 now. So I'm trying to bring my resource control solution to the new world.

When I create my e.g. /etc/systemd/system/user-UID.slice.d/override.conf with the resource controls for that user, they don't apply to the forked processes, as cgrulesengd used to be able to do, as I am confirming with systemd-cgls. Instead, the parent and all its children all still belong to the same apache2.service slice.

Is there a way to automatically classify child processes of a process in a different cgroup than the spawning process with systemd?

Ubuntu VM without iptables and without ip_tables module

Posted: 03 Jan 2022 10:26 AM PST

I'm using an Ubuntu 16.04 vm at a provider I haven't used before and immediately encountered a new problem. I installed the iptables package, however when I attempted to run iptables -L, I received this message:

    modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-72-generic/modules.dep.bin'      modprobe: FATAL: Module ip_tables not found in directory /lib/modules/4.4.0-72-generic      iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)      Perhaps iptables or your kernel needs to be upgraded.  

My first response was to load the ip_tables module, however there were no modules in /lib/modules... I'm also wondering where the kernel config is, since it was not in /boot.

A created a support ticket, but the provider is saying the level of support I'm seeking "requires an SLA agreement".

Thoughts?

Linux Mint duplex driver for Samsung M2070

Posted: 03 Jan 2022 08:01 AM PST

I'm trying to print duplex on my Samsung M2070 Printer. I installed the driver from the Samsung website with the provided install.sh and then added the printer to the system in the Printers section of the System Preferences.

I see the Printer in LibreOffice Writer, and I can print with it, but there isn't a duplex function in the print window (On Win7 there is a Checkbox).

Do you have any ideas?

Update I clicked on "Print" in LibreOffice and then "Properties" and "Paper". I saw the disabled duplex combobox. I thought on a driver issue, so i went to CUPS administration to check my driver. It wrote, that my driver is able to print duplex.

Content of root's home directory in OSX

Posted: 03 Jan 2022 09:04 AM PST

What is stored in root's home directory on OSX? What happens if you delete it on accident?

Here's what's in my current root home folder.

OSX:~ root# ls -lash  total 8  0 drwxr-x---   5 root  wheel   170B Nov 14 03:40 .  0 drwxr-xr-x  25 root  wheel   850B Nov 14 11:42 ..  8 -rw-r--r--   1 root  wheel     3B Nov 14 03:40 .CFUserTextEncoding  0 -r--r--r--   1 root  wheel    10B Jun 28  2014 .forward  0 drwx------  10 root  wheel   340B Mar 21 10:13 Library  

Here's what's in the Library

OSX:~ root# ls -lash Library  total 0  0 drwx------  10 root  wheel   340B Mar 21 10:13 .  0 drwxr-x---   5 root  wheel   170B Nov 14 03:40 ..  0 -r--r--r--   1 root  wheel     0B Aug 24  2013 .localized  0 drwx------+  3 root  wheel   102B Dec 11 16:22 Application Support  0 drwxr-xr-x  11 root  wheel   374B Dec 11 16:21 Caches  0 drwxr-xr-x   3 root  wheel   102B Mar 21 10:14 Cookies  0 drwxr-xr-x   3 root  wheel   102B Nov 14 03:43 Dictionaries  0 drwx------   3 root  wheel   102B Mar 21 10:13 Logs  0 drwx------  24 root  wheel   816B Mar 26 15:13 Preferences  0 drwx------   2 root  wheel    68B Nov 14 11:34 Saved Application State  

How to shutdown Linux at specific datetime from terminal?

Posted: 03 Jan 2022 06:50 AM PST

It seems I can shutdown using sudo shutdown by specifying a time or minutes.

Is there a way to specify datetime for shutdown?

Dual booting Ubuntu and Windows 8. w8 boots through grub shell, but not from menu

Posted: 03 Jan 2022 10:00 AM PST

I have a laptop, with installations of Ubuntu 12.10, and Windows 8. Windows 8 was first installed on the system, and Ubuntu was installed afterwards.

During the Ubuntu installation, the installer recognized that there are existing partitions, but failed to see any OS on them. I created another ext4 partition in the free space, and installed Ubuntu. Initially grub only added the entry for Ubuntu, and Ubuntu works ok.

Now I wanted to enter w8 settings to Grub manually, and modified /etc/grub.d/40_custom:

#!/bin/bash  exec tail -n +3 $0  # This file provides an easy way to add custom menu entries.  Simply type the  # menu entries you want to add after this comment.  Be careful not to change  # the 'exec tail' line above.  menuentry "Windows 8" {      insmod part_gpt      insmod fat      insmod search_fs_uuid      insmod chain      #set root='(hd0,gpt1)'      search --fs_uuid --no-floppy --set=root --hint-bios=hd0,gpt2 --hint efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2      chainloader /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi  }  

The search string (second to last) I found with this command: sudo grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi

Now after updating grub config, rebooting and selecting windows 8 entry, it complains:

error: unspecified search type  error: file '/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi' not found    Press any key to continue  

In Ubuntu however, if I do ls /boot/efi/EFI/Microsoft/Boot/b*

/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi  /boot/efi/EFI/Microsoft/Boot/bootmgr.efi  /boot/efi/EFI/Microsoft/Boot/boot.stl    /boot/efi/EFI/Microsoft/Boot/bg-BG:  bootmgfw.efi.mui  bootmgr.efi.mui  

Now, if I press e to edit the Windows 8 entry, and then select F2 to enter grub shell, indeed if I try to run ls /boot/efi, no files are shown.

Funnily enough, if at this point I just type exit, windows 8 will boot up.

fdisk -l gives me that it recognizes /dev/sda1 as GPT partition

Any ideas what I should do to get grub working "right out of the menu"?

How can ubuntu/truecrypt be configured so users can mount volumes if-and-only-if they have proper permissions on the mount-point?

Posted: 03 Jan 2022 07:01 AM PST

If I add the line: ALL= /usr/bin/truecrypt to the sudoers file this lets all users mount volumes at arbitrary mount-points. The problem is a user could create a truecrypt volume and then mount it at /etc/apache2 or /var/www -- directories which they shouldn't be able to tamper with.

If a user doesn't have sudo rights to run /usr/bin/truecrypt then truecrypt fails after prompting for the administrator/user password.

What's the proper way to configure the system/truecrypt so users can mount volumes in a sane/safe way? e.g. they can only mount volumes to mount-points which they own (or have write-access to)?

How to create /dev/null?

Posted: 03 Jan 2022 08:39 AM PST

I deleted my /dev/null. How can I restore it?

No comments:

Post a Comment