Recent Questions - Unix & Linux Stack Exchange |
- Printing content of file from nth line to nth line [Shell Scripting] [duplicate]
- Set Windows like default entry with efibootmgr, but showing menu
- Automatic reboot after suspend
- The weird order when concating variables and string with '_' [duplicate]
- Add more partition to NVMe SoftRAID
- Server hang while rebooting Getting below error, what is the issue the environment is rhel 5.4?
- How to enable broadcasting for loopback
- Extracting *full* linux headers from source
- OpenSource Homework script
- Unable to validate LUKS encryption
- Ideal ratio of tcp_max_syn_backlog and net.core.somaxconn
- Will this auto-respawn bash script work?
- How networking works with forwarding disabled?
- So, I need to display the total number of files in a directory, so how can I use "ls -la" command in vi editor using functions
- Does sudo apt install command also update an already installed app?
- How do I extract the digits from a line and save it into a variable?
- Correcting .zshrc to ~/.zshrc
- Question regarding awk 'NF {p=1} p'
- Is it possible to execute commands outside of a rule using GNU Make?
- I can’t get to my CentOS 8, Failed to switch root, '/sysroot'
- date - how to get next weekday (ignore weekends)
- Accessing qemu multicast networks (from Docker containers)
- Aws ec2 - How to rsync files between two remotes?
- How do i make guake start with tmux?
- Postfix does not check "From:" address with sender_login_maps
- How to use EXPECT in a loop foor ssh
- proxify a custom program to proxychains
- How to disable Wifi Power Save on Kali Linux
- How to detect the incoming httpd Connection Counts of each VHOSTS?
- Read and confirm shell script before piping from curl to sh (curl -s [url] | sh)
Printing content of file from nth line to nth line [Shell Scripting] [duplicate] Posted: 13 Jun 2021 12:09 AM PDT ** > Hey buddies I have a file having names of 200 countries.I want to print names of countries from 50th line to 80th line .How can i do so in bash?? ** |
Set Windows like default entry with efibootmgr, but showing menu Posted: 12 Jun 2021 11:40 PM PDT I have this menu starting my laptop. As you can see, I have multiple entries for CentOS 8. But, I want to set like default, my I was thinking in Reading this article https://www.lifewire.com/change-the-efi-boot-order-efibootmgr-4028027 Is it possible to keep the menu entries, changing to Windows with |
Automatic reboot after suspend Posted: 12 Jun 2021 11:39 PM PDT I'm a new user to Linux Mint and I've had issues with the graphic driver. I updated the kernel to 5.8 which solves the problem of adjusting the brightness or being able to wake up from suspend. But now my new problem is that after waking up from suspend, the computer automatically restarts just in a few minutes. Can anyone suggest what I should do? Thanks! The following is what I got from |
The weird order when concating variables and string with '_' [duplicate] Posted: 12 Jun 2021 10:38 PM PDT I tried to concat the variable and string. The result shows that _weightrojects/guo_lab/cbis/users/yang/DICA_result/609812419171 Why is this happening, the correct form in my mind is /projects/users/yang/DICA_result/609812419171_weight. How can I get this? By the way, if I delete the _weight, it just give /projects/users/yang/DICA_result/609812419171. Thanks so much. |
Add more partition to NVMe SoftRAID Posted: 12 Jun 2021 10:09 PM PDT I have SoftRAID setup on CentOS on my NVMe Drive (2x1TB) . Issue is I only provisioned 80GB and I now want to provision more for additional space. Can someone please help me do this. Here is output of lsblk https://pastebin.com/6jjvqD9d |
Server hang while rebooting Getting below error, what is the issue the environment is rhel 5.4? Posted: 12 Jun 2021 09:56 PM PDT Server hang while rebooting Getting below error, what is the issue? Environment is RHEL 5.4 |
How to enable broadcasting for loopback Posted: 12 Jun 2021 09:19 PM PDT I'm on a linux environment and I'm trying to send a broadcast to my loopback. I wanted to enable broadcast for my loopback interface but I can't see to get it to show on For example:
|
Extracting *full* linux headers from source Posted: 12 Jun 2021 07:15 PM PDT Linux kernel sources are full of quirks to support multiple architectures and scenarios. This means I cannot simply copy all *.h files and use a I was wondering how can I export full full kernel-space headers from the source tree properly?
|
Posted: 12 Jun 2021 08:27 PM PDT I need to make a startup script for a user with commands in the Terminal console. The orders are:
The installation:
|
Unable to validate LUKS encryption Posted: 12 Jun 2021 11:37 PM PDT Hello I have a question about LUKS encryption. I have used LUKS to encrypt a disk on my server but when I create a file and add content to it, and cat the file, the content is still in plain text. Even when I create a backup of the file, and put it on the non-encrypted hard drive, the data is in plain text. I'm not sure how I can say that encryption is happening. Am I missing something? Is this how LUKS is supposed to work? |
Ideal ratio of tcp_max_syn_backlog and net.core.somaxconn Posted: 12 Jun 2021 05:30 PM PDT Googling about TCP: Possible SYN flooding on port bring a lot of results, some places says to just increase somaxconn, other syn backlog But there is little information in how those values should be calculated, and what would the ideal ratio between them. I believe people would benefit from a answer teaching more than just tell people to use an arbitrary value. Some places says to use 65536 on somaxconn others says only 2048, and so on... |
Will this auto-respawn bash script work? Posted: 12 Jun 2021 04:55 PM PDT I've been having issues with my eth miner, nsfminer, crashing on me when I leave it on at night. Sometimes this occurs after 2-8 hours of mining, while sometimes it doesn't occur at all. It usually exits with a message that I can't recall off the top of my head. I did some searching on my own and threw together a bash script using an until loop and was wondering if this should work in theory. Usually I would just test it on my own because that's the best way to learn, but considering I may have to wait 8 hours for a crash or it may not even crash at all for several days, I'd like to know if this script will work before I potentially lose $5-10 of profit. It seems to work just fine when I run it, but I don't know if the autorespawn works as I've yet to leave it running for long enough to see if it crashes. I understand the security implications involved in passing a root password via a bash script, but it's the only way to get the miner to work as it requires root privileges and I have the system partitioned in a way that the installation I use for crypto mining only has mining stuff and i3 installed on it and doesn't have any passwords stored in plaintext in any files. It's otherwise a minimal ubuntu install with most of the applications stripped away. I intend in the future to perhaps go the debian stable route, or maybe start from ubuntu server which I have tried before but I just haven't had the time to get everything working with nvidia drivers being a pain and all. Thanks for any help from anyone more knowledgeable than me. |
How networking works with forwarding disabled? Posted: 12 Jun 2021 04:54 PM PDT I think on most systems the network forwarding is disabled by default - so the computer cannot act as a router. I wonder, how then does networking inside of the computer work? A few examples:
What is then really disabled when network forwarding is disabled in the system? |
Posted: 13 Jun 2021 12:49 AM PDT Here is the code I have so far: |
Does sudo apt install command also update an already installed app? Posted: 13 Jun 2021 12:52 AM PDT I'm new to Linux OS distributions and I came up with a question when I had to update my Visual Studio Code today. I've searched for some solutions to update it through my terminal and every solution involved applying the command |
How do I extract the digits from a line and save it into a variable? Posted: 12 Jun 2021 10:40 PM PDT I feel like this is a really easy question, and when I Google, I find lots of answers for part of the problem, but when I try to put them together, it doesn't work and I can't figure out why. Here's the scenario:
I cannot get past step 3. Here's what I've tried: This prints out: Great, but what if I need to trim white space or something? If I can't use |
Posted: 12 Jun 2021 05:45 PM PDT Is there a way to set some kind of an alias so that when I do: It does |
Question regarding awk 'NF {p=1} p' Posted: 12 Jun 2021 05:19 PM PDT Searching for a way to remove blank lines from the beginning and the end of a file, I've stumbled across this one: How / why does this work? I understand |
Is it possible to execute commands outside of a rule using GNU Make? Posted: 12 Jun 2021 07:59 PM PDT Is it possible to execute commands outside of a rule using GNU Make? Consider the following Makefile: This results in However, if I add a rule, it works: Is it really necessary to add rules for outputting variables for debugging, etc.? Bonus: Why does the removal of |
I can’t get to my CentOS 8, Failed to switch root, '/sysroot' Posted: 12 Jun 2021 10:46 PM PDT I have only pictures. And I can't write the Question well. I was starting my laptop (I have
https://i.stack.imgur.com/fuGRU.jpg https://i.stack.imgur.com/CAQ7Y.jpg The last image https://i.stack.imgur.com/onWbr.jpg Doing a With any idea why this failure occurs? And obviously, how I can solve it? In the image, the only entry working is Rescue The CentOS entry that is above the Windows entry Please help. EDIT 1 Using described on https://unix.stackexchange.com/a/212710/117555
I have now on Checking the File: And EDIT 2: I found some pictures of my installation (5 July 2020 15:05, for my reference)! Here my info (After the restart) I have this list... And this another List How I know what is /sysroot? I haven't How I can mount /boot/efi? grub commands aren't working! EDIT 3 In order to solve this problem I follow https://access.redhat.com/solutions/5622731 EDIT 4: https://www.golinuxcloud.com/update-grub2-grubby-grub2-editenv-rhel-8/ Checking https://www.techbrown.com/change-default-grub-entries-timeout-centos-rhel/ Works for me After Restart EDIT 5: For me it's estrange this line: EDIT 6: Obviously something wrong!!! The According to this link https://bugzilla.redhat.com/show_bug.cgi?id=1435435 The physical file must be located in How can I create the And Why are the Linux entries not appearing? I follow this link And following this answer https://stackoverflow.com/a/64637392 I list all I view a specific Check what was my default I was trying to change the default with # Reviewing 0 Entry And following https://unix.stackexchange.com/a/394889/400726 Selecting by title: Apparently it changed. Restarting, But it doesn't work either! Reviewing The files has been changed, are different!! I was trying I would have preferred a symlink (But, I undersa tood the situation https://www.linuxquestions.org/questions/suse-opensuse-60/boot-is-not-allowing-symbolic-link-creation-4175682262/#post6166967)! Is there some work around? |
date - how to get next weekday (ignore weekends) Posted: 12 Jun 2021 06:06 PM PDT I'm setting up a cron job to suspend and wake a server at certian times. I'm using two commands. One to be run from mondays to thursdays: And another one to be run on fridays: I wonder if it's possible to make this separation unnecessary. If I wasn't able to find if this is actually possible or what syntax should I use. I basically want to avoid my server waking up on saturdays and sundays. |
Accessing qemu multicast networks (from Docker containers) Posted: 13 Jun 2021 12:01 AM PDT QEMU allows to connect different VMs by using a virtual network based on a common multicast address by specifying This way I can easily connect multiple VMs and join new VMs on the fly. Is it possible to join that network without using QEMU? Especially is it possible to connect a docker container to that network? |
Aws ec2 - How to rsync files between two remotes? Posted: 12 Jun 2021 07:01 PM PDT I'm setting up a crontab server to run several jobs to copy files from prod servers to lower environment servers. I need the cron server job to copy files from one server to another. Here is what I have. the ip's have been modified I'm using two different pem keys and users. I would think this command would work but I get this error in the debug log. Here is more to it and only show the portion that is erroring. It connects to |
How do i make guake start with tmux? Posted: 12 Jun 2021 06:04 PM PDT i am using i3wm and guake. I always use tmux inside guake to have split functionality detach function etc is there a way to start guake by default tmux running ? |
Postfix does not check "From:" address with sender_login_maps Posted: 12 Jun 2021 11:04 PM PDT I am trying to set up a postfix configuration where (virtual) users are allowed to only send with "From:"-addresses they own. So I put Using in my However, returns nothing as expected. Now if I change the query to I am not able to send any mails at all. So far so good. But the log says even if I try to send from In a proper setup i would expect something like So it looks like postfix uses the login name to search for the login name regardless of the sender address, which explains why I can send with any sender address using the query I mentioned first. Update: I checked my sql logs and indeed, the MySQL server never sees Here are the smtps part from master.cf and my main.cf: smtps inet n - - - - smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o tls_preempt_cipherlist=yes -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING -o smtpd_sasl_type=dovecot -o smtpd_sasl_security_options=noanonymous -o smtpd_relay_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_mynetworks,permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING -o cleanup_service_name=submission-header-cleanup mynetworks = 127.0.0.0/8 inet_interfaces = all mydomain = domain.com myhostname = mail.domain.com myorigin = $mydomain mydestination = relayhost = smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_recipient smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname smtpd_sender_restrictions = reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, reject_authenticated_sender_login_mismatch, permit_sasl_authenticated smtpd_helo_required = yes smtpd_helo_restrictions = permit_mynetworks reject_invalid_helo_hostname reject_non_fqdn_helo_hostname reject_unknown_helo_hostname smtpd_data_restrictions = reject_unauth_pipelining smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous, noplaintext smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth postscreen_access_list = permit_mynetworks cidr:/etc/postfix/postscreen_access postscreen_blacklist_action = drop postscreen_greet_action = drop postscreen_dnsbl_threshold = 2 postscreen_dnsbl_sites = dnsbl.sorbs.net*1, bl.spamcop.net*1, ix.dnsbl.manitu.net*2, zen.spamhaus.org*2 postscreen_dnsbl_action = drop virtual_alias_maps = mysql:/etc/postfix/sql/aliases.cf virtual_mailbox_maps = mysql:/etc/postfix/sql/accounts.cf virtual_mailbox_domains = mysql:/etc/postfix/sql/domains.cf relay_domains = mysql:/etc/postfix/sql/relay_domains.cf smtpd_sender_login_maps = mysql:/etc/postfix/sql/sender_login_maps.cf virtual_uid_maps = static:3000 virtual_gid_maps = static:3000 virtual_mailbox_base = /home/vmail # Disable NIS lookup warning alias_maps=hash:/etc/aliases append_dot_mydomain = no recipient_delimiter = + |
How to use EXPECT in a loop foor ssh Posted: 12 Jun 2021 05:04 PM PDT Our Linux setup doesn't have keygen configured for password less authentication. Hence I am supposed to use only I know how to use But any idea how to use EXPECT here in the below scenario to make the connection password less? |
proxify a custom program to proxychains Posted: 12 Jun 2021 10:06 PM PDT After some research, I didn't find any solutions. So I post here. My goal: redirected the HTTPs traffic from my custom program to BurpSuite in order to analyse the server response and debug my program.
In a debugging goal, I have thought to send my flows via BurpSuite in order to see the HTTPS requests. So:
And when I use proxychains: My program is executed but proxychains doesn't "proxify" the flow and so Burp doesn't see nothing... I think that's because I am in my local network ? What do you think about the best solution to intercept and see the HTTPS flows to my php program ? |
How to disable Wifi Power Save on Kali Linux Posted: 12 Jun 2021 09:09 PM PDT I am running kali with virtualbox and my wifi receiver is a usb adapter which is Asus N10 Nano. I made the settings on virtualbox for making the vb recognize my usb wifi adapter. It works but after like 5min my internet drops. Especially during the updates. I figured it out its because the "Wifi Power Save" option is on. I turned it off and tried again. When i turned it off my wifi turned off at the same time. I tried to turn my wifi on but the Wifi Power Save option turned on itself automatically. The usb icon on bottom is like red-green. It needs to be blinking green to work correctly. If i can turn off the Wifi Power Save mod permamently hopefully its gonna be blinking green. I searched for it, I did almost everything like creating directory as Then i gave the permission lspci output: It didn't work. In the end |
How to detect the incoming httpd Connection Counts of each VHOSTS? Posted: 12 Jun 2021 08:10 PM PDT With RHEL and Apache (httpd), is there a way to:
Because in this few days, I got a lot of incoming connections on the server being acknowledged by using:
That means I have
|
Read and confirm shell script before piping from curl to sh (curl -s [url] | sh) Posted: 12 Jun 2021 08:25 PM PDT Whenever I have to execute a shell script from the web I remember seeing a command line trick that made it was possible to read the script from the command line and then confirm execution after reading the script. If I recall correctly, it looked something like Does anyone know this trick? |
You are subscribed to email updates from Recent Questions - Unix & Linux Stack Exchange. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment