Missing drive in software RAID array after reboot Posted: 19 Apr 2021 10:00 AM PDT I have the Problem that I made a software RAID6-array of 6 HDD's. However, everytime the system gets rebooted the Array becomes inactive and after starting it again it degenerates, were always the same drive is missing (/dev/sde). When I re-add the drive the array reassembles and functions properly again, but I'd like to solve that problem. cat /proc/mdstat (after reboot): Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md0 : inactive sdc[2](S) sdf[5](S) sdd[3](S) sdb[1](S) sda[0](S) 48831523840 blocks super 1.2 mdadm –detail /dev/md0 (after re-adding /dev/sde) Version : 1.2 Creation Time : Wed Aug 12 20:25:02 2020 Raid Level : raid6 Array Size : 39065219072 (37255.50 GiB 40002.78 GB) Used Dev Size : 9766304768 (9313.87 GiB 10000.70 GB) Raid Devices : 6 Total Devices : 6 Persistence : Superblock is persistent Intent Bitmap : Internal Update Time : Wed Apr 14 14:20:42 2021 State : clean, degraded, recovering Active Devices : 5 Working Devices : 6 Failed Devices : 0 Spare Devices : 1 Layout : left-symmetric Chunk Size : 512K Consistency Policy : bitmap Rebuild Status : 13% complete Name : UUID : c41002b3:537a96c4:d6a3e2a9:f6debd2b Events : 87437 Number Major Minor RaidDevice State 0 8 0 0 active sync /dev/sda 1 8 16 1 active sync /dev/sdb 2 8 32 2 active sync /dev/sdc 3 8 48 3 active sync /dev/sdd 6 8 64 4 spare rebuilding /dev/sde 5 8 80 5 active sync /dev/sdf mdadm –detail /dev/md0 (after reassembly) /dev/md0: Version : 1.2 Creation Time : Wed Aug 12 20:25:02 2020 Raid Level : raid6 Array Size : 39065219072 (37255.50 GiB 40002.78 GB) Used Dev Size : 9766304768 (9313.87 GiB 10000.70 GB) Raid Devices : 6 Total Devices : 6 Persistence : Superblock is persistent Intent Bitmap : Internal Update Time : Wed Mar 10 14:08:55 2021 State : clean Active Devices : 6 Working Devices : 6 Failed Devices : 0 Spare Devices : 0 Layout : left-symmetric Chunk Size : 512K Consistency Policy : bitmap Name : UUID : c41002b3:537a96c4:d6a3e2a9:f6debd2b Events : 72271 Number Major Minor RaidDevice State 0 8 0 0 active sync /dev/sda 1 8 16 1 active sync /dev/sdb 2 8 32 2 active sync /dev/sdc 3 8 48 3 active sync /dev/sdd 6 8 64 4 active sync /dev/sde 5 8 80 5 active sync /dev/sdf /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/nvme0n1p5 during installation UUID=50ba9118-24c0-4483-bc27-6e8d2fc3b844 / ext4 errors=remount-ro 0 1 # /boot/efi was on /dev/nvme0n1p1 during installation UUID=F92D-03DC /boot/efi vfat umask=0077 0 1 /swapfile none swap sw 0 0 #Mount RAID-Array (last edit: 16/04/2021; lukas) #/dev/md0 /mnt/md1 ext4 defaults,nofail,discard 0 0 #UUID= 29994073-b1c9-4b0f-8168-77c2475d6133 UUID=29994073-b1c9-4b0f-8168-77c2475d6133 /mnt/md1 ext4 defaults 0 0 |
Deploying website backend files to webserver from git repo Posted: 19 Apr 2021 09:57 AM PDT We are trying to improve the management of our website backend files, and are planning to deploy (using git pull ) the files from the git repo (hosted on a local (within our organisation) GitLab server) to a test web server, and then in turn from the repo to the live web server (which will be new and starting from scratch, as the current server is approaching end of OS support). We are a very small team and don't have much in the way of resources (time, mainly), but it is likely that at least 2 people will be updating different parts of the website. I am trying to foresee potential issues with this plan and work out how to resolve them. First of all, file ownership. Our previous setup had each of us doing everything as root and we want to avoid this as much as possible. We have created a new unix group for the website files and have added the devops team (and the apache user) to it, with the intention of using setgid to ensure that files can be created and then updated without file permission problems. (What would be even better would be if there were some way that the devops team could write to the files, but that Apache could only read them?) Regarding git itself, I am assuming that having different people using git pull is likely to be problematic, with the files in the .git folder possibly owned by and only accessible to the person whose actions last updated them (unless it is possible to successfully apply setgid to this folder as well?). Is this plan likely to be workable, or are there yet more potential problems that we have not foreseen? Are there other (preferably not very complicated, given our limited resources) ways that we could attempt to do something similar? |
gtk name for [, ] and / Posted: 19 Apr 2021 10:10 AM PDT I am trying to change my xfce4 terminal keybindings by editing the accels.scm file. One of the changes I lines I wrote is (gtk_accel_path "<Actions>/terminal-window/next-tab" "<Alt>]") . However, this is not working: it seems that gtk needs me to use some name like "RightSquareBracket" or something of the sort instead of simply "]". The same happens with [ and /. I searched for some list with name-key correspondences for gtk without luck. Do you know where I can find these correspondences? Or at least what are the strings corresponding to [, ] and /? |
Cuda update on centos wants to install new version. but old versions are taking up so much space that new version can't be installed Posted: 19 Apr 2021 09:37 AM PDT I just ran yum update, and a cuda update on centos 7 wants to install new version. but old versions are taking up so much space that new version can't be installed. Install 3 Packages (+52 Dependent packages) Upgrade 15 Packages Total size: 2.9 G Is this ok [y/d/N]: y Downloading packages: Running transaction check Running transaction test Transaction check error: installing package libcusparse-devel-11-3-11.5.0.58-1.x86_64 needs 118MB on the / filesystem installing package cuda-cuxxfilt-11-3-11.3.58-1.x86_64 needs 118MB on the / filesystem installing package cuda-documentation-11-3-11.3.58-1.x86_64 needs 118MB on the / filesystem installing package cuda-memcheck-11-3-11.3.58-1.x86_64 needs 119MB on the / filesystem installing package cuda-nsight-11-3-11.3.58-1.x86_64 needs 237MB on the / filesystem installing package cuda-demo-suite-11-3-11.3.58-1.x86_64 needs 250MB on the / filesystem installing package cuda-toolkit-11-config-common-11.3.58-1.noarch needs 250MB on the / filesystem installing package nsight-compute-2021.1.0-2021.1.0.18-1.x86_64 needs 934MB on the / filesystem installing package cuda-nsight-compute-11-3-11.3.0-1.x86_64 needs 934MB on the / filesystem installing package nettle-2.7.1-9.el7_9.x86_64 needs 935MB on the / filesystem installing package cuda-toolkit-config-common-11.3.58-1.noarch needs 934MB on the / filesystem installing package cuda-cudart-11-3-11.3.58-1.x86_64 needs 935MB on the / filesystem installing package cuda-libraries-11-3-11.3.0-1.x86_64 needs 935MB on the / filesystem installing package cuda-runtime-11-3-11.3.0-1.x86_64 needs 935MB on the / filesystem installing package cuda-cudart-devel-11-3-11.3.58-1.x86_64 needs 941MB on the / filesystem installing package cuda-samples-11-3-11.3.58-1.x86_64 needs 1121MB on the / filesystem installing package cuda-nvprune-11-3-11.3.58-1.x86_64 needs 1122MB on the / filesystem installing package cuda-sanitizer-11-3-11.3.58-1.x86_64 needs 1154MB on the / filesystem installing package nsight-systems-2021.1.3-2021.1.3.14_b695ea9-0.x86_64 needs 1824MB on the / filesystem installing package cuda-nsight-systems-11-3-11.3.0-1.x86_64 needs 1824MB on the / filesystem installing package cuda-visual-tools-11-3-11.3.0-1.x86_64 needs 1824MB on the / filesystem installing package cuda-cuobjdump-11-3-11.3.58-1.x86_64 needs 1825MB on the / filesystem installing package cuda-compiler-11-3-11.3.0-1.x86_64 needs 1825MB on the / filesystem installing package cuda-gdb-11-3-11.3.58-1.x86_64 needs 1838MB on the / filesystem installing package cuda-cupti-11-3-11.3.58-1.x86_64 needs 1915MB on the / filesystem installing package cuda-nvtx-11-3-11.3.58-1.x86_64 needs 1916MB on the / filesystem installing package cuda-tools-11-3-11.3.0-1.x86_64 needs 1916MB on the / filesystem installing package cuda-toolkit-11-3-11.3.0-1.x86_64 needs 1916MB on the / filesystem installing package cuda-11-3-11.3.0-1.x86_64 needs 1916MB on the / filesystem installing package cuda-11.3.0-1.x86_64 needs 1916MB on the / filesystem installing package nettle-devel-2.7.1-9.el7_9.x86_64 needs 1917MB on the / filesystem Error Summary ------------- Disk Requirements: At least 1917MB more space needed on the / filesystem. Looking at filesystem I see this: The largest file system culprits are the previous versions of CUDA (4.7GB and 4.0GB a piece). I don't understand why Nvidia doesn't remove minor versions upon update but what ever, I don't think I need either 11.1 or 11.2 when I'm upgrading to 11.3. I'm afraid of just straight up removing the files, I've been burned before by CUDA installations that get corrupted overtime to the point of being unusable because of actions like that, I don't know what safe actions I should be doing now to solve this issue so I can actually update. |
Merging files on the basis of common data Posted: 19 Apr 2021 09:30 AM PDT I have two csv files File 1 : 799001,8_802,3122,627654 File 2 : 799001,567765,v567575 When i try to merge the two files with column 1 as the key, I can see that the files are getting merged, however column 3 of file1 is not getting printed. My output : 799001,2_802_3122,567765,v567575 Expected output : 799001,2_802_3122,627654,567765,v567575 I tried this : awk -F , 'BEGIN { OFS = FS } FNR == NR { names[$1] = $2; next } ($1 in names) { print $1, names[$1], $2 , $3 , $4 }' file1 file2 Why is column3 not getting merged ? |
Setup SD Card Reader on Debian 10 Posted: 19 Apr 2021 09:06 AM PDT I want to use the sd card reader on my ASUS UX501VW-FY144T. Via hw-probe (link) one can see that the sd card is a Alcor Micro AU6621, which isn't configured correct. So I updated to the kernel version 5.10.: ~ cat /proc/version Linux version 5.10.0-0.bpo.3-amd64 (debian-kernel@lists.debian.org) (gcc-8 (Debian 8.3.0-6) 8.3.0, GNU ld (GNU Binutils for Debian) 2.31.1) #1 SMP Debian 5.10.13-1~bpo10+1 (2021-02-11) Now there should be support for this card reader according to github. But on insertion nothing happens. dmesg prints nothing and lsusb , lsblk , lscpi don't list the sd card reader. Any ideas? Thanks in advance! Luke |
Debian 10 freezes, possibly related to running Zoom Posted: 19 Apr 2021 08:54 AM PDT I have two computers (henceforth referred to as computer 1 and computer 2, respectively) on which I run Debian 10. On computer 1, I have at two or three times had the computer seemingly freeze up, such that the screen would freeze and the computer would not respond to keyboard input (I was also unable to toggle keys like NumLock and CapsLock). On at least one of these occasions (possibly all, I don't quite remember), I have been running Zoom. The sound has then continued to work, both for myself and for the other participants in the call. In addition, the video from my camera has still worked for the other participants. At first, I though there might be some kind of hardware issue with computer 1. However, I recently had the same problem occur on computer 2. Again, I was running Zoom. The computer seemingly froze and did not respond to keyboard input or mouse movement. However, the sound still worked and the video from my camera still worked for the other participants in the call. There could of course be some kind of hardware issue with both computer 1 and computer 2. Howver, I am more inclined to believe it is software related, since I've had the same kind of issue on two different machines. I am looking for advice on how to troubleshoot the error and suggestions for what might cause it. |
Upgrade Fedora 33 to Fedora 34 failed due to insufficient /var space Posted: 19 Apr 2021 08:50 AM PDT I was performing an upgrade from Fedora 33 to Fedora 34 Everything seemed to work, then I did the system upgrade reboot, and that seemed to work too until I got to the login where I got just a black screen. Escaping to shell I saw in the logs errors about lack of disk space in /var and sure it was 100% Foolishly I deleted /var/tmp/* and now I can't boot at all to 34 or 33; I just get the dreaded "Oh snap: something went wrong" I think it still wants to complete the upgrade but it can't. At this point I'd just like to know if there is something I can do to just let it boot to 33 again, or somehow force it to continue the upgrade or wipe out that upgrade so I can start over. |
A better way to connect to the VPN with single-use PIN Posted: 19 Apr 2021 08:41 AM PDT At my workplace we are using VPN to connect to our servers. Our VPN system is configured that way that it accepts as a password 8 digits generated by OTP and 4 persistent digits (e.g. 1111) = 12 digits in total. I'm using Debian 10 and OpenVPN. In the very beginning I was using openvpn command directly: specifying all parameters to it to perform the connection. Then I decided to make a life a little bit easier and created aliases in my .zshrc file: # For connecting and checking status after that alias ovpnc="sudo openvpn --config ~/OpenVPN/config/ovpn-client.ovpn --log /var/log/openvpn/ovpn-client.log --daemon | ovpns" # For checking logs alias ovpnl="sudo cat /var/log/openvpn/ovpn-client.log" # For checking status of connection alias ovpns="curl -I --silent <GitLab project URL's> | grep -q 'location: <GitLab project URL>' && (tput setaf 2 && echo 'Connected') || (tput setaf 1; echo 'Not connected')" # For closing connection alias ovpnd="sudo pkill openvpn" Because I am highly new to bash syntax, any suggestions are also welcome! As time goes by, this is getting very annoying to specify login (it is not short too) and password to just connect to the work VPN, sometimes I need to reconnect to different VPNs or disconnect from it and in one day it can be up to 20-40 reconnections. My questions are: - Is there any way to simplify a process of connection (if it will remember at least login name it will be excellent)?
- Is there an easy way to configure console OTP client? If there is then is there a way to pass its output to OpenVPN client?
|
Can an open port be hacked to get access to the command line? Posted: 19 Apr 2021 09:21 AM PDT Assume I run a custom app on an arbitrary port on a linux box - let's say 7890. This is a go language web server. Runs an app on top of HTTP. No HTTPS. It runs as a dedicated but "normal" user with no sudo rights. The firewall rule for this port allows "everyone (world)" to access it. All ssh access is secured and firewall rules allow only access via a set of known IPs. SSH access is configured to allow only key-based access. Is this enough information to answer the following questions: - Can an attacker ever gain access to the command line via that exposed port?
- If the previous question can be answered with "yes, if...", what are the most important things I need to take care of so that the app can't be exploited to get access to the box?
The assumption would be that there are no other known security holes. Obviously I am no security expert. I hope this is enough information to give an informed statement. I assume there are myriads of related issues and no "absolute" yes/no can be given, but maybe some rough idea is enough for me to get an idea. Thanks. |
unable to capture group in a non-capturing group in python Posted: 19 Apr 2021 08:35 AM PDT I want to capture value of serviceObject from below set of strings in a list. Have two scenarios for serviceObject in the given strings. Output im getting: serviceObject: ANY OR serviceObject: UUID: 184f7538-4f60-6f8c-0300-2cb8ed694fc4\nRADIUS Accounting(RADIUS Accounting): .That means matching group itself not group(1). Expected Output: "ANY" OR "RADIUS Accounting(RADIUS Accounting)" data = ''' name: rules1 base.name: Auto-named Route-dfe853339d00fd26 internalName: No Internal Name handle: 12 UUID: 00000000-0000-0001-0900-2cb8ed694fc4 ID: 12 Index: 7 properties: 0x840e028e groupList= (nil) callbackList=0xffff785eb970 IP Type: IPv4 groupList: (nil) callbackList: 0xffff785eb970 Node Callbacks: Module Name:Vpn TunnelIf Cb References:1 1: Data-(nil) References-1 RouteType: Static Policy Route destinationObject: ANY i sourceObject: ANY serviceObject: **ANY** MatchObject: N/A Path Type: kjlk =========================== name: rules2 base.name: Auto-named Route-7f82b9ed6a1456e0 internalName: No Internal Name handle: 13 UUID: 00000000-0000-0002-0900-2cb8ed694fc4 ID: 13 Index: 5 properties: 0x840e028e groupList= (nil) callbackList=0xffff78418240 IP Type: IPv4 groupList: (nil) callbackList: 0xffff78418240 Node Callbacks: Module Name:Vpn TunnelIf Cb References:1 1: Data-(nil) References-1 RouteType: Static Policy Route destinationObject: DMZ Subnets: Handle:13 ZoneHandle:0 Network Size:0 IP Version:IPv4 Properties:0x00000319 Type:0x00000008 UUID:f0391445-830b-ef2f-02 Updated: 03/31/2021 05:49:12.000 sourceObject: All X0 Management IP(All LAN Management IP): Handle:114 ZoneHandle:0 Network Size:1 IP Version:IPv4 Properties:0x00000319 Type:0x00000008 UUID:3b5f3d75-9e99-9950-0200- 2cb8ed694fc4 GROUP: member: Name:X0 IP Handle:22 Time Created: 03/31/2021 05:49:12.000, Last Updated: 03/31/2021 05:49:14.000 serviceObject: UUID: 184f7538-4f60-6f8c-0300-2cb8ed694fc4 RADIUS Accounting(RADIUS Accounting): Handle:11 Size:1 Properties:0x00002e1d IpType: 17 Port Begin: 1813 Port End: 1813 Time Created: 03/31/2021 05:49:12.000, Last Updated: 03/31/2021 05:49:12.000 ''' code snippet: import re print("Hello world") Rules ="" data2 = re.findall('^(name:\s*(?:\S+\s*\S*)$(?:.*\n)*?Time\sLast)', data, re.I | re.M) for i in data2: RulesParseData = re.search('(?:^serviceObject:\s*(?:.*?)[:|\n]\s*\s*(?:.*?)[:|\n](.*?):)|(?:^serviceObject:\s*(.*?)[:|\n])', str(i), re.IGNORECASE | re.MULTILINE) print(RulesParseData.group(1)) |
Permission Denied when using Scalpel Posted: 19 Apr 2021 08:17 AM PDT I've mounted my iphone to /home/user1/iphone using ifuse. Now i would like to use the tool Scalpel on the directory, but when running the command i get this: ERROR: Couldn't open input file: -- Permission denied Scalpel was unable to open the image file: /home/user1/iphone Skipping... This happens when running with sudo as well. Found no solution yet, any ideas? |
re-arrange text file with different headlines to a csv Posted: 19 Apr 2021 08:59 AM PDT I have a file like this on a Linux machine: dn: cn=333-MMMM-PPPP_DET1,ou=groups,ou=functional,o=company member: cn=aaa,ou=users,ou=accounts,o=company member: cn=bbb,ou=users,ou=accounts,o=company member: cn=ccc,ou=users,ou=accounts,o=company member: cn=ddd,ou=users,ou=accounts,o=company member: cn=eee,ou=users,ou=accounts,o=company dn: cn=333-MMMM-PPPP_DET2,ou=groups,ou=functional,o=company dn: cn=333-MMMM-PPPP_DET3,ou=groups,ou=functional,o=company member: cn=aaa,ou=users,ou=accounts,o=company member: cn=ggg,ou=users,ou=accounts,o=company And I would like to convert it to get an easy formatted csv to import in further applications: aaa;333-MMMM-PPPP_DET1 bbb;333-MMMM-PPPP_DET1 ccc;333-MMMM-PPPP_DET1 ddd;333-MMMM-PPPP_DET1 eee;333-MMMM-PPPP_DET1 aaa;333-MMMM-PPPP_DET3 ggg;333-MMMM-PPPP_DET3 I already tried: awk '1;/^$/{exit} -> show all lines until the first break (the plan was to print them, move it to another file and then delete them. In a loop. awk 'FNR == 1 {suffix=$0} {print $0suffix}' -> take the first line and put it to the end of all other lines. I didn't find a way to solve this. Any suggestions? |
awk: Parsing a textfile by using keywords for the layout Posted: 19 Apr 2021 10:04 AM PDT I want to create a bash script which iterates through a file, one line at a time, and produces a coherent output: example.txt ALBERT some a BRYAN some b CLAUDIA some c DAVID some d ERIK some e ALBERT some a BRYAN some b ERIK some e ALBERT some a BRYAN some b DAVID some d some notes: - the word count between the tags is varying
- the keywords always appear in the same order
- A complete list of keywords is available and could be specified before hands
Needed output: some a; some b; some c; some d; some e some a; some b;;; some e some a; some b;; some d; I can easily replace the keywords one by one with a semicolon using sed: sed -i 's/ALBERT/;/g' "example.txt" How can I use awk to iterate through every line and add the required semicolons if some of the keywords are missing? I suspect one has to introduce some kind of counter? |
Can't compile any c/ c++ program, linker problem Posted: 19 Apr 2021 08:27 AM PDT It's my second post here, i have a huge problem which prevents me to study so i have to fix it as soon as it's possible ! My gcc was working fine and i had to work on FairThreads (in C). I downloaded the following archive : Fair Threads As you can see, in /src there's a makeFile, i replaced the second line which was : LIB_DIR = ../lib by LIB_DIR = /usr/bin/ld and i compiled the makeFile by the command "make" And now, i cannot compile any c/c++ program anymore. Even a hello world program. I got the following error message on the terminal for every compiling attempt : /usr/bin/ld: 2: /usr/bin/ld: Syntax error: newline unexpected collect2: error: ld returned 2 exit status I have found on the net this solution but it doesn't work for me : sudo apt-get autoremove binutils sudo apt-get install binutils I also tried to reinstall gcc, when executing : sudo apt-get purge gcc i got : Des erreurs ont été rencontrées pendant l'exécution : linux-firmware linux-image-generic-hwe-18.04 linux-generic-hwe-18.04 E: Sub-process /usr/bin/dpkg returned an error code (1) but when i trie a gcc --version it tells me that it is not found. So when i execute the command to reintall it : sudo apt-get install gcc i also get : Des erreurs ont été rencontrées pendant l'exécution : linux-firmware linux-image-generic-hwe-18.04 linux-generic-hwe-18.04 linux-image-5.4.0-72-generic initramfs-tools E: Sub-process /usr/bin/dpkg returned an error code (1) but gcc --version tellls that it's installed. Finally, when i trie to compile a program, i got : /usr/bin/ld: 2: /usr/bin/ld: Syntax error: newline unexpected collect2: error: ld returned 2 exit status I hope that i explained well, and i'll get a solution for this :/, as a computer science student, i can't do anything without gcc :( EDIT 1 : When i try to remove bin/ld by executing : sudo rm -fr /usr/bin/ld;sudo apt-get install --reinstall binutils i got : Des erreurs ont été rencontrées pendant l'exécution : linux-firmware linux-image-generic-hwe-18.04 linux-generic-hwe-18.04 linux-image-5.4.0-72-generic initramfs-tools E: Sub-process /usr/bin/dpkg returned an error code (1) and this particular error message : WARNING: no ldd around - install libc-bin EDIT : I have installed ldd by the command : sudo apt-get install libc-bin still no changes... |
Problem in Python (ubuntu) Posted: 19 Apr 2021 08:15 AM PDT When i try to install this i get this error what is the solution ubuntu@ip-xxx-xxx-xxx-xxx:~/URLuploader-With-Hotstar$ pip3 install -r requirements.txt Traceback (most recent call last): File "/usr/bin/pip3", line 9, in <module> from pip import main File "/usr/lib/python3/dist-packages/pip/__init__.py", line 14, in <module> from pip.utils import get_installed_distributions, get_prog File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 23, in <module> from pip.locations import ( File "/usr/lib/python3/dist-packages/pip/locations.py", line 9, in <module> from distutils import sysconfig ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/__init__.py) |
Wine unable to install programs Posted: 19 Apr 2021 09:17 AM PDT I was just gonna click open the musicbee .exe installation file, expecting wine to start and run, but after wine asked me to install something in the popup which I did not read, it never was able to install the program. Though previous installations like foobar still works. Any ideas as to why and how can I fix it? OS: Arch linux , lts-kernel DE: Gnome 40.0.0 Wine: Both stable 6.6 and staging 6.6 App: Musicbee can't be installed; foobar previously installed and running Problem: how to get wine to get to the install window instead of quitting before even a single pop up Note: There is no wine icon in the menu for some reason, but I don't think that is important. And there is no popup either when I run winecfg in terminal, all I get is a hanging cursor. Thanks for dropping by! |
Why does ed start at the last line? Posted: 19 Apr 2021 08:28 AM PDT Why does ed start at the last instead of first line of a file? Most of ed's behavior makes sense when you remember that it was for interacting with a printer, but not this. Since I believe it reads the whole file into memory, it's not even an IO seek thing. |
Passing variable to AWK not working inside a loop Posted: 19 Apr 2021 08:54 AM PDT I have this awk statement that reads a YAML file and outputs a particular value. I need to loop this awk inside a loop where I read a key value from a list of values and pass that key to awk. The YAML file has this structure: abc: NAME: Bob OCCUPATION: Technician def: NAME: Jane OCCUPATION: Engineer Say I want to get key abc OCCUPATION value of TECHNICIAN , through googling I managed to construct an awk statement that gives what I want > awk 'BEGIN{OFS=""} /^[^ ]/{ f=/^abc:/; next } f{ if (sub(/:$/,"")) abc=$2; else print abc,$1 $2}' test.yml| grep "OCCUPATION:" | cut -d':' -f2 Technician However passing -v option to awk does not seem to give anything if I use this loop: items="abc,def" for item in $(echo $items | sed "s/,/ /g"); do echo $item; awk -v name="$item" 'BEGIN{OFS=""} /^[^ ]/{ f=/^\name:/; next } f{ if (sub(/:$/,"")) name=$2; else print name,$1 $2}' test.yml| grep "OCCUPATION:" | cut -d':' -f2; done I get just the debug echos I set out abc def Where am I going wrong? I thought the variable should be interpreted correctly inside awk? EDIT: Based on steeldrivers comment I have changed the input a little items="abc,def" for item in $(echo $items | sed "s/,/ /g"); do echo $item; awk -v name="$item" 'BEGIN{OFS=""} /^[^ ]/{ f=name; next } f{ if (sub(/:$/,"")) name=$2; else print name,$1 $2}' test.yml| grep "OCCUPATION:" | cut -d':' -f2; done However now I am getting all values for OCCUPATION printed: abc Technician Engineer def Technician Engineer I tried to use the ~ operator but I think I am not using it right as it is giving me errors, so I decided to just parse the value directly, but this is giving duplicates :/ |
Ubuntu - when I plug in my headphone, my keyboard layout is reset to default, how can I stop it Posted: 19 Apr 2021 08:16 AM PDT I set my keyboard layout to a customized one, with setxkbmap . It is started with "Autostart Application"(~/.config/autostart ) and is working fine. But when I plug in my Jabra headphone, it is reset to default US QWERTY one. I want to stop that. I see another post How to set xinput properties triggered by udev device connection? Prevent keyboard layout reset when USB keyboard is plugged in but the best answer assumes that the OP just plugs in another new keyboard; I think this is a wrong assumption and this is definitely not my case. I understand it is an udev problem, and a quite bad bug. Ubuntu 18.04. Using udevadm monitor , I see these lines when Jabra headphone is plugged in: monitor will print the received events for: UDEV - the event which udev sends out after rule processing KERNEL - the kernel uevent KERNEL[514.356707] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2 (usb) KERNEL[514.360571] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0 (usb) KERNEL[514.384326] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0/sound/card1 (sound) KERNEL[514.384427] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0/sound/card1/pcmC1D0p (sound) KERNEL[514.384485] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0/sound/card1/pcmC1D0c (sound) KERNEL[514.384542] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0/sound/card1/controlC1 (sound) KERNEL[514.384584] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0 (usb) KERNEL[514.384616] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.1 (usb) KERNEL[514.384645] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.1 (usb) KERNEL[514.384675] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.2 (usb) KERNEL[514.384701] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.2 (usb) KERNEL[514.384730] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3 (usb) KERNEL[514.387245] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B (hid) KERNEL[514.387575] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B/input/input18 (input) KERNEL[514.444127] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B/input/input18/event6 (input) KERNEL[514.444169] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B/input/input18/input18::mute (leds) KERNEL[514.444318] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/usbmisc/hiddev0 (usbmisc) KERNEL[514.444375] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B/hidraw/hidraw1 (hidraw) KERNEL[514.444438] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B (hid) KERNEL[514.444473] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3 (usb) KERNEL[514.444510] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2 (usb) UDEV [514.967946] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2 (usb) UDEV [514.970785] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0 (usb) UDEV [514.971920] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.1 (usb) UDEV [514.972737] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.2 (usb) UDEV [514.973022] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3 (usb) UDEV [514.973854] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0/sound/card1 (sound) UDEV [514.974449] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.1 (usb) UDEV [514.975643] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.2 (usb) UDEV [514.976113] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B (hid) UDEV [514.976909] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/usbmisc/hiddev0 (usbmisc) UDEV [514.979273] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B/hidraw/hidraw1 (hidraw) UDEV [514.980161] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0/sound/card1/pcmC1D0c (sound) UDEV [514.980666] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B/input/input18 (input) UDEV [514.980736] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0/sound/card1/pcmC1D0p (sound) KERNEL[514.980866] change /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0/sound/card1 (sound) UDEV [514.983803] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B/input/input18/input18::mute (leds) UDEV [515.017334] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B/input/input18/event6 (input) UDEV [515.019498] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3/0003:0B0E:0305.000B (hid) UDEV [515.020828] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.3 (usb) UDEV [515.790142] add /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0/sound/card1/controlC1 (sound) UDEV [515.792199] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0 (usb) UDEV [515.794039] bind /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2 (usb) UDEV [515.796084] change /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.2/3-3.2:1.0/sound/card1 (sound) And after it, with xinput list , I see: ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ HP HP USB 1000dpi Laser Mouse id=8 [slave pointer (2)] ⎜ ↳ Chicony HP Business Slim Keyboard Consumer Control id=13 [slave pointer (2)] ⎜ ↳ PS/2 Generic Mouse id=18 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ Sleep Button id=7 [slave keyboard (3)] ↳ Chicony HP Business Slim Keyboard id=10 [slave keyboard (3)] ↳ Chicony HP Business Slim Keyboard System Control id=11 [slave keyboard (3)] ↳ Chicony HP Business Slim Keyboard id=12 [slave keyboard (3)] ↳ Integrated_Webcam_FHD: Integrat id=14 [slave keyboard (3)] ↳ Integrated_Webcam_FHD: Integrat id=15 [slave keyboard (3)] ↳ Dell WMI hotkeys id=16 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=17 [slave keyboard (3)] ↳ Chicony HP Business Slim Keyboard Consumer Control id=19 [slave keyboard (3)] ↳ GN Netcom A/S Jabra EVOLVE LINK MS id=9 [slave keyboard (3)] Chicony HP Business Slim Keyboard is my USB keyboard that I want to set layout, and GN Netcom A/S Jabra EVOLVE LINK MS is the headphone. |
How to assign a name to the existing anonymous network namespace Posted: 19 Apr 2021 09:22 AM PDT I have a Linux process that creates a network namespace without registering it in /run/netns. The process has also own PID namespace. The network namespace does not have a name and I can see only id of the namespace: # ip netns list-id nsid 0 nsid 1 Is there a possibility to assign a name to the network namespace so I can use convenient ip-netns commands to show and manage the namespace? I have found an article How to access an unnamed network namespace but it does not work for me because my process has own PID namespace so I do not see the process in the root namespace. |
Can't install Golang on Solaris via pkg - release/evaluation dependency Posted: 19 Apr 2021 08:22 AM PDT On a new installation of Solaris 11.3 on Sparc hardware, I'm trying to install Golang but am getting the following problem: # pkg install --accept developer/golang Creating Plan (Solver setup): | pkg install: No matching version of developer/golang can be installed: Reject: pkg://solaris/developer/golang@1.7-5.12.0.0.0.122.0 Reason: No version for 'require' dependency on release/evaluation can be found I'm new to Solaris but have installed a few other things via pkg and am also familiar with other packaging systems on Linux systems (rpm, apt, etc). What am I missing? The missing dependency on release/evaluation doesn't seem to be something I can install, and I've seen a post about 11.4 and FOSS software installs not having nasty "surprises" like 11.3 (which I think I've just found), but I can't see what those surprises are. NB: if it's relevant, I'm not currently using zones/etc, I'm just treating the system as one machine. |
Manjaro - how to set in routing table that addresses to internet come out by specific IP? Posted: 19 Apr 2021 08:19 AM PDT I have a connection via VPN with my work. I know that internet connection (for example to 8.8.8.8) goes through my work network (only when I am connected to VPN). How to configure ip tables to force that connections to internet (for example 8.8.8.8) avoid work network ? Using @Julie help in comments I did managed to discover some options: Nevertheless, after checking 'Use this connection only for resources...' I can't ping machines in VPN network. Can you tell me how should I deal with it ? I guess that I should click 'Add' and set: Address = address of some machine in VPN Netmask = I can get it from ifconfig (in VPN interface) Gateway - as in case of netmask Metri - I have no idea ? Am I right ? |
How to sharing Android VPN with Linux? Posted: 19 Apr 2021 08:37 AM PDT I have a rooted galaxy note5 with Android 7, and an Asus laptop with Ubuntu 16.04. I like to share my phone VPN connection with my laptop. I tried some apps like VPNTether,DF tethering fix, TetherNet, Pdanet+, etc. but they didn't work! I think I could use the VPNTheter on windows 10 and it worked, but they don't work on Ubuntu! Also I tested two Wi-Fi and USB cable methods. Also I found this method but couldn't understand what it says in numbers 6 and 7 ? 1. You need a rooted device 2. Make sure you have a VPN app, like OpenVPN or DroidVPN ( I use DroidVPN and its the best) 3. Download Terminal Emulator 4. Activate your hotspot and connect to your VPN 5. Launch Terminal emulator and on the first line type "su" (without the quotes) and press enter 6. Copy and paste this to the Terminal Emulator. Make sure to paste to a new folder using Root Browser first and copy to T.E. in the exact format as shown below: iptables -t filter -F FORWARD iptables -t nat -F POSTROUTING iptables -t filter -I FORWARD -j ACCEPT iptables -t nat -I POSTROUTING -j MASQUERADE ip rule add from 192.168.43.0/24 lookup 61 ip route add default dev tun0 scope link table 61 ip route add 192.168.43.0/24 dev wlan0 scope link table 61 ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61 7. That's about it. Also, be sure to make a folder with Root Browser and paste the code there, as this resets after re-boot. It worked on my LG G3 on android 4.4.2 |
Recover deleted partition using testdisk Posted: 19 Apr 2021 08:46 AM PDT Last night I was not as awake as I thougt i was and I ended up formatting the wrong drive using GParted..... I thought of testdisk to recover the lost partition but I don't really understand how to use it. First of all Testdisk detect the partition table of my drive as "none" where as it should be detected as Intel (in my opinion) If I select an Intel partition type and then analyse --> deeper search it showing in the first second of the scan the correct (backup superblock ?) of my "Lacie1To" partition witch used to be the only Ext4 partition occupying all the disk. But if I clicked on stop it doesn't show me the partition in the list. So my question, what should I do with this info ? |
Activation of network connection failed. Kali linux v2.0 Posted: 19 Apr 2021 09:57 AM PDT I can't connect to internet via wired, adding DSL profile with user and password. While installing kali linux 2.0 there was a warning telling that there is missing non-free firmware `rtl_nic/rtl8106e-1.fw` but it is in /lib/firmware/rtl_nic/ Have Realtek RTL8139/810x Fast Ethernet Adapter PCI. Was no problem on previous versions of Kali. |
Sending files over Samba with command line Posted: 19 Apr 2021 08:38 AM PDT I was wondering if there is a way to use Samba to send items to a client machine via the command line (I need to send the files from the Samba server). I know I could always use scp but first I was wondering if there is a way to do it with Samba. Thanks! |
Getting the current path in .desktop EXEC command Posted: 19 Apr 2021 08:50 AM PDT Im trying to make a .desktop file run a .sh which is stored in the same directory as the .desktop. The whole directory needs to be portable and moved from machine to machine. my run script is run.sh I've tried: [Desktop Entry] Type=Application Terminal=true Name=RunMe #Exec=sh -c "`dirname %k`/run.sh" #Exec=bash -c "export PATH=$PATH:`dirname %k`; bash run.sh;" #Exec=bash -c "export PATH=$PATH:`dirname %k`; sh run.sh;" Exec=bash -c "export PATH=$PATH:`dirname %k`; run.sh;" But nothing happens when I double click the .desktop file. If I double click 'run.sh' and choose 'run' the script runs fine. If I run the script from the command line with 'sh run.sh ' it works fine. Any ideas, even just how I could debug which path its actually trying to run from? |
What's the easiest way to find an unused local port? Posted: 19 Apr 2021 08:22 AM PDT What's the easiest way to find an unused local port? Currently I'm using something similar to this: port=$RANDOM quit=0 while [ "$quit" -ne 1 ]; do netstat -a | grep $port >> /dev/null if [ $? -gt 0 ]; then quit=1 else port=`expr $port + 1` fi done It feels awfully roundabout, so I'm wondering if there's a more simple path such as a builtin that I've missed. |
sudo over ssh: no tty present and no askpass program specified Posted: 19 Apr 2021 09:31 AM PDT I keep getting this error and have tried several ways discussed online to fix this and none are working for me. I have setup SSH keys so when I run 'ssh newton@host.com' it automatically logs me in, I have also set this user in visudo to be 'newton ALL=(ALL:ALL) ALL' I then also tried to add 'newton ALL=NOPASSWD: /var/www/script.sh' Unfortunately, every time I run ssh newton@host.com 'sudo /var/www/script.sh' from Cygwin I get back. I have also tried to add -t -t but then it prompts me for the password. total size is 21209180 speedup is 314.69 sudo: no tty present and no askpass program specified Sorry, try again. sudo: no tty present and no askpass program specified Sorry, try again. sudo: no tty present and no askpass program specified Sorry, try again. sudo: 3 incorrect password attempts sudo: no tty present and no askpass program specified Sorry, try again. sudo: no tty present and no askpass program specified Sorry, try again. sudo: no tty present and no askpass program specified Sorry, try again. sudo: 3 incorrect password attempts |
No comments:
Post a Comment