Saturday, December 4, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


EBUSY when trying to add process to cgroup v2

Posted: 04 Dec 2021 01:07 PM PST

I'm playing with cgroups v2 on Fedora 35 (kernel 5.15.5-200.fc35.x86_64).

I was able to test cpu, cpuset and pids controllers without any problems. But for memory, hugetlb or io I'm having troubles. Here is a step list how to reproduce this problem for memory controller (all commands were executed as a root user):

  1. Make sure that memory controller is enabled in root cgroup:
# cat cgroup.subtree_control  cpu io memory hugetlb pids  
  1. Create new cgroup:
# mkdir example  # cd example/  
  1. Enable memory controller:
# echo "+memory" > cgroup.subtree_control   
  1. Add process to control group:
# echo $$ > cgroup.procs   bash: echo: write error: Device or resource busy  

When I'm trying to firstly add process to cgroup and later enable controller same error occurs on last step.

What I'm doing wrong?

A way to make virtual folders in Linux

Posted: 04 Dec 2021 12:47 PM PST

Is there a file search engine like "Everything" in Linux? I came across this post from 9 years ago and I found there is something called Ferris. It appears to be a VFS layer that runs on top of the existing file system.

The project has not had a new release in three-and-a-half years.

Is there anything with that feature list that is current?
http://www.libferris.com/features

How do I find out if wifi card supports 4addr mode?

Posted: 04 Dec 2021 12:45 PM PST

I want to setup a wireless network, with some wired devices plugged to wireless clients. All of them should have same IP pool / same subnet from DHCP server.

One approach is probably the configuration of wireless DHCP server and wireless clients in 4addr mode, if available.

How do I find out if my preferred wireless card (on both server and clients) supports this mode ? May iw list be helpful ? You'll find it here as output text

Intel WiFi 6E ax210 NGFF, mixed vPro and non vPro versions.

More details you'll find here on unix.stackexchange.com

Thanks for your help.

Random "No space left on device" errors when creating btrfs snapshot from script running as a service

Posted: 04 Dec 2021 11:12 AM PST

I am using Fedora 35, fully updated. I have script that creates snapshots on schedule and it is run as systemd service.

When doing:

sudo btrfs subvolume snapshot / /.snapshots/root-$(date +%d-%m-%Y)

I get random messages like

Dec 02 12:43:27 fallen-robot backup.sh[4982]: ERROR: writing to var/lib/dnf/history.sqlite-wal failed: No space left on device  Dec 02 19:50:21 fallen-robot backup.sh[6967]: ERROR: writing to borko/.cache/mesa_shader_cache/index failed: No space left on device  

This never happens when I run the same bash script normally from the console.

My disk has like 1% of the space filled up.

Activate Linux GUI only for a specific application Lubuntu 21.10

Posted: 04 Dec 2021 12:07 PM PST

I need to setup a linux client(OS:Lubuntu 21.10) witch launch only a web page on Chromium browser always fixed all the time 24/24. It's possibile for you to use the client in CLI mode and start LXDE/LXQT (Lubuntu GUI) only for chromium? All is ok with LXDE booted up, but because I want to optimize HW resources I've think about to a GUI "on-demand" ...It's possible? Too difficult? Thanks to all (sorry for my english)

Alessandro

Debian Bullseye Docker package cannot be verified, pulic key is not available

Posted: 04 Dec 2021 11:10 AM PST

I'm following this guide, but once I run apt update, I get this error:

GPG error: https://download.docker.com/linux/debian bullseye InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8The repository 'https://download.docker.com/linux/debian bullseye InRelease' is not signed.  

Any help is appreciated!

Makefile phony "clean" target executes the include directive

Posted: 04 Dec 2021 12:01 PM PST

I highlight the relevant parts in of my Makefile here:

...  $(DEP_FILES): dep/%.d: src/%.cc          some command    include $(DEP_FILES)          .PHONY: clean    clean:          ...  

when I run make clean the include directive is executed which executes the rules in the dependency .d files.

This generates errors if there are errors in the dependency files.

Why is the include directive executed when calling make clean?

clean should only be for cleaning. How to avoid this situation?

Suckless surf crashes when interacting with specific websites

Posted: 04 Dec 2021 08:13 AM PST

I'm trying to use discord and whatsapp web through suckless surf on nixos with i3. I start surf with surf web.whatsapp.com and it displays the the QR code. When I use my phone to scan the QRcode, just at the moment the phone detects the qr code, the surf window suddenly closes. here is the entire terminal output:

Could not read style file: /home/philipp/.surf/styles/default.css  Could not read style file: /home/philipp/.surf/styles/default.css  web process terminated: crashed  

(it complains about the style file earlier, in the moment of the crash just the last line gets added.) This happened to me everytime I tried to connect WA-web to my phone.

The same thing also happens when I open discord.gg, as soon as i click on the "open discord in browser", button surf crashes.

Any help is appreciated, as I'm totally new to suckless surf.

Installing R from R project repo (Debian 10): key issue

Posted: 04 Dec 2021 12:22 PM PST

I wanted to install R from the R Project repository on Debian 10. The following packages are required:

sudo apt install dirmngr -- install-recommends  sudo apt install software-properties-common apt-transport-https ca-certificates gnupg2  

Then, if I follow e.g. https://www.digitalocean.com/community/tutorials/how-to-install-r-on-debian-10 and do

sudo apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'  

I end up with the following error:

Executing: /tmp/apt-key-gpghome.WVA4wGygKd/gpg.1.sh --keyserver keys.gnupg.net --recv-key E19F5F87128899B192B1A2C2AD5F960A256A04AF  gpg: keyserver receive failed: No name  

Conditionally extract sections from log file if keyword exists

Posted: 04 Dec 2021 09:18 AM PST

I'm trying to figure out a way to extract specific sections from a log file. Each part is split by a fixed string "<-------------->".

<-------------->  abc: def1  ghi: jkl1  xyz generated: def1  <-------------->  abc: def2  ghi: jkl2  xyz generated: def2  Dec 04, 2021 2:51:05 AM abcdefg  SEVERE: [Line 447.149] Lorem ipsum dolor sit amet at [Line 212.2]  Dec 04, 2021 2:51:05 AM abcdefg  SEVERE: [Line 1315.78] Lorem ipsum dolor sit amet at [Line 147.138]  xyz generated: def2  <-------------->  abc: def3  ghi: jkl3  xyz generated: def3  <-------------->  

Could sed/grep be used to extract those sections containing the word SEVERE or WARNING within the section?

Edit: An alternative approach could be to count line numbers. Sections having only 3 lines can be dropped. All other sections having more lines are the ones I'm looking to extract.

Why is clipboard cleared when close xfce4-terminal?

Posted: 04 Dec 2021 08:38 AM PST

I'm using xfce4-terminal with the setting enabled: "Automatically copy selection to clipboard"

It works fine when select something, the selection is copied to clipboard. But if I close the terminal window, the clipboard becomes empty. It doesn't matter how I close it, by menu or by hotkey.

And the terminal only clears the content copied from itself. I tried copy some text from Chrome Browser, then close the terminal, the clipboard content is still there.

Why is that? How to keep the clipboard content when close the terminal?

Environment: Kali Linux, xfce

Edit:

Just learned from comments, it seems to be the syncing problem between PRIMARY and CLIPBOARD. I tried tools form other site that works for them, but not work for me:

  1. parcellite

    Right click -> Preferences -> Synchronize clipboards

Not work at all

  1. autocutsel
    autocutsel -fork -selection CLIPBOARD -debug -verbose      autocutsel -fork -selection PRIMARY -debug -verbose  

The debug output is correct when selecting text in terminal, but not synced to CLIPBOARD, don't know where it synced to.

  1. xfce4-clipman:

    Right click -> Properties -> Sync mouse selections

It works for syncing, the problem is that it syncs mouse selection from everywhere, not only from terminal, even with the option "Ignore mouse selections" checked.

Progress bar "dialog" to show progress based on command execution from function

Posted: 04 Dec 2021 12:00 PM PST

How to make "dialog" progress bar increasing the counter, when each echo command is executed from function?

I have this code below as example, but I'm having problem of catching when command from function is executed. I can count number of "echo" in function and set as "items", but how to know when echo is finished and how to then increase the bar?

#!/bin/bash  function two() {     echo "test2-1"; sleep 1;     echo "test2-2"; sleep 1;     echo "test2-3"; sleep 1;     echo "test2-4"; sleep 1;     echo "test2-5"; sleep 1;  }    (      items=5      processed=0      while [ $processed -le $items ]; do          pct=$(( $processed * 100 / $items ))          echo "XXX"          echo "Processing item $processed" # Here I wish instead $processed                                            # to be value (test2-1, test2-2 etc.)                                            # of processed echo          echo "XXX"          echo "$pct"          processed=$((processed+1))          sleep 3 # Instead of this it should be when echo is finished printing      done  ) | dialog --title "Gauge" --gauge "Wait please..." 10 60 0  

grep for multiple strings in speedtest output

Posted: 04 Dec 2021 01:08 PM PST

I'm using speedtest CLI in a BASH script and trying to grab the output by using only one line if possible.

Typical output of Speedtest:

   Speedtest by Ookla         Server: (censored)          ISP: (censored)      Latency:    93.85 ms   (222.66 ms jitter)     Download:    85.75 Mbps (data used: 134.8 MB)                                      Upload:     5.68 Mbps (data used: 6.2 MB)     

I would like to grab Latency, Download speed, Upload speed, and jitter.

Most ideal format:   Download Speed: xx Mbps  Upload Speed: xx Mbps  Latency: xx ms  Jitter: xx ms  

My current test code is using 2 wasteful statements:

      dl_speed=`speedtest | grep "Download: " | head -2 | tail -1 | awk {'print$2'} | cut -f1 -d:`          ul_speed=`speedtest | grep "Upload: " | head -2 | tail -1 | awk {'print$2'} | cut -f1 -d:`          echo "Download Speed: $dl_speed Mbps"        echo "Upload Speed: $ul_speed Mbps"  

Problem mounting system partitions in rescue mode

Posted: 04 Dec 2021 12:43 PM PST

I have a serious problem. Server crashed and not returned, disk problems. I'm trying to mount /dev/vg/root partition to access and remove the files but it's giving me a superblock error.

Until yesterday I was able to access it in read-only mode using the command below.

mount -o ro,noload /dev/vg/root /mnt  

But now not even this command works anymore because of the error. I tried to recover the corrupted block without success. The operating system know that all I need is access to the location -/dev/vg/root to remove our data.

Doing some checks at least the files are still allocated on the disk; the problem is to access the location that is no longer visible for mounting.

mount /dev/vg/root /mnt  mount: /mnt: wrong fs type, bad option, bad superblock on /dev/mapper/vg-root, missing codepage or helper program, or other error.    mount -o ro,noload /dev/vg/root /mnt  mount: /mnt: mount(2) system call failed: Stale file handle.  

LVM used partition system

System where the server was installed: CentOS 6.9.

System I'm currently accessing in rescue mode.

Linux rescue 5.13.13 #1 SMP Thu Oct 28 09:11:58 UTC 2021 x86_64 GNU/Linux  

partition scheme (output from lsblk):

NAME          MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT  loop0           7:0    0  2.9G  1 loop  sda             8:0    0  2.7T  0 disk  ├─sda1          8:1    0    2G  0 part  │ ├─md0         9:0    0    2G  0 raid1  ├─sda2          8:2    0  2.7T  0 part  │ └─md1         9:1    0  5.5T  0 raid0  │   ├─vg-root 253:0    0  5.4T  0 lvm  │   └─vg-swap 253:1    0    4G  0 lvm  └─sda3          8:3    0    1M  0 part  sdb             8:16   0  2.7T  0 disk  ├─sdb1          8:17   0    2G  0 part  │ ├─md0         9:0    0    2G  0 raid1  ├─sdb2          8:18   0  2.7T  0 part  │ └─md1         9:1    0  5.5T  0 raid0  │   ├─vg-root 253:0    0  5.4T  0 lvm  │   └─vg-swap 253:1    0    4G  0 lvm  └─sdb3          8:19   0    1M  0 part  

Tried solutions like recovering bad blocks

sudo mke2fs -n /dev/xx    Failed attempt to recover bad blocks  sudo e2fsck -b 32768 /dev/vg/root  

Location I am trying to access, which is where CentOS 6.9 is installed: /dev/vg/root  The backup data I need is in this location.

In Apache config all my attempts to redirect all requests to index.html fail

Posted: 04 Dec 2021 11:42 AM PST

I have an Angular SPA that should only request index.html. All other URL requests to this server are handled internally by the SPA. I want to redirect all 404 errs to index.html.

I am new to Apache configuration. Every solution that I found online for this fails. I was able to successfully add a re-write to redirect http traffic to https. So I assume that mod_rewrite should be set up correctly. But all my other attempts at a re-write fail. I am probably making some obvious newbee mistake.

I am runing: Server version: Apache/2.4.41 (Ubuntu) Server built: 2021-10-14T16:24:43

After editing the config file, I always run "sudo systemctl reload apache2.

Here is my config file for my virtual host, govmeeting.org.conf:

<Directory /var/www/html>          Require all granted  </Directory>  <VirtualHost *:80>  ServerName govmeeting.org  ServerAlias www.govmeeting.org  ServerAdmin webmaster@localhost  DocumentRoot /var/www/html  ErrorLog ${APACHE_LOG_DIR}/error.log  CustomLog ${APACHE_LOG_DIR}/access.log combined    # This re-directs http traffic to https. This works.  RewriteEngine on  RewriteCond %{SERVER_NAME} =govmeeting.org [OR]  RewriteCond %{SERVER_NAME} =www.govmeeting.org  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]    # This was one solution I found to redirect all 404 errs to the main domain.  # It does NOT work. I still get 404 errs for govmeeting.org/somepage.  # ErrorDocument 404 https://govmeeting.org/    # This is another solution that I found that does NOT work:  # RewriteCond %{REQUEST_FILENAME} !-f  # RewriteCond %{REQUEST_FILENAME} !-d  # RewriteRule . /index.html [L]  #  # Here is another suggestion that does NOT work:  # RewriteBase /  # RewriteRule ^index\.html$ - [L]  # RewriteCond %{REQUEST_FILENAME} !-f  # RewriteCond %{REQUEST_FILENAME} !-d  # RewriteRule . /index.html [L]  #  # In this, I tried to redirect "somepage" to index.html. Does NOT work.  # I tried with and without a second "RewriteEngine on", because the  # suggestion was using it twice.  # RewriteEngine on  # RewriteRule ^somepage$ index.html [NC]  #  # Here I added "/" before each file name. Does NOT work.  # RewriteEngine on  # Redirect /x.html /index.html    </VirtualHost>  

UPDATE: I set up logging with:

LogLevel trace6 rewrite_module:trace6  

I edited my config to only have this redirect:

RewriteEngine on  RewriteRule ^home.html$ index.html [NC]  

I then sent requests from the browser for "govmeeting.org/dashboard", ".../xxx.txt" and ".../home.html".

Here is a tail of access.log:

114.119.156.56 - - [04/Dec/2021:02:03:03 +0000] "GET /robots.txt HTTP/1.1" 404 493 "-" "Mozilla/5.0 (compatible;PetalBot;+https://webmaster.petalsearch.com/site/petalbot)"  67.80.142.21 - - [04/Dec/2021:02:07:48 +0000] "GET /dashboard HTTP/1.1" 404 5729 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"  67.80.142.21 - - [04/Dec/2021:02:08:08 +0000] "-" 408 5213 "-" "-"  188.166.170.135 - - [04/Dec/2021:02:12:50 +0000] "GET /currentsetting.htm HTTP/1.1" 404 5607 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"  188.166.170.135 - - [04/Dec/2021:02:12:50 +0000] "GET / HTTP/1.0" 400 624 "-" "-"  67.80.142.21 - - [04/Dec/2021:02:19:58 +0000] "GET /xxx.txt HTTP/1.1" 404 5729 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"  67.80.142.21 - - [04/Dec/2021:02:20:18 +0000] "-" 408 5213 "-" "-"  67.80.142.21 - - [04/Dec/2021:02:25:06 +0000] "GET /home.html HTTP/1.1" 404 5729 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"  67.80.142.21 - - [04/Dec/2021:02:25:26 +0000] "-" 408 5213 "-" "-"  

Here is a tail of error.log. I am not sure how to interpret these results. The contents of the folder for my site only contains an index.html and a group of javascript files. (no "robots.txt", etc). Is it attempting to do a rewrite for these requests?

[Sat Dec 04 02:03:03.013635 2021] [rewrite:trace2] [pid 4283] mod_rewrite.c(483): [client 114.119.156.56:18482] 114.119.156.56 - - [govmeeting.org/sid#7f337385b810][rid#7f337391a0a0/initial] init rewrite engine with requested uri /robots.txt  [Sat Dec 04 02:03:03.013654 2021] [rewrite:trace3] [pid 4283] mod_rewrite.c(483): [client 114.119.156.56:18482] 114.119.156.56 - - [govmeeting.org/sid#7f337385b810][rid#7f337391a0a0/initial] applying pattern '/^home.html$' to uri '/robots.txt'  [Sat Dec 04 02:03:03.013702 2021] [rewrite:trace1] [pid 4283] mod_rewrite.c(483): [client 114.119.156.56:18482] 114.119.156.56 - - [govmeeting.org/sid#7f337385b810][rid#7f337391a0a0/initial] pass through /robots.txt    [Sat Dec 04 02:28:32.122092 2021] [rewrite:trace2] [pid 4566] mod_rewrite.c(483): [client 167.248.133.59:50802] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23ca000a0/initial] init rewrite engine with requested uri /  [Sat Dec 04 02:28:32.122099 2021] [rewrite:trace3] [pid 4566] mod_rewrite.c(483): [client 167.248.133.59:50802] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23ca000a0/initial] applying pattern '^home.html$' to uri '/'  [Sat Dec 04 02:28:32.122175 2021] [rewrite:trace1] [pid 4566] mod_rewrite.c(483): [client 167.248.133.59:50802] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23ca000a0/initial] pass through /    [Sat Dec 04 02:28:32.122306 2021] [rewrite:trace2] [pid 4566] mod_rewrite.c(483): [client 167.248.133.59:50802] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23b1090a0/subreq] init rewrite engine with requested uri /index.html  [Sat Dec 04 02:28:32.122311 2021] [rewrite:trace3] [pid 4566] mod_rewrite.c(483): [client 167.248.133.59:50802] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23b1090a0/subreq] applying pattern '^home.html$' to uri '/index.html'  [Sat Dec 04 02:28:32.122316 2021] [rewrite:trace1] [pid 4566] mod_rewrite.c(483): [client 167.248.133.59:50802] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23b1090a0/subreq] pass through /index.html    [Sat Dec 04 02:28:32.195319 2021] [rewrite:trace2] [pid 4567] mod_rewrite.c(483): [client 167.248.133.59:40432] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23ca000a0/initial] init rewrite engine with requested uri /  [Sat Dec 04 02:28:32.195325 2021] [rewrite:trace3] [pid 4567] mod_rewrite.c(483): [client 167.248.133.59:40432] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23ca000a0/initial] applying pattern '^home.html$' to uri '/'  [Sat Dec 04 02:28:32.195342 2021] [rewrite:trace1] [pid 4567] mod_rewrite.c(483): [client 167.248.133.59:40432] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23ca000a0/initial] pass through /    [Sat Dec 04 02:28:32.195467 2021] [rewrite:trace2] [pid 4567] mod_rewrite.c(483): [client 167.248.133.59:40432] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23b1090a0/subreq] init rewrite engine with requested uri /index.html  [Sat Dec 04 02:28:32.195472 2021] [rewrite:trace3] [pid 4567] mod_rewrite.c(483): [client 167.248.133.59:40432] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23b1090a0/subreq] applying pattern '^home.html$' to uri '/index.html'  [Sat Dec 04 02:28:32.195476 2021] [rewrite:trace1] [pid 4567] mod_rewrite.c(483): [client 167.248.133.59:40432] 167.248.133.59 - - [35.211.93.45/sid#7fd23b007810][rid#7fd23b1090a0/subreq] pass through /index.html  

How to toggle fullscreen on any app in Xmonad WM?

Posted: 04 Dec 2021 01:22 PM PST

I'm new around Xmonad WM and haskell is completely new to me, so be patient.

Running the almost stock ArcoLinux Xmonad.

  1. I'm trying to setup my browser i.e Brave to be able to go full screen at anytime I want and bind that to (modMask, xK_f) - Basically use that binding as a toggle to go full screen in some of the apps that I need, especially the browser. while hiding the polybar completely.
  2. The second thing I don't find how to do is to get rid completely of transparency in Xmonad. I don't like it and I'd love to get rid of it completely.

This is my ~/.xmonad/xmonad.sh

import System.IO  import System.Exit    import XMonad  import XMonad.Hooks.SetWMName  import XMonad.Hooks.DynamicLog  import XMonad.Hooks.ManageDocks  import XMonad.Hooks.EwmhDesktops  import XMonad.Hooks.ManageHelpers(doFullFloat, doCenterFloat, isFullscreen, isDialog)  import XMonad.Config.Desktop  import XMonad.Config.Azerty  import XMonad.Util.Run(spawnPipe)  import XMonad.Actions.SpawnOn  import XMonad.Util.EZConfig (additionalKeys, additionalMouseBindings)  import XMonad.Actions.CycleWS  import XMonad.Hooks.UrgencyHook  import qualified Codec.Binary.UTF8.String as UTF8    import XMonad.Layout.Spacing  import XMonad.Layout.Gaps  import XMonad.Layout.ResizableTile  ---import XMonad.Layout.NoBorders  import XMonad.Layout.Fullscreen (fullscreenFull)  import XMonad.Layout.Cross(simpleCross)  import XMonad.Layout.Spiral(spiral)  import XMonad.Layout.ThreeColumns  import XMonad.Layout.MultiToggle  import XMonad.Layout.MultiToggle.Instances  import XMonad.Layout.IndependentScreens      import XMonad.Layout.CenteredMaster(centerMaster)    import Graphics.X11.ExtraTypes.XF86  import qualified XMonad.StackSet as W  import qualified Data.Map as M  import qualified Data.ByteString as B  import Control.Monad (liftM2)  import qualified DBus as D  import qualified DBus.Client as D      myStartupHook = do      spawn "$HOME/.xmonad/scripts/autostart.sh"      setWMName "LG3D"    -- colours  normBord = "#4c566a"  focdBord = "#5e81ac"  fore     = "#DEE3E0"  back     = "#282c34"  winType  = "#c678dd"    --mod4Mask= super key  --mod1Mask= alt key  --controlMask= ctrl key  --shiftMask= shift key    myModMask = mod4Mask  encodeCChar = map fromIntegral . B.unpack  myFocusFollowsMouse = True  myBorderWidth = 2  myWorkspaces    = ["\61612","\61899","\61947","\61635","\61502","\61501","\61705","\61564","\62150","\61872"]  --myWorkspaces    = ["1","2","3","4","5","6","7","8","9","10"]  --myWorkspaces    = ["I","II","III","IV","V","VI","VII","VIII","IX","X"]    myBaseConfig = desktopConfig    -- window manipulations  myManageHook = composeAll . concat $      [ [isDialog --> doCenterFloat]      , [className =? c --> doCenterFloat | c <- myCFloats]      , [title =? t --> doFloat | t <- myTFloats]      , [resource =? r --> doFloat | r <- myRFloats]      , [resource =? i --> doIgnore | i <- myIgnores]      -- , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "\61612" | x <- my1Shifts]      -- , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "\61899" | x <- my2Shifts]      -- , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "\61947" | x <- my3Shifts]      -- , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "\61635" | x <- my4Shifts]      -- , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "\61502" | x <- my5Shifts]      -- , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "\61501" | x <- my6Shifts]      -- , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "\61705" | x <- my7Shifts]      -- , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "\61564" | x <- my8Shifts]      -- , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "\62150" | x <- my9Shifts]      -- , [(className =? x <||> title =? x <||> resource =? x) --> doShiftAndGo "\61872" | x <- my10Shifts]      ]      where      -- doShiftAndGo = doF . liftM2 (.) W.greedyView W.shift      myCFloats = ["Arandr", "Arcolinux-calamares-tool.py", "Arcolinux-tweak-tool.py", "Arcolinux-welcome-app.py", "Galculator", "feh", "mpv", "Xfce4-terminal"]      myTFloats = ["Downloads", "Save As..."]      myRFloats = []      myIgnores = ["desktop_window"]      -- my1Shifts = ["Chromium", "Vivaldi-stable", "Firefox"]      -- my2Shifts = []      -- my3Shifts = ["Inkscape"]      -- my4Shifts = []      -- my5Shifts = ["Gimp", "feh"]      -- my6Shifts = ["vlc", "mpv"]      -- my7Shifts = ["Virtualbox"]      -- my8Shifts = ["Thunar"]      -- my9Shifts = []      -- my10Shifts = ["discord"]          myLayout = spacingRaw True (Border 0 5 5 5) True (Border 5 5 5 5) True $ avoidStruts $ mkToggle (NBFULL ?? NOBORDERS ?? EOT) $ tiled ||| Mirror tiled ||| spiral (6/7)  ||| ThreeColMid 1 (3/100) (1/2) ||| Full      where          tiled = Tall nmaster delta tiled_ratio          nmaster = 1          delta = 3/100          tiled_ratio = 1/2      myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $        -- mod-button1, Set the window to floating mode and move by dragging      [ ((modMask, 1), (\w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster))        -- mod-button2, Raise the window to the top of the stack      , ((modMask, 2), (\w -> focus w >> windows W.shiftMaster))        -- mod-button3, Set the window to floating mode and resize by dragging      , ((modMask, 3), (\w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster))        ]      -- keys config    myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $    ----------------------------------------------------------------------    -- SUPER + FUNCTION KEYS      [ ((modMask, xK_d ), spawn $ "dmenu_run -i -nb '#191919' -nf '#fea63c' -sb '#fea63c' -sf '#191919' -fn 'NotoMonoRegular:bold:pixelsize=15'")    , ((modMask, xK_f), sendMessage $ Toggle NBFULL)    , ((modMask, xK_Return), spawn $ "alacritty" )    , ((modMask, xK_q), kill )    , ((modMask, xK_t), spawn $ "termite" )    , ((modMask, xK_r), spawn $ "rofi -show drun" )    , ((modMask, xK_v), spawn $ "pavucontrol" )    , ((modMask, xK_x), spawn $ "arcolinux-logout" )    , ((modMask, xK_l), spawn $ "betterlockscreen -l" )    , ((modMask, xK_Escape), spawn $ "xkill" )    , ((modMask, xK_e), spawn $ "thunar" )    , ((modMask, xK_s ), spawn $ "xfce4-settings-manager")    --, ((modMask, xK_c), spawn $ "conky-toggle" )    --, ((modMask, xK_y), spawn $ "polybar-msg cmd toggle" )          -- FUNCTION KEYS    , ((0, xK_F12), spawn $ "xfce4-terminal --drop-down" )      -- SUPER + SHIFT KEYS      , ((modMask .|. shiftMask , xK_r ), spawn $ "xmonad --recompile && xmonad --restart")    , ((modMask .|. shiftMask , xK_q ), kill)    -- , ((modMask .|. shiftMask , xK_x ), io (exitWith ExitSuccess))         -- CONTROL + KEYS            -- CONTROL + ALT KEYS      , ((controlMask .|. mod1Mask , xK_v ), spawn $ "virt-manager")    , ((controlMask .|. mod1Mask , xK_Prior ), spawn $ "conky-rotate -p")    , ((controlMask .|. mod1Mask , xK_a ), spawn $ "xfce4-appfinder")    , ((controlMask .|. mod1Mask , xK_b ), spawn $ "thunar")    , ((controlMask .|. mod1Mask , xK_c ), spawn $ "catfish")    , ((controlMask .|. mod1Mask , xK_e ), spawn $ "arcolinux-tweak-tool")    , ((controlMask .|. mod1Mask , xK_f ), spawn $ "firefox")    , ((controlMask .|. mod1Mask , xK_i ), spawn $ "nitrogen")    , ((controlMask .|. mod1Mask , xK_o ), spawn $ "$HOME/.xmonad/scripts/picom-toggle.sh")    , ((controlMask .|. mod1Mask , xK_t ), spawn $ "urxvt")    , ((controlMask .|. mod1Mask , xK_u ), spawn $ "pavucontrol")    --, ((controlMask .|. mod1Mask , xK_r ), spawn $ "rofi-theme-selector")    --, ((controlMask .|. mod1Mask , xK_k ), spawn $ "arcolinux-logout")    --, ((controlMask .|. mod1Mask , xK_l ), spawn $ "arcolinux-logout")    --, ((controlMask .|. mod1Mask , xK_Next ), spawn $ "conky-rotate -n")            -- ALT + ... KEYS      , ((mod1Mask, xK_n), spawn $ "variety -n" )    , ((mod1Mask, xK_F3), spawn $ "xfce4-appfinder" )    , ((mod1Mask, xK_p), spawn $ "variety -p" )    , ((mod1Mask, xK_r), spawn $ "xmonad --restart" )    --, ((mod1Mask, xK_f), spawn $ "variety -f" )    --, ((mod1Mask, xK_t), spawn $ "variety -t" )    --, ((mod1Mask, xK_Up), spawn $ "variety --pause" )    --, ((mod1Mask, xK_Down), spawn $ "variety --resume" )    --, ((mod1Mask, xK_Left), spawn $ "variety -p" )    --, ((mod1Mask, xK_Right), spawn $ "variety -n" )    --, ((mod1Mask, xK_F2), spawn $ "xfce4-appfinder --collapsed" )      --VARIETY KEYS WITH PYWAL      --, ((mod1Mask .|. shiftMask , xK_f ), spawn $ "variety -f && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")    --, ((mod1Mask .|. shiftMask , xK_n ), spawn $ "variety -n && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")    --, ((mod1Mask .|. shiftMask , xK_p ), spawn $ "variety -p && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")    --, ((mod1Mask .|. shiftMask , xK_t ), spawn $ "variety -t && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")    --, ((mod1Mask .|. shiftMask , xK_u ), spawn $ "wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")      --CONTROL + SHIFT KEYS        --SCREENSHOTS      , ((0, xK_Print), spawn $ "flameshot gui")    --, ((0, xK_Print), spawn $ "scrot 'ArcoLinux-%Y-%m-%d-%s_screenshot_$wx$h.jpg' -e 'mv $f $$(xdg-user-dir PICTURES)'")    , ((controlMask, xK_Print), spawn $ "xfce4-screenshooter" )    , ((controlMask .|. shiftMask , xK_Print ), spawn $ "gnome-screenshot -a -c")        --MULTIMEDIA KEYS      -- Mute volume    , ((0, xF86XK_AudioMute), spawn $ "amixer -q set Master toggle")      -- Decrease volume    , ((0, xF86XK_AudioLowerVolume), spawn $ "amixer -q set Master 5%-")      -- Increase volume    , ((0, xF86XK_AudioRaiseVolume), spawn $ "amixer -q set Master 5%+")      -- Increase brightness    , ((0, xF86XK_MonBrightnessUp),  spawn $ "light -A 5")      -- Decrease brightness    , ((0, xF86XK_MonBrightnessDown), spawn $ "light -U 5")    --  , ((0, xF86XK_AudioPlay), spawn $ "mpc toggle")  --  , ((0, xF86XK_AudioNext), spawn $ "mpc next")  --  , ((0, xF86XK_AudioPrev), spawn $ "mpc prev")  --  , ((0, xF86XK_AudioStop), spawn $ "mpc stop")      , ((0, xF86XK_AudioPlay), spawn $ "playerctl play-pause")    , ((0, xF86XK_AudioNext), spawn $ "playerctl next")    , ((0, xF86XK_AudioPrev), spawn $ "playerctl previous")    , ((0, xF86XK_AudioStop), spawn $ "playerctl stop")        --------------------------------------------------------------------    --  XMONAD LAYOUT KEYS      -- Cycle through the available layout algorithms.    , ((modMask, xK_space), sendMessage NextLayout)      --Focus selected desktop    , ((mod1Mask, xK_Tab), nextWS)      --Focus selected desktop    , ((modMask, xK_Tab), nextWS)      --Focus selected desktop    , ((controlMask .|. mod1Mask , xK_Left ), prevWS)      --Focus selected desktop    , ((controlMask .|. mod1Mask , xK_Right ), nextWS)      --  Reset the layouts on the current workspace to default.    , ((modMask .|. shiftMask, xK_space), setLayout $ XMonad.layoutHook conf)      -- Move focus to the next window.    , ((modMask, xK_j), windows W.focusDown)      -- Move focus to the previous window.    , ((modMask, xK_k), windows W.focusUp  )      -- Move focus to the master window.    , ((modMask .|. shiftMask, xK_m), windows W.focusMaster  )      -- Swap the focused window with the next window.    , ((modMask .|. shiftMask, xK_j), windows W.swapDown  )      -- Swap the focused window with the next window.    , ((controlMask .|. modMask, xK_Down), windows W.swapDown  )      -- Swap the focused window with the previous window.    , ((modMask .|. shiftMask, xK_k), windows W.swapUp    )      -- Swap the focused window with the previous window.    , ((controlMask .|. modMask, xK_Up), windows W.swapUp  )      -- Shrink the master area.    , ((controlMask .|. shiftMask , xK_h), sendMessage Shrink)      -- Expand the master area.    , ((controlMask .|. shiftMask , xK_l), sendMessage Expand)      -- Push window back into tiling.    , ((controlMask .|. shiftMask , xK_t), withFocused $ windows . W.sink)      -- Increment the number of windows in the master area.    , ((controlMask .|. modMask, xK_Left), sendMessage (IncMasterN 1))      -- Decrement the number of windows in the master area.    , ((controlMask .|. modMask, xK_Right), sendMessage (IncMasterN (-1)))      ]    ++      -- mod-[1..9], Switch to workspace N    -- mod-shift-[1..9], Move client to workspace N    [((m .|. modMask, k), windows $ f i)      --Keyboard layouts    --qwerty users use this line     | (i, k) <- zip (XMonad.workspaces conf) [xK_1,xK_2,xK_3,xK_4,xK_5,xK_6,xK_7,xK_8,xK_9,xK_0]      --French Azerty users use this line    -- | (i, k) <- zip (XMonad.workspaces conf) [xK_ampersand, xK_eacute, xK_quotedbl, xK_apostrophe, xK_parenleft, xK_minus, xK_egrave, xK_underscore, xK_ccedilla , xK_agrave]      --Belgian Azerty users use this line    -- | (i, k) <- zip (XMonad.workspaces conf) [xK_ampersand, xK_eacute, xK_quotedbl, xK_apostrophe, xK_parenleft, xK_section, xK_egrave, xK_exclam, xK_ccedilla, xK_agrave]          , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)        , (\i -> W.greedyView i . W.shift i, shiftMask)]]      ++    -- ctrl-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3    -- ctrl-shift-{w,e,r}, Move client to screen 1, 2, or 3    [((m .|. controlMask, key), screenWorkspace sc >>= flip whenJust (windows . f))        | (key, sc) <- zip [xK_w, xK_e] [0..]        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]      main :: IO ()  main = do        dbus <- D.connectSession      -- Request access to the DBus name      D.requestName dbus (D.busName_ "org.xmonad.Log")          [D.nameAllowReplacement, D.nameReplaceExisting, D.nameDoNotQueue]          xmonad . ewmh $    --Keyboard layouts    --qwerty users use this line              myBaseConfig    --French Azerty users use this line              --myBaseConfig { keys = azertyKeys <+> keys azertyConfig }    --Belgian Azerty users use this line              --myBaseConfig { keys = belgianKeys <+> keys belgianConfig }                    {startupHook = myStartupHook  , layoutHook = gaps [(U,35), (D,5), (R,5), (L,5)] $ myLayout ||| layoutHook myBaseConfig  , manageHook = manageSpawn <+> myManageHook <+> manageHook myBaseConfig  , modMask = myModMask  , borderWidth = myBorderWidth  , handleEventHook    = handleEventHook myBaseConfig <+> fullscreenEventHook  , focusFollowsMouse = myFocusFollowsMouse  , workspaces = myWorkspaces  , focusedBorderColor = focdBord  , normalBorderColor = normBord  , keys = myKeys  , mouseBindings = myMouseBindings  }  

OWASP Guide for web app penetration testing says use "nmap –PN –sT –sV –p0" but in my Kali OS it says failed to resolve

Posted: 04 Dec 2021 01:26 PM PST

On page 35 of the Owasp testing guide, it says to use Nmap as:

nmap –PN –sT –sV –p0-65535 192.168.1.100  

but running this on my machine with the -PN -sT -p0 flags gives the following errors:

Failed to resolve "–PN".  Failed to resolve "–sT".  Failed to resolve "–sV".  Failed to resolve "–p0-65535".  

How can I fix this?

What does the numeric prefix mean for the files located in `/etc/sudoers.d`?

Posted: 04 Dec 2021 12:11 PM PST

I go to /etc/sudoers folder to check users who have sudo permission and found each file has a numeric prefix.

root@10.0.1.13:/etc/sudoers.d# ls  80-deploy-user  90-cloud-init-users README  

What are they used for?

PipeWire not detecting devices and profiles

Posted: 04 Dec 2021 12:07 PM PST

I am having issues with PipeWire, on startup, it seems to not detect devices and their profiles. I sometimes have to do the following to get everything working. Though this does not happen always and sometimes different devices/profiles are missing.

systemctl --user restart pipewire  killall plasmashell && plasmashell& # this doesn't seem to be necessary anymore  

This probably has a relation to my other question which seems to have resurfaced in this form with my system starting to use PipeWire.


The logs are saying the following:

> journalctl --user -u pipewire  Nov 14 08:53:08 Simon-s-PC systemd[1131]: Started PipeWire Multimedia Service.  Nov 14 08:53:08 Simon-s-PC pipewire[1444]: mod.rtkit: RTKit error: org.freedesktop.DBus.Error.AccessDenied  Nov 14 08:53:08 Simon-s-PC pipewire[1444]: mod.rtkit: could not set nice-level to -11: Permission denied  Nov 14 08:53:09 Simon-s-PC pipewire[1444]: mod.rtkit: RTKit error: org.freedesktop.DBus.Error.AccessDenied  Nov 14 08:53:09 Simon-s-PC pipewire[1444]: mod.rtkit: could not make thread realtime: Permission denied  Nov 14 08:53:10 Simon-s-PC pipewire[1444]: spa.alsa: 'front:2': capture open failed: Device or resource busy  Nov 14 08:53:10 Simon-s-PC pipewire[1444]: mod.adapter: 0x5630be589270: can't get format: Device or resource busy  Nov 14 08:53:10 Simon-s-PC pipewire[1444]: mod.adapter: can't create node: Device or resource busy  

And some version/system info:

❯ pulseaudio --version  pulseaudio 15.0  ❯ pipewire --version  pipewire  Compiled with libpipewire 0.3.39  Linked with libpipewire 0.3.39  ❯ uname -a  Linux Simon-s-PC 5.10.0-1-amd64 #1 SMP Debian 5.10.4-1 (2020-12-31) x86_64 GNU/Linux  

Thanks for any help!

How do I disable audio sink suspend on idle using WirePlumber in Fedora 35 so that audio isn't delayed when starting playback?

Posted: 04 Dec 2021 12:09 PM PST

In Fedora 35, WirePlumber has replaced pipewire-media-session as the audio session manager. There is a highly annoying problem with audio on many built-in soundcards on Linux where the audio sink is suspended after nothing is played for 3 seconds. Upon resuming playback after 3 seconds have passed, audio is delayed or pops in. How do we fix this default behavior?

Blink LED on different times on Linux

Posted: 04 Dec 2021 01:31 PM PST

I made a python program to blink LED on Ubuntu installed on Raspi3b. It's running and I could blink the LED. Next steps are to blink at different times: when I power on, after ssh is active, and the end of shutdown. I am very new to Linux and system programming.

My problem is to trigger the LED blink right after SSH is active. I mean that when booting, I saw the line SSH and I want right the LED to blink right after that. I have created a *.sh file and *.service file. This source does not work after SSH is active or enabled. Once I log in from SSH and trigger sudo systemctl start my-startup.service I saw the LED blink. I don't understand why it didn't blink after SSH was active or enabled.

Because I learn a lot from here, I would like to continue on this topic, once I can blink on different status.

  1. Power On (Maybe beginning when the Linux boot started )
  2. SSH Active/enabled
  3. Boot Ends
  4. End of Shutdown

My first script is the SSH;

GNU nano 4.8                              /usr/local/sbin/my-startup.sh  #!/bin/bash    check_stat=`ps -ef | grep sshd | grep -v grep | awk '{print $2}'`  if [ "${check_stat}X" != "X" ]  then  echo "SSHD is running"  python3 /usr/local/sbin/my-startup.py  else  echo "SSHD isn't running"  fi  
GNU nano 4.8                          /etc/systemd/system/my-startup.service  [Unit]  Description=Startup  After=ssh.service    [Service]  Type=simple  ExecStart=/usr/local/sbin/my-startup.sh    [Install]  WantedBy=multi-user.target  
#  Blink an LED with the LGPIO library  #  Uses lgpio library, compatible with kernel 5.11  #  Author: William 'jawn-smith' Wilson    import time  import RPi.GPIO as GPIO      GPIO.setmode(GPIO.BCM)  GPIO.setwarnings(False)  GPIO.setup(23,GPIO.OUT)    GPIO.output(23,GPIO.HIGH)  time.sleep(1)    GPIO.output(23,GPIO.LOW)  

Server crashes after ~20 minutes

Posted: 04 Dec 2021 12:09 PM PST

My Ubuntu 20.04 server crashes around 20 minutes after boot. It is as if the server is turned off.

There is nothing in the log files, and no kernel panic on screen when it crashes.

RAM passes 24 hour RAM test with no errors.

If I install another OS it does not crash.

What could be the cause?

Copy paste from unix file to notepad

Posted: 04 Dec 2021 01:05 PM PST

How can I copy content of large unix file (putty tool) to notepad?

Open file from history in Zathura

Posted: 04 Dec 2021 08:52 AM PST

Is this possible using a built-in command? AFAIK, it is not, so I am trying to define a mapping that uses the exec Zathura command to achieve this. In bash,

cat ~/.local/share/zathura/history | grep -Po "\[\K[^\]]*" | dmenu | xargs zathura  

does the job, but I haven't managed to get this command working when using the exec command in Zathura. In fact, something as simple as

:exec ls | dmenu  

doesn't work either, even when I surround ls | dmenu with quotation marks. So a more general question would be: how do I run a command with pipes from within Zathura?

How can I fix the no screen error on xserver startup on Linux?

Posted: 04 Dec 2021 12:00 PM PST

When I try to start my Debian 9 xserver, it shows a black screen.

Xorg -configure outputs

Number of created screens does not match number of detected devices

and outputs a non-working xorg.conf.

glxinfo | grep -i vendor outputs:

unable to open display

I have a nVidia GeForce GTX 745 with 4GB and I am using the nouveau drivers, because Nvidia's own drivers output the same error and I wanted to set my drivers back to default. This happened after I tried to install the nVidia nvidia-driver packages to have better performance.

How to run docker inside android chroot

Posted: 04 Dec 2021 09:03 AM PST

I have debian stretch installed in arm64 android phone in chrooted environment. I have installed docker-ce following these steps from here.

On starting docker :: systemctl start docker

returns this error :: Running in chroot, ignoring request.

Checking using service docker status shows [FAIL] Docker is not running ... failed!

How can I run it inside chroot on my android phone ?

Using Linux machine as a monitor for a Windows machine

Posted: 04 Dec 2021 09:22 AM PST

What software do I need if I want to use an old laptop running Linux as a second monitor for a Windows 10 PC? Both screens shoud be in one workspace.

SVN connection refused (Ubuntu)

Posted: 04 Dec 2021 10:04 AM PST

I'm trying to check out my repository, but it can not connect to my project archive and refuses the connection. When I try to checkout in Uni it works, but not at home. I tried to change the ~/.subversion/servers file but it didn't work. I've been struggling with this issue for a long time, can anyone help me ?

svn: E170013: Konnte nicht mit Projektarchiv bei URL »https://www.myrepository.org« verbinden    svn: E000111: Fehler beim Ausführen des Kontextes: Verbindungsaufbau abgelehnt  

IP rule table look up does not seem to work

Posted: 04 Dec 2021 11:05 AM PST

I have a sytem with three network interfaces. Below is the configuration that I'm trying to set up. wlan0 (its actually an WiFi AP interface) - other devices connects via this interface. net1 - interface facing internet that has to be linked to wlan0 to provide internet services to devices connected via wlan0. net0 - interface facing restricted internet access to answer queries only for requests from within this subnet.

The default interface is net0 and its gateway. The output of ip route show looks like this:

default via 10.228.103.241 dev net0  10.228.103.240/30 dev net0 src 10.228.103.242  

Now I would like to system to look up table 7 for route rules for all requests to eth0 and

net1.  So I created ip rules as below:  0:      from all lookup local  32758:  from all lookup main  32762:  from 8.8.0.0/16 lookup iTbl  32764:  from 192.168.225.1 lookup iTbl  32765:  from 192.168.172.2 lookup iTbl  32767:  from all lookup default  

8.8.0.0 is for nameservers. Its listed as iTbl because I have defined 7 as iTbl in /etc/iproute2/rt_tables.

ip route show for table 7 looks like this:

default via 192.168.172.3 dev net1  8.8.0.0/16 via 192.168.172.3 dev net1  192.168.172.0/24 dev net1  src 192.168.172.2  192.168.225.0/24 dev wlan0  src 192.168.225.1  

And finally my iptables looks like this:

iptables -nvL  Chain INPUT (policy ACCEPT 245 packets, 49904 bytes)   pkts bytes target     prot opt in     out     source               destination    Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)   pkts bytes target     prot opt in     out     source               destination      3   180 ACCEPT     all  --  wlan0   *       0.0.0.0/0            0.0.0.0/0    Chain OUTPUT (policy ACCEPT 190 packets, 19182 bytes)   pkts bytes target     prot opt in     out     source               destination    iptables -nvL -t nat  Chain PREROUTING (policy ACCEPT 22 packets, 2205 bytes)   pkts bytes target     prot opt in     out     source               destination    Chain INPUT (policy ACCEPT 21 packets, 2145 bytes)   pkts bytes target     prot opt in     out     source               destination    Chain OUTPUT (policy ACCEPT 91 packets, 7782 bytes)   pkts bytes target     prot opt in     out     source               destination    Chain POSTROUTING (policy ACCEPT 90 packets, 7226 bytes)   pkts bytes target     prot opt in     out     source               destination      2   616 MASQUERADE  all  --  *      net1  0.0.0.0/0            0.0.0.0/0  

When I connected a device to wlan0 interface and try to browse internet, tcpdump shows all the requests from wlan0 seem to go via net0, which actually has to go via net1 desirably. I read through many posts and forums. After trying different things I couldn't solve the issue. I am not able to understand where its going wrong. From the tcpdump and logically looking at it, seems like the ip rule lookup to table 7 is not working. Please help to check if any of the rules has to be corrected.

No comments:

Post a Comment