Why Fedora cannot boot on 8GB of RAM from liveUSB (with rd.live.ram option)? Posted: 09 Jan 2022 11:54 PM PST Recently when I tried to boot Fedora on another laptop (it booted fine before) it halted. Took me some time and several tries to realize it lacks enough ram. It booted on same laptop with 16GB of ram, but failed when I left only one 8GB module. Below are some outputs of df and free , as far as I see on them 8GB should be enough as for 16GB 12GB is available when booted. Linux Mint which I use much more than Fedora boots fine on 8GB for ram, size of ISO file is about same. Fedora on 16GB: [liveuser@localhost-live ~]$ df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 7.7G 0 7.7G 0% /dev tmpfs 7.7G 0 7.7G 0% /dev/shm tmpfs 3.1G 2.0G 1.2G 63% /run /dev/mapper/live-rw 7.8G 5.5G 2.3G 71% / tmpfs 7.7G 36K 7.7G 1% /tmp vartmp 7.7G 0 7.7G 0% /var/tmp tmpfs 1.6G 104K 1.6G 1% /run/user/1000 /dev/sdc1 15G 5.4G 8.6G 39% /run/media/liveuser/usb [liveuser@localhost-live ~]$ free -hw total used free shared buffers cache available Mem: 15Gi 832Mi 11Gi 2.2Gi 35Mi 3.2Gi 12Gi LM on 16GB: mint@mint:~$ df -h Filesystem Size Used Avail Use% Mounted on udev 7.7G 0 7.7G 0% /dev tmpfs 1.6G 1.6M 1.6G 1% /run /dev/shm 2.2G 2.1G 103M 96% /cdrom /dev/loop0 1.9G 1.9G 0 100% /rofs /cow 7.7G 28M 7.7G 1% / tmpfs 7.7G 0 7.7G 0% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 7.7G 0 7.7G 0% /sys/fs/cgroup tmpfs 7.7G 4.0K 7.7G 1% /tmp tmpfs 1.6G 32K 1.6G 1% /run/user/999 LM on 8GB: mint@mint:~$ df -h Filesystem Size Used Avail Use% Mounted on udev 3.7G 0 3.7G 0% /dev tmpfs 767M 1.6M 765M 1% /run /dev/shm 2.2G 2.1G 103M 96% /cdrom /dev/loop0 1.9G 1.9G 0 100% /rofs /cow 3.8G 28M 3.8G 1% / tmpfs 3.8G 0 3.8G 0% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup tmpfs 3.8G 4.0K 3.8G 1% /tmp tmpfs 767M 40K 767M 1% /run/user/999 mint@mint:~$ free -hw total used free shared buffers cache available Mem: 7.5Gi 754Mi 3.8Gi 2.3Gi 162Mi 2.8Gi 4.2Gi Swap: 8.0Gi 0B 8.0Gi |
Why does my GitHub Action fails and does not respect the OR operator? Posted: 09 Jan 2022 11:49 PM PST I have a GitHub Action that does some tasks, and then pushes back the results. Here's my step: - name: Push production script run: | cd /Project/Migration git config --global user.name 'Migration Builder' git config --global user.email 'my_user_name@users.noreply.github.com' git add . git commit -m "production script" git push || echo "Nothing to push" Sometimes there is nothing to push. Thus the git push causes the action to break with this message: On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean Error: Process completed with exit code 1. I have set the || operator there to simply echo something to not return the error code. But why it's not respected? How can I prevent git push to not break the action? |
Is it possible to use some sort of tool for making it easier to have touchscreen feature for OneNote in a laptop? Posted: 09 Jan 2022 11:24 PM PST I want to use touch feature for writing handwritten notes on OneNote in a laptop (which is not touchscreen), can it be made possible ? |
Why find command giving "Permission denied" error for path that has been already excluded? Posted: 09 Jan 2022 11:30 PM PST If I run (with sudo) sudo find / -xdev -type f ! -path '/home/blueray/*' ! -path '/timeshift/*' > log.txt It works properly without any issues. However, if I run the same command without sudo , I get some error in console. The search result in log.txt is proper (no issue with that). But I am not understanding the error messages. % find / -xdev -type f ! -path '/home/blueray/*' ! -path '/timeshift/*' > log.txt find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/etc/polkit-1/localauthority': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/etc/ssl/private': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/etc/cups/ssl': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/log/private': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/log/speech-dispatcher': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/spool/rsyslog': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/spool/cups': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/spool/cron/crontabs': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/lib/apt/lists/partial': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/lib/colord/.cache': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/lib/AccountsService/users': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/lib/bluetooth/5C:F3:70:93:BD:85': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/lib/lightdm-data/lightdm': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/lib/polkit-1': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/lib/udisks2': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/lib/NetworkManager': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/lib/private': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/lib/lightdm': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/lib/tor': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/cache/private': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/cache/apparmor/26b63962.0': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/cache/lightdm/dmrc': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/cache/cups': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/cache/ldconfig': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/tmp/systemd-private-84c1e6e852b747ea9d34d17ca664b32b-tor@default.service-frAbZe': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/tmp/systemd-private-84c1e6e852b747ea9d34d17ca664b32b-systemd-logind.service-EWXwaj': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/tmp/systemd-private-84c1e6e852b747ea9d34d17ca664b32b-ModemManager.service-0wY2Hh': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/tmp/systemd-private-84c1e6e852b747ea9d34d17ca664b32b-colord.service-HLWVQf': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/tmp/systemd-private-84c1e6e852b747ea9d34d17ca664b32b-upower.service-ecD4ii': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/tmp/systemd-private-84c1e6e852b747ea9d34d17ca664b32b-systemd-resolved.service-Qxjpij': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/var/tmp/systemd-private-84c1e6e852b747ea9d34d17ca664b32b-systemd-timesyncd.service-Kf61Zi': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/root': Permission denied find: '/timeshift/snapshots/2022-01-09_22-00-46/localhost/boot/efi': Permission denied find: '/etc/libvirt/secrets': Permission denied find: '/etc/polkit-1/localauthority': Permission denied find: '/etc/ssl/private': Permission denied find: '/etc/cups/ssl': Permission denied find: '/var/log/private': Permission denied find: '/var/log/speech-dispatcher': Permission denied find: '/var/spool/rsyslog': Permission denied find: '/var/spool/cups': Permission denied find: '/var/spool/cron/crontabs': Permission denied find: '/var/lib/apt/lists/partial': Permission denied find: '/var/lib/colord/.cache': Permission denied find: '/var/lib/AccountsService/users': Permission denied find: '/var/lib/portables': Permission denied find: '/var/lib/libvirt/qemu': Permission denied find: '/var/lib/machines': Permission denied find: '/var/lib/bluetooth/5C:F3:70:93:BD:85': Permission denied find: '/var/lib/lightdm-data/lightdm': Permission denied find: '/var/lib/polkit-1': Permission denied find: '/var/lib/udisks2': Permission denied find: '/var/lib/NetworkManager': Permission denied find: '/var/lib/private': Permission denied find: '/var/lib/lightdm': Permission denied find: '/var/lib/tor': Permission denied find: '/var/lib/fwupd/gnupg': Permission denied find: '/var/cache/apt/archives/partial': Permission denied find: '/var/cache/private': Permission denied find: '/var/cache/apparmor/26b63962.0': Permission denied find: '/var/cache/lightdm/dmrc': Permission denied find: '/var/cache/cups': Permission denied find: '/var/cache/ldconfig': Permission denied find: '/var/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-ModemManager.service-G72K7i': Permission denied find: '/var/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-colord.service-2B8Ofg': Permission denied find: '/var/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-tor@default.service-TaP1xi': Permission denied find: '/var/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-systemd-logind.service-rnYjPi': Permission denied find: '/var/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-systemd-timesyncd.service-U7G6Lf': Permission denied find: '/var/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-systemd-resolved.service-ABf5Xe': Permission denied find: '/var/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-upower.service-WW9yYi': Permission denied find: '/root': Permission denied find: '/lost+found': Permission denied find: '/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-upower.service-F7Rtjf': Permission denied find: '/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-tor@default.service-nYCXFi': Permission denied find: '/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-colord.service-qGi0sf': Permission denied find: '/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-systemd-logind.service-FhyyUh': Permission denied find: '/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-systemd-resolved.service-luOB7f': Permission denied find: '/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-ModemManager.service-d1MZ7g': Permission denied find: '/tmp/systemd-private-c9d7a83d6f844d998e8423d94d48ce3f-systemd-timesyncd.service-79KkRe': Permission denied Why is it saying find: '/timeshift/snapshots/....': Permission denied even though I have used ! -path '/timeshift/*' in my find command. As per my common sense, the find command need not to bother about the permission of a directory which has been excluded from search. So, what is really going on and how to get rid of these error messages without using sudo. I mean, is there any positional parameter in find command which says "first exclude then search" or something like that. |
apt source clang-format and it doesn't download source Posted: 09 Jan 2022 11:07 PM PST Scenario: I have an old ubuntu xenial and I want to create last clang-format(13) package on xenial . But I have some incompatiable version of debhelper of jammy and xenial . Do you have any solutoion? |
How can I list all files which have been installed by the APT command Posted: 09 Jan 2022 10:55 PM PST I tried How can I list all files which have been installed by an APT package?. But the problem is, for example: when I run sudo apt install libvirt-daemon-system it does not only install one package (in this case libvirt-daemon-system ). It also installs the packages mentioned under The following NEW packages will be installed: $ sudo apt install libvirt-daemon-system Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: cpu-checker ibverbs-providers ipxe-qemu ipxe-qemu-256k-compat-efi-roms libcacard0 libfdt1 libibverbs1 libiscsi7 libpmem1 librados2 librbd1 librdmacm1 libslirp0 libspice-server1 libusbredirparser1 libvirglrenderer1 libvirt-clients libvirt-daemon libvirt-daemon-driver-qemu libvirt-daemon-driver-storage-rbd libvirt-daemon-system-systemd libvirt0 msr-tools ovmf qemu-block-extra qemu-kvm qemu-system-common qemu-system-data qemu-system-gui qemu-system-x86 qemu-utils seabios Suggested packages: libvirt-daemon-driver-lxc libvirt-daemon-driver-vbox libvirt-daemon-driver-xen libvirt-daemon-driver-storage-gluster libvirt-daemon-driver-storage-zfs numad auditd nfs-common open-iscsi radvd systemtap zfsutils samba vde2 debootstrap The following NEW packages will be installed: cpu-checker ibverbs-providers ipxe-qemu ipxe-qemu-256k-compat-efi-roms libcacard0 libfdt1 libibverbs1 libiscsi7 libpmem1 librados2 librbd1 librdmacm1 libslirp0 libspice-server1 libusbredirparser1 libvirglrenderer1 libvirt-clients libvirt-daemon libvirt-daemon-driver-qemu libvirt-daemon-driver-storage-rbd libvirt-daemon-system libvirt-daemon-system-systemd libvirt0 msr-tools ovmf qemu-block-extra qemu-kvm qemu-system-common qemu-system-data qemu-system-gui qemu-system-x86 qemu-utils seabios 0 upgraded, 33 newly installed, 0 to remove and 1 not upgraded. Need to get 22.4 MB of archives. After this operation, 93.9 MB of additional disk space will be used. Do you want to continue? [Y/n] So, I am not getting the full picture by running dpkg -L libvirt-daemon-system One option to get list of all the files that has been created after the apt install command can be to run dpkg -L libvirt-daemon-system dpkg -L cpu-checker dpkg -L ibverbs-providers dpkg -L ipxe-qemu .... But I assume it will be a lengthy process. Another option can be to run the following after installing the packages: sudo find / -xdev -mtime -5 -type f ! -path '/home/blueray/*' ! -path '/timeshift/*' Is there any better solution to get list of all the files that has been created after an apt install command. |
Using tesseract for character recongniton, result is not as expected (much worse). How to get better? Posted: 09 Jan 2022 11:13 PM PST I wanted to add output of Linux boot to my question and decided to try to use optical character recognition thinking now in 2022 surely there should be decent open source options (have not tried OCR for a long time). Links found via Web search "praise" tesseract . https://www.linuxlinks.com/ocrtools/ second best on chart. https://askubuntu.com/questions/16268/whats-the-best-simplest-ocr-solution Tesseract is probably the most accurate open source OCR engine available. I've installed it from distro via apt-get and run. Result with out-of-the-box is IMO awful. Why? Maybe it can be ealily fixed? Or advice another package that does the job. The page I've tried to recognize lacks pictures, as I see it it is rather easy task. See below the result: Edit: in fact result when that small part is processed were much better, but when whole is processed than results are not ok. I understand making lines more horizontal and not skewed might help a lot, still I was hoping software got good at recognizing non-perfectly aligned text. oon usb 1-@: | "3792661 usb 1-8: New USB device found, idVendor=1343, idProduct: 7.983163] usb 1-8: New USB dev bs P luct=5662, bedDevice=16.6? re eh peeled haibbetaia a : new high-speed USB device number 5 PhS | i Per Samm SCR Can) t pela ee rcpt PP cay : 2.998668) usb 1-8: er t Ct When only small part is processed: 2.837811) usb 1-8: new high-speed USB device number 5 using xhei_hed 2.979266] usb 1-8: New USB device ECU CREME Cnt ttc cain Tt teen Td 7.983163] usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumbers@ ?.9869291 usb 1-8: Product: Integrated Camera Added 1: Tried again smaller and less skewed picture, I guess software considers time stamps as separate column, I have not seen on man page options to tweak that: f a eg | 7.849264] Device= 6.44 f 7 .6492961 | 7.849355] f 7.849415] [ 7.849492] | Van eos fl 7.861846] if Va ACB | 7.864776] if eel Be Ha Bs) bs 4 if be A be ge C ie BD LB ce B) te] Bs] rage lb eae 8.962076) ie Ke Lb 9.600567) 9.696957) 9 .6970371 YS SF SS Se usb 1-8: new high-speed USB device number 4 using xhci_hcd usb 1-8: New USB device found, idVendor=04f2, idProduct=b449, bed usb 1-8: New USB device strings: Mfr=3, Product=1, SerialNumber=2 usb 1-8: Product: Integrated Camera usb 1-8: Manufacturer: Chicony Electronics Co.,Ltd. usb 1-8: SerialNumber: 6x0001 usb-storage 1-1:1.6: USB Mass Storage device detected scsi host3: usb-storage 1-1:1.6 usbcore: registered new interface driver usb-storage usbcore: registered new interface driver uas scsi 3:0:6:@: Direct-fAccess General UDisk eg sd 3:0:0:0: Attached scsi generic sgi type @ eM Pee PM eA PA ed) te) ae Py Me ee dd Py ee ee eee dm sd 3:0:0:0: [sdb] Assuming drive cache: write through sdb: sdbi sdb2 sdb3 sd 3:0:0:0: [sdb] Attached SCSI removable disk squashfs: version 4.6 (2609/01/31) Phillip Lougher Copying live image to RAM... Ca ewe te Mae |
How to grep 'Advertised link modes" from ethtool command? Posted: 09 Jan 2022 10:58 PM PST How to get only these values 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full from this command? Settings for eth0: Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full I've tried something like this sudo ethtool eth0 | grep 'Advertised link modes:' | cut -d " " -f5-6 but it's not working well |
How to install Black Arch Linux alongside Windows10 Posted: 09 Jan 2022 10:26 PM PST I have Windows 10 already installed on my laptop, and I have some unallocated space that I'm intending to install black arch Linux on. I'm using EFI. I connected the installation bootable disk, then opened the Black arch terminal, and set up My network among the other installation steps, then I selected to Install alongside windows/other Os. I selected yes. I was prompted to create the boot/root/swap partitions and I selected yes. I'm using cfdisk to create the partitions. Now here, I wanted to create them on the unallocated space that I had left for this reason, and not on the entire disk, because that, I thought, would mess up the existing OS and data. The problem is that I'm being provided with the whole disk space to create partitions from it, and when I do, and then write them on the partition table, the entire Windows installation gets lost, with the data on it. Please, I'd like to create the boot/root/swap partitions on the free space, without messing the windows installation. The end result to be, having both windows 10 and Black Arch Linux on my laptop. Also, when I save the partitions anyway, I get an error: Could not create filesystem, and at that point, my Windows partitions and their content are wiped, and I no longer have a bootable disk. Help on how I can achieve this will me very much appreciated. |
How to increase size of software RAID0 Arrays? Posted: 09 Jan 2022 10:13 PM PST My Raid0 array consists of two partition components . [root@rhel-85 ~]# mdadm --detail /dev/md0 /dev/md0: Version : 1.2 Creation Time : Sun Jan 9 17:25:26 2022 Raid Level : raid0 Array Size : 3141632 (3.00 GiB 3.22 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Update Time : Sun Jan 9 17:25:26 2022 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Layout : original Chunk Size : 512K Consistency Policy : none Name : rhel-85:0 (local to host rhel-85) UUID : bf76445f:08e4dab7:3861a780:76912221 Events : 0 Number Major Minor RaidDevice State 0 259 8 0 active sync /dev/nvme0n2p1 1 259 5 1 active sync /dev/nvme0n1p5 [root@rhel-85 ~]# I have taken backup of all data from the raid0 array. Now, I want to add /dev/nvme0n2p5 partition component to the Raid0 array After taking the backup, I am running the following commands: [root@rhel-85 ~]# umount /dev/md0 umount: /dev/md0: not mounted. [root@rhel-85 ~]# cat /proc/mdstat Personalities : [raid0] [raid1] md0 : active raid0 nvme0n2p1[0] nvme0n1p5[1] 3141632 blocks super 1.2 512k chunks [root@rhel-85 ~]# mdadm /dev/md0 --fail /dev/nvme0n2p1 --remove /dev/nvme0n2p1 mdadm: set device faulty failed for /dev/nvme0n2p1: Device or resource busy Please let me know what commands to add partition /dev/nvme0n2p5 to the Raid0 array? |
Installation of core emulator : 'tcl8.5' not installing Posted: 09 Jan 2022 09:51 PM PST I'm trying to install core emulator on Ubuntu 20.04 and I came across an installation procedure and it had the following command $ sudo apt-get install bash bridge-utils ebtables \ iproute libev-dev python tcl8.5 tk8.5 libtk-img \ autoconf automake gcc libev-dev make python-dev \ libreadline-dev pkg-config imagemagick help2man and executing command I'm getting the following error Package tk8.5 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source Package tcl8.5 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'tcl8.5' has no installation candidate E: Package 'tk8.5' has no installation candidate I tried to install tcl8.5 separately with sudo apt-get install tcl8.5 and I got the same error What is wrong? Is tcl8.5 obsolete? |
How to disable TRIM on SSD(s) under Linux Mint? Posted: 09 Jan 2022 09:21 PM PST I rarely ever write anything (large) to SSDs on many machines of my own, an example could be the use of one laptop as a TV viewer only, another my mother's laptop, which she uses just for banking. (If it matters, I use Linux Mint on all machines.) Therefore it comes as annoying the weekly TRIM, as it takes a rather long time. But how to disable it? |
How to change /proc/*/environ of a bash shell Posted: 09 Jan 2022 09:41 PM PST This is the shell's PID: nathan@guixlaptop ~ $ $$ bash: 10984: command not found I export an environment variable: nathan@guixlaptop ~ $ export TESTVAR=test The variable is not found in the shell's environment: nathan@guixlaptop ~ $ cat /proc/10984/environ | grep TESTVAR || echo "fail" fail How do I make the variable appear in environ? |
awk NR%2{}1 meaning Posted: 09 Jan 2022 09:32 PM PST error.txt content: KEY 4048:1736 string 3 KEY 0:1772 string 1 KEY 4192:1349 string 1 KEY 7329:2407 string 2 KEY 0:1774 string 1 https://www.tecmint.com/use-next-command-with-awk-in-linux/ https://stackoverflow.com/a/32482224/15603477 https://stackoverflow.com/a/9605559/15603477 trying to understand awk 'NR%2{printf "%s ",$0;next;}1' yourFile Now I try to customize it. awk 'NR%2{printf NR "%s ", $0; next}1' error.txt It will return 1KEY 4048:1736 string 3 3KEY 0:1772 string 1 5KEY 4192:1349 string 1 7KEY 7329:2407 string 2 9KEY 0:1774 string 1 I guess, NR%2 refer to even line number. but I am not sure the 1 refer to. without 1 awk 'NR%2{printf NR "%s ", $0; next}' error.txt it will return one line. 1KEY 4048:1736 string 3KEY 0:1772 string 5KEY 4192:1349 string 7KEY 7329:2407 string 9KEY 0:1774 string So overall I still not getting it. |
Play video full screen in a split window on KDE Posted: 09 Jan 2022 08:04 PM PST Is there any way to play video full screen on a split window on KDE? My current split windows look like this. What I want to do is I want to play the video on full screen in a split window like this. Is there any way to achieve this? My distro is MX-Linux 21. |
Prevent qemu from hijacking input Posted: 09 Jan 2022 08:55 PM PST I am trying to run gnu screen in a virtual machine. To create a new screen window, I press ctrl+a c, but this key combination makes the qemu monitor appear instead. How do I send these keystrokes to the guest? |
Would you consider this a security concern? Trying to script cifs Posted: 09 Jan 2022 09:57 PM PST I'm trying to script mounting a cifs share. Below is my script, which i run on a proxmox v7 debian 11 VM, cli only, no gui. I connect via putty and this script is sitting in /srv/share . I also have fstab set up to mount this automatically, but i umount it when testing this script. // Beginning of script #! /bin/bash share="/storage" // Test for share connectivity and connect if needed if [ ! -d $share/_Scripts ]; then // following command is all one line `mount -t cifs //x.x.x.x/storage /storage -o uid=root,gid=smb_admins,credentials=/home/xxxxx/.cifs,file_mode=0770,dir_mode=0770` else echo "Share is already connected" fi // End of Script If I run this as just my user, it gives no prompt, no errors, nothing. If I then type exit at the command prompt, it outputs "exit" and then "Share is already connected" and drops me back to my user's command prompt. However, if I run the script as sudo , it asks for my user password, as normal, shows no output, and drops me directly into a root prompt without asking for root's password, which concerns me somewhat. If I then type exit at the root prompt, it does the same thing as under my regular user and drops me back to my regular user's prompt. I'm sure its something I've screwed up, but that seems like very dangerous behavior to me. Your thoughts? |
Trouble finding on-board serial port via UART: "-bash: echo: write error: Input/output error" Posted: 09 Jan 2022 08:48 PM PST I have an old tv box that I wiped recently with Linux. I would like to connect a device to its onboard UART pins, to which I've soldered wires that connect to a UART adapter on my PC. I opened up a PuTTY serial monitor that reads incoming data while simultaneously trying to send data from the tv box. But whenever I try to interact with any of the ttyS* ports, I just get -bash: echo: write error: Input/output error . I've tried using echo , screen and minicom , but all of them seem to spit out the same error. While messing around with setserial , I get these kinds of error messages: root@arm-64:~# setserial /dev/ttyS1 uart 16550 Cannot set serial info: Invalid argument I'm totally unsure what to do, it seems almost as if it's none of these four ports, but I don't see another option for UART. I'm looking to at least verify the port name that my device is connected to so I can use it down the line. |
How to set static ip in CentOS Stream 9? Posted: 09 Jan 2022 09:59 PM PST I installed a new version CentOS on my hypervisor and I saw that /etc/sysconfig/network-scripts/* doesn't exist. In 8 version I set for example bootproto=static and ipaddr=192.168.88.101. How correct set static IP in 9 version? |
Centos 7 file system corrupted Posted: 09 Jan 2022 09:55 PM PST I'm trying to restore my CentOS 7 virtual Machine as the file system got corrupted. This is the procedure I adopted for the same: - Unmount the file system using
umount /dev/mapper/centos00-root - Tried
xfs_repair -n /dev/mapper/centos00-root - Tried
xfs_repair /dev/mapper/centos00-root . Inspite of running the above 3 commands I was not able to restore my CentOS VM. I would request to please help me in restoring my VM. |
Downloading Logs & DBs as Non-Root User Posted: 09 Jan 2022 11:04 PM PST I am the forever noob to linux webhosting.. and rather than deal with terminal width/height/length issues while hunting errors, I set-up a bunch of bash alias commands on my ubuntu 20.04 local machine to simply execute a scp commandm to download whatever log and open it locally in my gedit gui. PROBLEM: Now that I have learned about the best practice of using a non-root user and disabling root ssh ability, I have a bunch of bash alias commands that will not work because I now ssh to the server as a non-root user that has to use sudo su to become root and do anything (a worthy trade off for security peace of mind). Question: Does anyone know how to change the following commands so that a non-root use can execute them: alias pae="scp root@prodserver:/var/log/apache2/error.log ~/Downloads/logs/prod/error-access-logs/prod-apache-error.log && gedit ~/Downloads/logs/prod/error-access-logs/prod-apache-error.log" alias dbdl="rsnyc -aHAXSv root@prodserver:/dbbackdir ~/Downloads/dbbackups" For each of the above commands... I need to replace root@prodserver with adminuser@prodserver , pass the sudo su command and somehow automatically pass the adminuser's password to become root in order for my bash aliases to keep their prior end-user convenience. I am punching way above my weight-class on this one. Any tips? UPDATE: I found a useful tutorial that shows how add non-root access to files. Unfortunately, following the instructions exactly as written didn't work: grant non-root user apache2 log access https://gist.github.com/angela-d/8a2416034ea7ed89ecde37147e8711ba Note: the tutorial doesn't say if it is applicable to Debian 10.5 or not, which could explain why things aren't working. As instructed I ran setfacl -m g:adminuser:rx /var/log/apache2/* However, when I run getfacl /var/log/apache2/ the output does not show adminuser as having r-x access to /var/log/apache2/* only root user continues to have access.. I also tried changing from group to user (using 'u' instead of 'g') for setfacl -m g:adminuser:rx /var/log/apache2/* but still no luck. hhmmm.. |
Running a program as a user without user permission? Posted: 09 Jan 2022 10:13 PM PST There is a program that I am afraid to run under root (it may contain vulnerabilities), and I do not want to set the user execution permission, so that the functionality could not be used, for example, some other program. The first thing that comes to mind is to run under root (program root:user): #!/bin/sh chmod 750 program && su - user -c program; chmod 700 program The second thought is to create a user just for this program, but I haven't yet encountered setting permissions so that the new user has permission for only one program, and access to everything else is denied. Also, if the program will be with GUI there may be problems with X11 access. I want to run the program as an unprivileged (regular) user, but I do NOT want this program to be able to be run by any other process or anyone else (root, of course, does not count). For example, there is a program that makes a screenshot, how to make so that only I can use it, but not a virus that got from the browser? This makes no sense.. If that browser virus would be able to execute processes, it would have all that it needs to either just download a program of the same functionality, or implement the functionality itself; The first thing that comes to mind is what if we are talking about programs with a suid bit installed, to install which I need root access. This means that a virus which got in through the browser, but could not get root access, would be able to use this program. If the program would not have been allowed to be executed from user account, the virus would not have started it and without root access it would not have been able to install it, i.e. to use it. Or a program simulating keystrokes, so that only I can run it (via wrapper or password or sudo as root or something else), but not a virus or another program/process. |
External monitor stuck on "Unknown display" 1024x768 - Fedora 34 Posted: 10 Jan 2022 12:01 AM PST Using a fresh install of Fedora 34 Workstation edition(GNOME) on a dell latitude 7400 laptop, I'm struggling to make my external display to work, an Asus ROG PG278Q 27". Connecting through the USB-C port, the display shows up in the system settings as an "unknown display" and the resolution is capped at 1024x768. Things I already did: - updated all packages with
dnf update - tried setting the resolution with xrandr, following this resolution
xrandr --newmode "2560x1440-144ghz" 808.75 2560 2792 3072 3584 1440 1443 1448 1568 -hsync +vsync xrandr --addmode XWAYLAND1 "2560x1440-144ghz" xrandr --output XWAYLAND1 --mode "2560x1440-144ghz" - gives me "X Error of failed request: BadValue (integer parameter out of range for operation) " system info: Graphics: Mesa Intel® UHD Graphics 620 (WHL GT2) Windowing system: Wayland GNOME Version: 40.4 lspci | grep VGA output: 00:02.0 VGA compatible controller: Intel Corporation WhiskeyLake-U GT2 [UHD Graphics 620] (rev 02) This is my first time in many years switching to a linux desktop, this display used to work on my previous windows 10 instalation and it also worked in my (brief) rocky linux 8 installation. |
mail: How do I mark an email as unread? Posted: 09 Jan 2022 11:11 PM PST I am using mail from GNU Mailutils to read the contents of a Maildir. For emails that have already been marked as read, is there a way to mark them as unread in mail ? |
How to start a service in a WSL-based Fedora? Posted: 09 Jan 2022 10:08 PM PST I have a Fedora 33 under Windows Subsystem for Linux 2. I want to run sshd. For that I tried $ sudo systemctl start sshd but I got the error message System has not been booted with systemd as init system (PID 1). Can't operate Searching for this error message I have found https://linuxhandbook.com/system-has-not-been-booted-with-systemd/ which suggested to use the service command in this case. I tried but it said Redirecting to /bin/systemctl start sshd.service so I got the same error. What can I do on my WSL2 based Fedora 33? UPDATE: I have installed Fedora onto WSL using a cloud image and the wsl command, described here: https://fedoramagazine.org/wsl-fedora-33/ |
terminal in Tmux is 256color but vim isn't Posted: 09 Jan 2022 09:06 PM PST Recently I installed tmux on my Ubuntu 16.04. The terminal screen in tmux shows 256 color correctly however when I opened vim within tmux , the color was different from what it showed when it was run directly on the terminal. I tried to add set -g default-terminal "screen-256color" in my .tmux.conf file but the problem still exists. - my terminal screen in
tmux : vim run directly on the terminal: vim run within tmux : The output of echo $TERM; tput colors; tput longname |
YUMI Ubuntu 16.04 64 Bit USB to SSD Posted: 10 Jan 2022 12:01 AM PST long time Windows user here. Last week I got fed up with Windows 10 and so I used YUMI to create a bootable Ubuntu 16.04 64 Bit USB stick. So far, I love what I see! I installed some software and tried a few things... Now my question is, can I buy myself a new SSD and install/transfer my YUMI USB Ubuntu on it... So that I do not need to install all the software again and setup all the things I have done so far on the USB Ubuntu... Any advise / help would be welcome! Thank you! |
How to extract logs between the current time and the last 15 minutes Posted: 09 Jan 2022 09:15 PM PST I want to extract the logs between the current time stamp and 15 minutes before and sent an email to the people configured. I developed the below script but it's not working properly; can someone help me?? I have a log file containing this pattern: [2016-05-24T00:58:04.508-04:00] [oim_server1] [TRACE:32] [] [oracle.iam.scheduler.impl.quartz] [tid: OIMQuartzScheduler_QuartzSchedulerThread] [userId: oiminternal] [ecid: 0000LI6NBsP4yk4LzUS4yW1NBABd000003,1:21904] [APP: oim#11.1.2.0.0] [SRC_CLASS: oracle.iam.scheduler.impl.quartz.QuartzJob] [SRC_METHOD: <init>] Constructor QuartzJob [2016-05-24T00:58:04.508-04:00] [oim_server1] [TRACE:32] [] [oracle.iam.scheduler.impl.quartz] [tid: OIMQuartzScheduler_QuartzSchedulerThread] [userId: oiminternal] [ecid: 0000LI6NBsP4yk4LzUS4yW1NBABd000003,1:21904] [APP: oim#11.1.2.0.0] [SRC_CLASS: oracle.iam.scheduler.impl.quartz.QuartzJob] [SRC_METHOD: <init>] Constructor QuartzJob [2016-05-24T00:58:04.513-04:00] [oim_server1] [TRACE:32] [] [oracle.iam.scheduler.impl.quartz] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000LI6NBsP4yk4LzUS4yW1NBABd000003,1:21908] [APP: oim#11.1.2.0.0] [SRC_CLASS: oracle.iam.scheduler.impl.quartz.QuartzTriggerListener] [SRC_METHOD: triggerFired] Trigger state 0 [2016-05-24T00:58:04.515-04:00] [oim_server1] [TRACE:32] [] [oracle.iam.scheduler.impl.quartz] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000LI6NBsP4yk4LzUS4yW1NBABd000003,1:21908] [APP: oim#11.1.2.0.0] [SRC_CLASS: oracle.iam.scheduler.impl.quartz.QuartzTriggerListener] [SRC_METHOD: triggerFired] Trigger state 0 [2016-05-24T00:58:04.516-04:00] [oim_server1] [TRACE:32] [] [oracle.iam.scheduler.impl.quartz] [tid: OIMQuartzScheduler_Worker-1] [userId: oiminternal] [ecid: 0000LI6NBsP4yk4LzUS4yW1NBABd000003,1:21908] [APP: oim#11.1.2.0.0] [SRC_CLASS: oracle.iam.scheduler.impl.quartz.QuartzTriggerListener] [SRC_METHOD: triggerFired] Trigger Listener QuartzTriggerListener.triggerFired(Trigger trigger, JobExecutionContext ctx) [2016-05-24T01:00:04.513-04:00] [oim_server1] [WARNING] [] [oracle.iam.scheduler.vo] [tid: OIMQuartzScheduler_Worker-7] [userId: oiminternal] [ecid: 0000LI6NBsP4yk4LzUS4yW1NBABd000003,1:21956] [APP: oim#11.1.2.0.0] IAM-1020021 Unable to execute job : CmyAccess Flat File WD Candidate with Job History Id:1336814[[ org.identityconnectors.framework.common.exceptions.ConfigurationException: Directory does not contain normal files to read HR-76 at org.identityconnectors.flatfile.utils.FlatFileUtil.assertValidFilesinDir(FlatFileUtil.java:230) at org.identityconnectors.flatfile.utils.FlatFileUtil.getDir(FlatFileUtil.java:176) at org.identityconnectors.flatfile.utils.FlatFileUtil.getFlatFileDir(FlatFileUtil.java:182) at org.identityconnectors.flatfile.FlatFileConnector.executeQuery(FlatFileConnector.java:134) at org.identityconnectors.flatfile.FlatFileConnector.executeQuery(FlatFileConnector.java:58) at org.identityconnectors.framework.impl.api.local.operations.SearchImpl.rawSearch(SearchImpl.java:105) at org.identityconnectors.framework.impl.api.local.operations.SearchImpl.search(SearchImpl.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.identityconnectors.framework.impl.api.local.operations.ConnectorAPIOperationRunnerProxy.invoke(ConnectorAPIOperationRunnerProxy.java:93) at com.sun.proxy.$Proxy735.search(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.identityconnectors.framework.impl.api.local.operations.ThreadClassLoaderManagerProxy.invoke(ThreadClassLoaderManagerProxy.java:107) at com.sun.proxy.$Proxy735.search(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.identityconnectors.framework.impl.api.BufferedResultsProxy$BufferedResultsHandler.run(BufferedResultsProxy.java:162) The script I have written counts the errors found and stores them in a file with the number; if the error count increases it will run the script and send a mail. I can configure cron for this but the script I have written is not working fine. Can someone help me to extract logs between the current time and the last 15 minutes and generate a temp file? LogDir=/data/app/Oracle/Middleware/user_projects/domains/oim_domain/servers/oim_server1/logs EMAIL1=xxx@gmail.com SUBJECT=Failed MESSAGE="Scheduler failed" SMTP="SMTPHOSTNAME" SENDER=no-reply@gmail.com NOW=$(date +"%FT%T.000%-04:00") T2=$(date --date='15 minutes ago' +"%FT%T.000%-04:00") OUT=/tmp/oim_server1-diagnostic_$(date +%F-%H-%M).log find $LogDir -mmin -15 -name "oim_server1-diagnostic.log" > files.txt count=0; if [ -f lastCount ]; then count=$(cat lastCount) fi while read file do echo "reading file \n " $file currentCount=$(grep -c 'Directory does not contain normal files to read HR-76' $file) if [ $currentCount -ne $count -a $currentCount -ne 0 ];then echo "Error Found " $currentCount awk -v TSTART="[$T2]" -v TEND="[$NOW]" '$1>=TSTART && $1<=TEND' $LogDir/oim_server1-diagnostic.log > "$OUT" test -s $OUT && echo -e "$MESSAGE" | mailx -S smtp="$SMTP" -a "$OUT" -r "$SENDER" -s "$SUBJECT" "$EMAIL1" rm -f "$OUT" fi echo $currentCount > lastCount done < files.txt This script is extracting the logs but not in the appropriate format. The largest log which i am finding with (grep -c 'Directory does not contain normal files to read HR-76' $file) I want to extract all logs between two timestamps. Some lines may not have the timestamp, but I want those lines also. In short, I want every line that falls under two time stamps. This script is giving me log file only have timestamp and rest all the lines are missing any suggestion ??? Please note the start time stamp or end time stamp may not be there in all lines of the log, but I want every line between these two time stamps. Sample generation of above log mentioned::: [2016-05-24T01:00:04.513-04:00] [oim_server1] [WARNING] [] [oracle.iam.scheduler.vo] [tid: OIMQuartzScheduler_Worker-6] [userId: oiminternal] [ecid: 0000LIt5i3n4yk4LzU^AyW1NEPxf000002,1:23444] [APP: oim#11.1.2.0.0] IAM-1020021 Unable to execute job : CmyAccess Flat File WD Employee with Job History Id:46608[[ |
What's missing with my SELinux installation? Posted: 09 Jan 2022 10:04 PM PST According to Introduction to SELinux, section 14.4.2, SELinux support is built into the standard kernels provided by Debian. The core Unix tools support SELinux without any modifications. I have installed the selinux-basics and selinux-policy-default packages on my Debian Wheezy (stable) system, and I saw it loading some policies during the installation, so I'm pretty sure the installation itself went well. I edited /etc/default/grub to say: GRUB_CMDLINE_LINUX="selinux=1 audit=1 enforcing=0" (that variable used to be empty) and ran update-grub. /boot/grub/grub.cfg does include the SELinux-related kernel parameters. I created a file /.autorelabel based on the /usr/sbin/selinux-activate script's "enable" branch. I have rebooted the system after making the above changes. Nothing out of the ordinary happened during that reboot. dmesg | head outputs, among else: Command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-4-amd64 root=UUID=c050d662-f94a-447a-9342-0fc69f65a513 ro selinux=1 audit=1 enforcing=0 quiet pci=nomsi As far as I can tell, everything is in place. Yet, it does not seem to be working. id -Z returns: $ id -Z id: --context (-Z) works only on an SELinux-enabled kernel $ sestatus gives: # sestatus SELinux status: disabled # check-selinux-installation gives: # check-selinux-installation getfilecon: getfilecon(/proc/1) failed SELinux is not enabled. Could not read the domain of PID 1. /etc/pam.d/login is not SELinux enabled Postfix init script is syncing the chroots. Postfix has chrooted service in master.cf FSCKFIX is not enabled - not serious, but could prevent system from booting... # What's missing for SELinux to be enabled on my system? |
cgroups analogue in Darwin Posted: 09 Jan 2022 11:03 PM PST Is there an analogue to cgroups in Darwin for preventing processes from escaping from the control / monitoring of its parent process by means of fork() ? If yes, what is it? For some background, consider a process, P, a direct descendant, Q, and the descendants of Q, R: cgroups allows P to control and monitor Q and R. If P launches Q, but Q spawns a process (r in R), without something akin to cgroups, P is unable to monitor r. A real world example of this would be systemd (P) spawning openssh's sshd (Q) as a daemon, which then spawns other instances of sshd (R) to handle each opened session. Without cgroups, systemd would not be able to interact with the per-session sshd's. (In the NT environment, cgroups are analogous to Job objects.) |
No comments:
Post a Comment