Monday, November 29, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How to define a variable in .def file in Linux

Posted: 29 Nov 2021 07:50 AM PST

I am working first time on def file in Linux, but don't know how to set a variable in def file. i tried by below ways, but it's not working for me.

    **Test_DIR=/usr/include/  TEST_DIR_GCC_VERSION=$(shell gcc -dumpversion)  #define  TEST_LIB $(Test_DIR)/$(TEST_DIR_GCC_VERSION)**  

in result i am getting only TEST_LIB=/usr/include,but not getting the entire variable path.

Any help will really appreciated, as struggling from last three days.

debian buster exim4 hostname --fqdn did not return a fully qualified name

Posted: 29 Nov 2021 07:47 AM PST

I'm running debian buster, and let exim4 deliver for localhost mail from apt-listchanges. this works but I get the error

alex@Taomon:~$ LANG=C  alex@Taomon:~$ systemctl status exim4  * exim4.service - LSB: exim Mail Transport Agent     Loaded: loaded (/etc/init.d/exim4; generated)     Active: active (running) since Mon 2021-11-29 10:51:40 CET; 5h 36min ago       Docs: man:systemd-sysv-generator(8)    Process: 1299 ExecStart=/etc/init.d/exim4 start (code=exited, status=0/SUCCESS)      Tasks: 1 (limit: 4340)     Memory: 5.7M     CGroup: /system.slice/exim4.service             `-1571 /usr/sbin/exim4 -bd -q30m    Nov 29 10:51:40 Taomon systemd[1]: Starting LSB: exim Mail Transport Agent...  Nov 29 10:51:40 Taomon exim4[1299]: Starting MTA:hostname --fqdn did not return a fully qualified name, dc_minimaldns will not  Nov 29 10:51:40 Taomon exim4[1299]: work. Please fix your /etc/hosts setup.  Nov 29 10:51:40 Taomon exim4[1299]:  exim4.  Nov 29 10:51:40 Taomon systemd[1]: Started LSB: exim Mail Transport Agent.  alex@Taomon:~$   

I read over the years some sides but never understood to solve it. I tried more than once

dpkg-reconfigure exim4-config   

some I hope relevant infos

alex@Taomon:~$ cat /etc/hostname   Taomon  alex@Taomon:~$   
      root@Taomon:~# hostnamectl status         Static hostname: Taomon               Icon name: computer-laptop                 Chassis: laptop              Machine ID: 84876d350fa0dd8b520fd47e0000000b                 Boot ID: 0144c780c7d747de92e1fbb41b1b506e        Operating System: Debian GNU/Linux 10 (buster)                  Kernel: Linux 4.19.0-18-amd64            Architecture: x86-64      root@Taomon:~#   

Next to long for here Exim in address testing mode

Note exim delivers my mail correct. But the error makes me nervous. Almost forgot

root@Taomon:~# cat /etc/hosts  127.0.0.1   localhost  127.0.1.1   Taomon    #PS4 einbinden    #172.16.0.2      PS4    # The following lines are desirable for IPv6 capable hosts  ::1     ip6-localhost ip6-loopback  #fe00::0 ip6-localnet  #ff00::0 ip6-mcastprefix  #ff02::1 ip6-allnodes  #ff02::2 ip6-allrouters  root@Taomon:~#   

Linux clipboard on Windows

Posted: 29 Nov 2021 05:53 AM PST

Is there somewhere a software to get the select/middle-click clipboard of Linux, on Windows?

(without losing the capacity to close a tab with a middle-click, without having focus on mouse, without having to focus a window to paste, with capacity to select on double-click)

Dolphin crashes on opening terminal

Posted: 29 Nov 2021 07:25 AM PST

I'm using Dolphin(FM) on a daily basis. And, it crashes while opening a terminal window on current working directory. Same result by using the shortcut Shift + F4. But, it works if I open it as panel...

enter image description here

Currently I'm using Manjaro: Qonos, 21.2.0 on

KDE Plasma Version: 5.23.3  KDE Frameworks Version: 5.88.0  Qt Version: 5.15.2  Kernel Version: 5.10.79-1-MANJARO (64-bit)  Graphics Platform: X11  Graphics Processor: AMD ARUBA  

So, do I consider it as a bug?

How to access files in USB in linux

Posted: 29 Nov 2021 07:27 AM PST

I'm using Ubuntu 20.04, recently (almost a week ago) I upgraded my kernel from 5.11.0 to 5.14.0 and after that I can't access any USB drivers. The system recognises my USBs since when I run lsusb it give the output

Bus 001 Device 005: ID 0781:556b SanDisk Corp. Cruzer Edge  

And even dmesg gives

[16972.246970] usb 1-2: new high-speed USB device number 5 using xhci_hcd  [16972.395933] usb 1-2: New USB device found, idVendor=0781, idProduct=556b, bcdDevice= 1.26  [16972.395938] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3  [16972.395939] usb 1-2: Product: Cruzer Edge  [16972.395940] usb 1-2: Manufacturer: SanDisk  [16972.395941] usb 1-2: SerialNumber: 2005375352115C834970  

But lsblk does show the device mounted anywhere this is the output of lsblk, in this both sda and sdb are harddrives

sda      8:0    0 931.5G  0 disk   ├─sda1   8:1    0    16M  0 part   └─sda2   8:2    0 931.5G  0 part   sdb      8:16   0 119.2G  0 disk   ├─sdb1   8:17   0   260M  0 part /boot/efi  ├─sdb2   8:18   0    16M  0 part   ├─sdb3   8:19   0  80.7G  0 part   ├─sdb4   8:20   0  37.3G  0 part /  └─sdb5   8:21   0   980M  0 part   

The USB isn't faulty because I've checked it in other laptops neither is the USB port since I've tested it in windows (I've dual booted Ubuntu with windows) in the same machine and it works well there.

I doubt that this might have happened because, while generating config files for modules and driver while upgrading to kernel 5.14.0 I used make localmodconfig which makes a new config file from the drivers in use at that time instead of copying the config files in the old kernel, therefore maybe the device driver maybe missing (not sure though, I don't know much about accessing block devices). If that's the case how to fix it?

Is there any way I can find the device and mount it into a directory to access the files in a USB?

Edit 1: This is the output I get as the output for sudo journalctl --follow

Nov 29 19:25:16 adeeb kernel: usb 1-2: new high-speed USB device number 8 using xhci_hcd  Nov 29 19:25:16 adeeb kernel: usb 1-2: New USB device found, idVendor=0781, idProduct=556b, bcdDevice= 1.26  Nov 29 19:25:16 adeeb kernel: usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3  Nov 29 19:25:16 adeeb kernel: usb 1-2: Product: Cruzer Edge  Nov 29 19:25:16 adeeb kernel: usb 1-2: Manufacturer: SanDisk  Nov 29 19:25:16 adeeb kernel: usb 1-2: SerialNumber: 2005375352115C834970  Nov 29 19:25:16 adeeb mtp-probe[18152]: checking bus 1, device 8: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2"  Nov 29 19:25:16 adeeb mtp-probe[18152]: bus: 1, device: 8 was not an MTP device  Nov 29 19:25:16 adeeb mtp-probe[18155]: checking bus 1, device 8: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2"  Nov 29 19:25:16 adeeb mtp-probe[18155]: bus: 1, device: 8 was not an MTP device  

"sshpass" with "scp" just hangs (Failed publickey)

Posted: 29 Nov 2021 04:15 AM PST

I am trying to send folder from my Linux machine. This command works entirely and my folder is transferred if I run it manually from my Linux server.

sshpass -vvv -f /home/user1/sshpass.txt -P assphrase scp -o StrictHostKeyChecking=no -r dir1 user1@10.7.175.143:/  

On the server side I can see that public key was Accepted.

Accepted publickey for user1 from 10.7.141.243 port 37960 ssh2: RSA SHA256:....  

Now I put the same command in the Jenkins build commands. Build is executed of course on the same RHEL server.

sh "pwd"  sh "sshpass -vvv -f /home/user1/sshpass.txt -P assphrase scp -o StrictHostKeyChecking=no -r dir1 user1@10.7.175.143:/"  

Output on the client side:

sshpass -vvv -f /home/user1/sshpass.txt -P assphrase scp -o StrictHostKeyChecking=no -r tools user1@10.7.175.143:/
SSHPASS searching for password prompt using match "assphrase"
SSHPASS read: user1@10.7.175.143's password:

This output just hangs and nothing happens until I Abort the execution.

I have run the server in debug mode and I can notice one Error in this case:

Failed publickey for user1 from 10.7.141.243 port 38922 ssh2: RSA SHA256:d+34+L7wemb....  

But the same public key is being used for my manual sshpass execution.

Can you please assist me what might be the issue of this strange behaviour?

Thank you!

Using shell builtins command over ssh [closed]

Posted: 29 Nov 2021 04:40 AM PST

The following command doesn't give an output.

sshpass -f ~/.password.txt ssh <user>@<ip> "which ls"  

I found out that which is a builtin command so I also tried with

sshpass -f ~/.password.txt ssh <user>@<ip> "/bin/which ls"  

This gives me no results as well.

I've also tried to run this command with bash -l.

sshpass -f ~/.password.txt ssh <user>@<ip> 'bash -l "which ls"'  

How can I use the which command in an SSH connection?

How to get Public IP Subnet and default gateway value on my Debian Linux?

Posted: 29 Nov 2021 07:45 AM PST

In order to configure my VPN, I need to determine these values:

Public IP : I can do that with curl ifconfig.me

Public IP Subnet : How do get this value ?

Default Gateway : how to get this value ? I tried with route

eth0 is device to gateway : : how to get this value ? I tried with route

How to toggle fullscreen on any app in Xmonad WM?

Posted: 29 Nov 2021 07:08 AM 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  }  

Rsync folders with names that begin with a single and/or double-dash

Posted: 29 Nov 2021 07:48 AM PST

Looking to rsync a drive that contains folders that begin with a single dash or a double dash, for example:

  • -Archives-
  • --Archives--

I've tried the following:

rsync -azP -e <source drive>/* <destination drive>

...however, the folders that start with dashes (-) or double-dashes (--) are not getting synced.

How can I ensure that any folders beginning with dashes (-) or double-dashes (--) get properly synced?

'sendmail' doesn't reliably send notification to be triggered by 'logread' output

Posted: 29 Nov 2021 04:20 AM PST

I am trying to monitor the logs on my OPENWRT router and send an email when the PPPTD service writes to the log:

Mon Nov 29 09:10:31 2021 daemon.info pptpd[5832]: CTRL: Client x.x.x.x control connection started  

I am using this script:

#!/bin/ash    logread -f | awk ' /control connection started/ { print "From: R01 Router <orignating email@email.com>"         print "To: mypersonalemail@email.com"         print "Mime-Version: 1.0"         print "Content-Type: text/plain"         print "Subject: Incoming PPTP connection from" $10         print "Content-Transfer-Encoding: 7bit"         print "Incoming PPTP connection from " $10 } ' | /usr/sbin/sendmail -t &  

but getting inconsitant results because email is not always sent. Can someone please point me in the right direction?

Display a transparent animation on top of gnome

Posted: 29 Nov 2021 05:11 AM PST

I would like to display a transparent fireworks animation on top of whatever application is currently open for a brief period of time.

(The animation will be triggered when a change in a file is detected by a Python script.)

I should be able to continue to interact and see both the application and the GUI while the animation is playing.

Is it doable?

I am on Fedora

How can I use xmlstarlet to query a tag for two attribute values?

Posted: 29 Nov 2021 07:29 AM PST

Example:- <item href="cover.jpeg" id="cover" media-type="image/jpeg"/>

I'd like to select @id="cover" and media-type="image/*" and retrieve @href.

My current "solution" seems to be:- xmlstarlet sel -t -m "//_:item[@id='$opf_cover_name']" -v @href -o '|' -v @media-type -n file.xml, followed by some extremely messy splitting around the '|' character of the output.

Does xmlstarlet have a substring function?  Version = 1.6.1  compiled against libxml2 2.9.4, linked with 20904  compiled against libxslt 1.1.29, linked with 10132  

Awk/sed to separate last column and add quotes around middle column?

Posted: 29 Nov 2021 06:54 AM PST

I've got a file called test.txt and after some manipulations it looks like this:

Metabolism  Global and overview maps  01100 Metabolic pathways (1689)  01110 Biosynthesis of secondary metabolites (677)  01120 Microbial metabolism in diverse environments (356)  01200 Carbon metabolism (44)  012111 Carbon metabolism (151) test: test test (44)  

Now, I want to separate the last column with bracketed numbers so that they are a separate column (using semi colons as my delimiter of choice). I also want to put quotes around all text that are between the bracketed numbers and the ID numbers at the start. Finally, I would like to keep the header rows (the first two in this example).

My code:

 sed -r 's/ +/;/' test.txt | awk 'NF{NF-=1};1' | awk -F ";" '{sub($2, "\"&\""); print}'  

My current output:

""  Global;"and overview"  01100;"Metabolic pathways"  01110;"Biosynthesis of secondary metabolites"  01120;"Microbial metabolism in diverse environments"  01200;"Carbon metabolism"  012111;Carbon (151) test: test test  

As you can see the "Metabolism" header is gone because it is technically the last value in that row, as well as "maps" in the second row, with a semi colon after "Global" which is not needed. Some rows have bracketed numbers within the text which I should keep but otherwise all rows end with a bracketed value that should be separated into it's only column separated by a semi colon. I also can't get the quotes to go around all of the second column in the last row, whereas the other rows are okay. Finally, I don't know how to separate the bracketed values so that they are a third column.

My desired output (keeping the numbers as a sep column):

"Metabolism"  "Global and overview"  01100:"Metabolic pathways";1689  01110:"Biosynthesis of secondary metabolites";677  01120:"Microbial metabolism in diverse environments";356  01200:"Carbon metabolism";44  012111:"Carbon metabolism (151) test: test test";44  

using awk GNU version 4.1.3 and sed GNU version 4.2.2. on Windows Linux Sub-system

Unable to format or use two USB flash drives

Posted: 29 Nov 2021 04:31 AM PST

I have 2 USB's I'm unable to use... One went out a Month ago and the second followed suit yesterday. The USB's are Supersonic RAGE Elite 128GB drives and I've tried everything I can think of through Linux & Windows. I've tried USB2 & USB3 ports. Any help would be appreciated.

sudo hdparm -r0 /dev/sdb    /dev/sdg:   setting readonly to 0 (off)   readonly = 0 (off)    sudo fsck -f /dev/sdg  

Disk write-protected; use the -n option to do a read-only check of the device

sudo wipefs -a /dev/sdg  

probing initialization failed: Read-only file system

sudo dd if=/dev/zero of=/dev/sdg  

dd: failed to open '/dev/sdg': Read-only file system

sudo -i  umount /dev/sdg  mkfs.vfat /dev/sdg  

mkfs.vfat: unable to open /dev/sdg: Read-only file system

How to connect Ubuntu to AirPlay speakers placed in another network?

Posted: 29 Nov 2021 04:45 AM PST

I have Ubuntu 21.10 with ip 192.168.0.1 connected to a router having a static ip WAN=192.168.0.2 and Gateway=192.168.0.1; basically my Ubuntu is the Gateway. The router's LAN address is 192.168.1.1. In LAN I have some KEF SLX WIFI speakers to which I can connect from my iPhone and Windows 10 computer, both in router's LAN.

I also want to connect to the speakers from my Ubuntu (192.168.0.1) too; how should I configure the router (or Ubuntu) to have it?

I already enabled Make discoverable Apple AirTunes sound devices available locally in paprefs (used sudo ln -sv '/usr/lib/pulse-15.0+dfsg1' /usr/lib/pulse-15.0) but locally means 192.168.0.0/24 for Ubuntu. In the end Ubuntu machine must remain the Gateway for the router.

coverswitch, flip-switch is missing from TaskSwitcher

Posted: 29 Nov 2021 07:28 AM PST

Everything was working fine. I update my PC last night & found out that task switching defaults to breeze scheme.

Though, I don't use other effects available there rather than flip-switch(as alternative) and cover-switch. Both, seems to be rolled out.

Is there a way to get them back?? Though, I'm not sure if it happens to everyone who uses kde. I'm on KDE (Plasma: 5.23.3, Framework: 5.88.0, Qt: 5.15.2) over Manjaro.

Windows cannot access Samba after changing password

Posted: 29 Nov 2021 04:17 AM PST

I have a samba server setup in Ubuntu 18.04 and have multiple users with their own respective folder to access with their credentials. Right after a user changes his/her samba password the users cannot log into the samba share without restarting the computer or clearing out the cache.

Can it be configured from somewhere in the samba server that the user credentials are not cached in the Windows machines?

rkhunter warning on /dev/shm/mono.*. Is this false positive?

Posted: 29 Nov 2021 03:44 AM PST

rkhunter is giving warning on /dev/shm/mono.*. I couldn't find anywhere in the web reference to this file related to rkhunter warnings.

[12:38:29]   Checking /dev for suspicious file types         [ Warning ]  [12:38:29] Warning: Suspicious file types found in /dev:  [12:38:29]          /dev/shm/mono.1254: data  

Is this a false positive?


Output of df -h

Filesystem                                 Size  Used Avail Use% Mounted on  udev                                       7.8G     0  7.8G   0% /dev  tmpfs                                      1.6G  2.1M  1.6G   1% /run  /dev/sdb2                                  916G  357G  513G  41% /  tmpfs                                      7.8G  121M  7.7G   2% /dev/shm  tmpfs                                      5.0M  4.0K  5.0M   1% /run/lock  tmpfs                                      7.8G     0  7.8G   0% /sys/fs/cgroup  /dev/sdb1                                  511M  4.5M  507M   1% /boot/efi  /dev/sda1                                  1.8T   87G  1.7T   5% /mnt/HDD_Toshiba  tmpfs                                      1.6G     0  1.6G   0% /run/user/0  SynologyNas.local:/volumeUSB2/usbshare2-1  2.3T  1.6T  683G  71% /mnt/synologyDrive  tmpfs                                      1.6G   20K  1.6G   1% /run/user/121  tmpfs                                      1.6G   48K  1.6G   1% /run/user/1000  

Error: Unable to retrieve http://repo.mysql.com/apt/debian/dists/buster/InRelease 403 Forbidden [IP: 23.57.81.191 80]

Posted: 29 Nov 2021 03:44 AM PST

I'm installing mysql-server on my Debian 10.

I used the command: wget in the /tmp file, then sudo dpkg command which returned the following response:

 acelys @ uno-test-temp: / tmp $ sudo dpkg -i mysql-apt *      (Reading database ... 46803 files and directories already installed.)      Preparing to unpack mysql-apt-config_0.8.19-1_all.deb ...      Unpacking mysql-apt-config (0.8.19-1) to (0.8.19-1) ...      Setting up mysql-apt-config (0.8.19-1) ...      Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config)      OK  

Then I typed the command: sudo apt update and here's the response with errors:

acelys @ uno-test-temp: / tmp $ sudo apt update      Err: 1 http://repo.mysql.com/apt/debian buster InRelease        403 Forbidden [IP: 23.57.81.191 80]      Reached: 2 http://deb.debian.org/debian buster InRelease      Achieved: 3 http://security.debian.org/debian-security buster / updates InRelease      Reached: 4 http://deb.debian.org/debian buster-updates InRelease      Reached: 5 https://packages.sury.org/php buster InRelease      Reading Package Lists ... Done      E: Unable to retrieve http://repo.mysql.com/apt/debian/dists/buster/InRelease 403 Forbidden [IP: 23.57.81.191 80]      E: The http://repo.mysql.com/apt/debian buster InRelease repository is unsigned.      N: Updates from such a repository cannot be done securely, and are therefore disabled by default.      N: See the apt-secure (8) man pages for repository creation and user configuration details.  

I have searched for lot of articles on Internet, they all talk about doing modifications in the sources.list file, but they don't precise what kind of modification I should do.

Here's my sources.list file:

# deb cdrom:[Debian GNU/Linux 10.0.0 _Buster_ - Official amd64 DVD Binary-1 20190706-10:24]/ buster contrib main    #deb cdrom:[Debian GNU/Linux 10.0.0 _Buster_ - Official amd64 DVD Binary-1 20190706-10:24]/ buster contrib main    deb http://security.debian.org/debian-security buster/updates main contrib  deb-src http://security.debian.org/debian-security buster/updates main contrib    # buster  deb http://deb.debian.org/debian/ buster main  # deb-src http://deb.debian.org/debian/ buster main    # buster-updates, previously known as 'volatile'  deb http://deb.debian.org/debian/ buster-updates main  #deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free  

And here's my mysql.list file:

### THIS FILE IS AUTOMATICALLY CONFIGURED ###  # You may comment out entries below, but any other modifications may be lost.  # Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications.  deb http://repo.mysql.com/apt/debian/ buster mysql-apt-config  deb http://repo.mysql.com/apt/debian/ buster mysql-8.0  deb http://repo.mysql.com/apt/debian/ buster mysql-tools  #deb http://repo.mysql.com/apt/debian/ buster mysql-tools-preview  deb-src http://repo.mysql.com/apt/debian/ buster mysql-8.0   

Bluetooth Mouse Lag

Posted: 29 Nov 2021 07:56 AM PST

looking for help diagnosing bluetooth mouse lag. I'm using a Logitech MX Anywhere 2, I've had it a few years now and it's worked well on a number of Linux distros. I recently installed Debian 10 and set it up to use Sid repos. In this environment, the mouse does not work as responsively as normal. I'm on a laptop, and the touchpad works perfectly smoothly, and a wired mouse is also perfectly smooth. What I get with the bluetooth mouse is as if the sampling rate is maybe once every 3 or 4 frames.

I still have Pop!_OS installed which is based on Ubuntu 19.04, the mouse works as expected in that environment. Forgetting the mouse and re-adding it offers no change to behaviour, same with reboots. I've updated to the latest state of the repos, no dice. I've also tried switching from Wayland to Xorg with no effect.

My best guess would be that it's down to the iwlwifi module (it's a Lenovo Yoga 900 with an Intel Core i7 6560U with integrated Intel Wireless 8260), but no idea where to go from here.

Cheers!

Detect CLI or Wine executable in Manjaro

Posted: 29 Nov 2021 04:50 AM PST

In my Linux Mint installation, I can directly execute a PE executable at the command line, and if it's a .NET/CLI executable, then it will automatically execute it with Mono, and otherwise, it will automatically execute it with Wine.

This works because binfmt is configured to run /usr/lib/binfmt-support/run-detectors for both CLI and Wine executables. This runs a series of detectors configured in /var/lib/binfmts to determine what type of PE executable it is and execute the appropriate command to run it.

In Manjaro, I have binfmt, but I don't have run-detectors. So I guess the first match in /proc/sys/fs/binfmt_misc wins, and I guess since I installed Wine before I installed Mono, that's the one that wins. That my supposition, anyway. The symptom is that whenever I execute an .exe file from the command line, it runs Wine, even if it's a .NET executable.

I can't find a package that seems to supply this run-detectors utility. Is there something like it in the standard or community repositories, or is there some other common way to set this up in the Arch world?

How do I delete all mail coming from a specific domain in a specific user's inbox? [closed]

Posted: 29 Nov 2021 03:45 AM PST

I need help to find the right command to delete all mail in a specific user's inbox coming from specific domains (spam mail from @qq.com or @sohu.com"...)

Black Screen Boot & Freezing Boot

Posted: 29 Nov 2021 07:02 AM PST

So I'm working on a friend's computer to install Linux Mint 18.2 onto it since his Windows broke after the Creator Update. He wasn't able to install it himself for some reason, however when I first tried the Live USB on the system, it booted right into the Live USB and I was able to complete an install to his SSD. After the install, we attempted to reboot into the installed partition, however it goes to the GRUB menu, and once we select the installation for Linux Mint it just goes to a black screen with nothing on it, we've waited over 10 minutes with no changes to the screen. We then tried the Live USB again, multiple times and gives us the same thing as booting into the partition, a blinking underscore in the corner for a second and then just a black screen, then the screen goes to sleep. Systems specs are an FX-8350 and a Radeon R9 280X, no onboard video

What have we tried?

We've tried changing the boot parameters to have nomodeset xforcevesa instead of "quiet splash", this works about 10% of the time to get it to boot into Mint from the installed partition. The other 80% it goes to the command line output for booting into everything and reaches Switching to clocksource: tsc (or something similar) and then just freezes and doesn't go anywhere. The other 10% it just hangs in the middle of boot sequence. If we keep quiet splash and put in the nomodeset xforcevesa we receive an ERROR no UMS support in radeon module

We also tried just a nomodeset, this doesn't seem to have much affect, maybe 1 % or less of the time it loads into the OS.

We tried a live USB of Ubuntu 16.04 LTS, I have not been able to boot into it at all, even with the various parameter changes. We've tried using noacpi and nolacpi and acpi options in the Ubuntu Live USB to no avail, gives us I believe the ERROR No UMS Support in radeon module errors.

We've tried a live USB of Linux Mint 17.3 since we've discovered that AMD drivers for 18.2 aren't supported until AMD rewrites everything I guess? Didn't make sense to me, but that's what we read on the forums. Was unable to get 17.3 to boot at all, even with parameter changes.

How do you use proxy with the whois command?

Posted: 29 Nov 2021 05:25 AM PST

I tried exporting into http_proxy and https_proxy but that didn't seem to work.

I am guessing that there is another way to use a proxy when querying whois information from the command line?

Disable Ethernet Hardware Devices at start-up

Posted: 29 Nov 2021 05:03 AM PST

To startup vm called "sys-net" in Qubes on my laptop need to write "1" in file

echo -n "1" > /sys/bus/pci/devices/0000\:04\:00.0/remove  

also 0000:04:00.0 and 0000:04:00.1 are conflicts and need to be removed first after every startup laptop.

then network start and work fine. there is some input for information

$ lspci | grep -i eth  04:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev12)    $ find /sys -name *04:00.0  /sys/bus/pci/devices/0000:04:00.0  /sys/bus/pci/drivers/rtsx_pci/0000:04:00.0  /sys/devices/pci0000:00/0000:00:1d.3/0000:04:00.0    $ find /sys -name *04:00.1  /sys/bus/pci/devices/0000:04:00.1  /sys/bus/pci/drivers/pciback/0000:04:00.1  /sys/devices/pci0000:00/0000:001d.3/0000:04:00.1  

How can I convert it to systemd script to run it at start-up? It works only temporarily. After reboot the network device is there again.

VNC - Too many authentication failures

Posted: 29 Nov 2021 06:04 AM PST

I've been trying to Google, but all of the issues refers connection from PC to remote VNC server.

So. I have an issue with VNC communication from Android to Linux. I have installed a TightVNC Server on latest Ubuntu version which works fine if I connect to it from PC with RealVNC Viewer on port 5901.

I downloaded a VNC Viewer by RealVNC for Android and if I try to connect to my remote host it says "Too many authentication failures" even on first try.

I also tried a couple different VNC Viewers, but result is exactly same.

What would be the reason and how I am able to fix it? Some people were speaking about that the client can be unsecure, but I'm not sure what difference there would be with PC and Android version of VNC.

  • From PC to remote: Works

  • From Android to remote: Doesn't work

About half-year ago on my different server I had no similar issues. It was working fine, no matter what device I used to connect VNC if I knew IP, port and password.

linux/shell command to control screen brightness in android

Posted: 29 Nov 2021 04:03 AM PST

I am working on a kiosk project using an android tablet.If there is no input power to the kiosk for a long time then, the tablet will eventually shutdown.In order to auto-reboot the tab when the power comes back I modified the code in my tabs battery animation file(ipod) using:

#!/system/bin/sh  sleep 300  /system/bin/reboot  

However,during the sleep period(shown above),the tabs screen remains in the ON state (and hence takes longer retries for the tab to charge and bootup).I need to turn the screen OFF. What is the command I should use prior to the sleep command to turn my tabs screen OFF during the charging/bootup stage. Thanks !

Install pdflatex via SSH on Amazon EC2 instance

Posted: 29 Nov 2021 06:44 AM PST

I need to install pdflatex on my Linux powered machine (Amazon EC2 instance, didn't decided yet which distribution would be the best so also feel free to give a hint) because I want to connect pdflatex & PHP to produce rendering of LaTeX code to PDF on my website (so user could type in LaTeX, click render and download a PDF, like http://www.scribtex.com). Can you give me some directions?

How can you change ident, which shows up as ident@hostname.com on ircll?

Posted: 29 Nov 2021 05:28 AM PST

I know the nickname and the real name field can be changed with environment variables such as IRCNICK and IRCNAME. However, the documentation does not tell you how the ident is changed. (The ident is the name that's used when you /whois nickname, and it shows up as part of ident@username.com in the host field, and the bolded part is what I'm trying to figure out how to change)

I'm wondering if this is possible on the ircll client.

No comments:

Post a Comment