New answers tagged

0

The deprecated flag is set when the "preffered lifetime" of the address drops to zero. You can set the preffered lifetime flag when adding an address by doing. ip addr add <address> dev preferred_lft <lifetime> you can also set it on an existing address ip addr change <address> dev preferred_lft <lifetime> Setting it to zero will immediately ...


2

Instead of reading hoption, rspid and rspname from stdin while the script is running, you should take them as options on the command line, just like most other programs do. This sounds difficult, but is actually quite easy using the bash-builtin getopts (see help getopts for a summary) That way you can easily test your script with the same args just by ...


1

Your fonts and colors would be determined by the type of terminal emulator and where it is run. Some people do something like ssh -X remotehost -e xterm and some do this ssh (running in a terminal on the local host). Technically the local X display determines the maximum number of colors which you can use (in either case), but most users have ...


1

Maybe your SSD does not support this queue depth? # hdparm -I /dev/sda /dev/sda: ATA device, with non-removable media Model Number: M4-CT064M4SSD2 [...] Capabilities: LBA, IORDY(can be disabled) Queue depth: 32 Alternatively, try with 1, 2, 3, ... to find the maximum queue depth the kernel will allow you to ...


1

You can try using this command, which is distribution-independent: ldconfig -p This gives a full list of the libraries installed. If you pipe it to less, you will be able to scroll up or down: ldconfig -p | less


0

Maybe because Windows shows file sizes in kbs, mbs, gbs, ... While linux shows them in kibs, mibs, gibs...? One kb is 1000 bytes, while one kib is 1024 bytes, and one mib 1024 kibs. Other possible reason is probably metadata. I am not sure however, because both of those reasons would suggest smaller file sizes in linux than in windows. Of course the ...


0

In the first case you have to quote the vertical bar (|), since inside lftp it is a special symbol too (also use double quotes to interpolate src and dest variables, quote backslash and dollar sign to prevent their interpretation by the shell): /usr/local/bin/lftp -u user,pass -e "mirror -x '^(\\.mp4|\\.swf)\$' $src $dest" ftp.host In the second case you ...


1

Add a debug line of echo ${hoption} after it reads it in to confirm it is being set correctly. Also put an echo in each case indicating you've reached that case. In this case since you are only looking for a single character, I would use read in this way: read -r -n 1 hoption The -n 1 flag tells read to only wait for 1 character and not wait for a new ...


2

@Julie Pelletier's answer is 100% correct, but probably not very understandable to you. First, as mentioned several times in the comments, the mark is not put into the ethernet packet on the wire. So if you ping server B from server A, server B will not ever be able to detect the mark. If you want to do anything, you'll have to use server A alone. So, ...


0

I also faced this problem while inserting module into the kernel. Enter your current kernel version correctly go to cd /lib/modules/your-kernel-version-gereric/ directory and check whether build directory is present or not. If present then you can directly compile your module using below command make -C /lib/modules/$(shell uname -r)/build M=$(PWD)


5

That mark is internal and not included anywhere in the packet or any of its headers. That means it gets lost when doing the actual outbound connection, and wouldn't be visible in the INPUT table of the target server, but you would see it in the OUTPUT table of the initiating machine. The point of supporting a mark in ping is to allow outbound routing ...


1

A user can access any directory they create, so unless you're going to give the user a home directory without write access, they will be able to create a public_html directory and access it. If you are using the userdir apache module, you can use a custom name or set up the Apache configuration to have a Require all denied directive for locations in that ...


0

If you need to do it non-interactively, you might be able to use make oldconfig or make olddefconfig. make *config will fix the dependencies and those aren't as verbose as, say menuconfig. (Otherwise menuconfig is perfectly fine for enabling features one by one, it even includes the help texts!) make oldconfig will ask for any 'new' configuration options, ...


0

In RHEL6 and RHEL7, see the init file, /etc/rc.d/rc.local: #!/bin/sh # # This script will be executed *after* all the other init scripts. # Your can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local Even though RHEL7 replaced System V with systemd, the same file can be used. ...


0

/etc/profile.d is a vendor-specific means of customizing the environment of a shell session (setting PATH and so forth), and would not typically be related to the startup of a daemon; some would even argue that daemon startup should in no way involve /etc/profile.d, so that user shell customizations cannot cause a daemon to fail to load, or to load with ...


0

See the first comment above : # yum install yum-security And https://access.redhat.com/solutions/10021 I.e. yum-security and yum-plugin-security are the required yum-files / plugins required when running yum commands concerning security updates.


0

I've finally found how to do that. It's a bit hackish thought, but it works. I've used some part of this thread : http://stackoverflow.com/questions/25166085/how-can-a-systemd-controlled-service-distinguish-between-shutdown-and-reboot and this thread : How to run a script with systemd right before shutdown? I've created this service ...


2

Docker's website states that it can be installed on any 64 bit distribution of RHEL. However, the kernel must be 3.10 at a minimum. Check your kernel version first with the following command: uname -r.


0

Alex answers your question. Compare lspci 00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 02) 00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02) 00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06) 00:19.0 Ethernet ...


0

cat FILENAME | grep -v ".trg" > filename


2

According to the systemd.special man-page, you should use Before=poweroff.target. poweroff.target A special target unit for shutting down and powering off the system. Applications wanting to power off the system should start this unit. runlevel0.target is an alias for this target unit, for compatibility with SysV. Additionally, as I mentioned in my ...


2

The detail which you are extracting from /proc/self/status is found in /proc/self/comm (without scripting). For the intended question: to determine which processes are interpreted and which are native, you cannot do this without knowing which processes are intended to be interpreters. After all, any process can rename itself via an exec call, using ...


0

It appears processes get Names in </proc/self/status |grep '^Name' and the name appears to be the basename of the real zeroth argument. (I'll keep the question here in case someone provides a better answer).


2

Android and Linux are two different operating systems. You can't just take an executable from one and run it on the other. The first hurdle is the kernel. Android and Linux are based on the same kernel, but they have a few different features. In particular, Android provides binders, which only exist in the mainstream kernel (the one found in Linux ...


1

Linux does support wifi adapters. We can't foresee the future but most adapters should work fine. Why don't you install it and address specific issues as they arise, if they do.


2

The only things special you should need for building Raspberry Pi with graphics support, compared to other ARMs currently: linux-next kernel (to get the devicetree for vc4, until 4.7 is released) rasperrypi/firmware on a vfat partition However, building everything from scratch will be an exercise in frustration, and I would recommend starting from an ...


2

I know you've already solved your problem, but FYI you could have solved it with a very simple modification to your code : by inverting the sequence you loop over. Using {107..27..-1} (or more concisely {107..27}) would have been enough to solve your problem, since when replacing 30, only the original 30 would have been found, the 27 having not been ...


0

You can always combine find and grep, find to filter on meta-data and grep to search content. An example: find ./ -mtime -1 -type f -exec grep "test" {} + This would select any file (-type f filters only files) in the current directory (./ indicated the current directory) modified in the last day (-mtime -1 means modified is between now and -1 day) ...


1

It is not clear if you search for page in/out caused by paging or by swapping. The difference is explained at several places here (http://superuser.com/questions/785447). The number of pages swapped and paged from /proc/vmstat. Pages paged in / out $ cat /proc/vmstat|grep pgpg pgpgin 6920262 pgpgout 345654122 Pages swapped in / out $ cat ...


0

A completely free search tool with in-file search is Lookeen Free. Addition: I work for the vendor of Lookeen Free.


0

Ok, I think i've got a solution for the double index as well modifying the command of cas. This makes the job: perl -p -e 's/\[(\d+)\]\[(\d+)\]/"[" . ($1) . "][" . ($2+40) . "]"/ge' prova.txt Not sure by the way why I need the . ($1) . (point with blank space).


2

They are on the two keys to the right of P: pressing the first with Alt Gr produces "«", the second produces "»".


4

You could also use awk: awk -F '[\\[\\]]' '{if ($2) { sub($2, $2 + 3)}} 1' prova.txt In fact, this can be slightly shortened to: awk -F '[\\[\\]]' '$2 { sub($2, $2 + 3)} 1' prova.txt


3

perl -p -e 's/\[(\d+)\]/"[" . ($1+3) . "]"/ge' dad85.txt This perl one-liner replaces any positive integer number (\d+) inside square brackets with that number incremented by 3. It uses the e regexp modifer to make perl evaluate the replace portion of the s/// operation as an expression. Output: (freqBiasL2[30]) (SatBiasL1[30]) (defSatBiasL2_L1[30]) ...


7

Use perl: perl -pe 's/(?<=\[)(\d+)(?=\])/$1+1/ge' prova.txt Explanation: -p means loop over every line and print the result after every line -e defines the expression to execute on every line s/from/to/ does a simple substition s/(\d+)/$1+1/ge matches one or more digits, captures it into $1, and then the e modifier on the end tells perl that the ...


1

The below rule will allow only your IP and Block all other IPs over port 22 or ssh. iptables -I INPUT -p tcp -s ! yourIPaddress --dport 22 -j DROP


2

Try: cp /usr/share/backgrounds/*.jpg /week/pictures/final/jpg/ 2> cp.err Note that the cp.err file will be created in the directory where you are when you run the command. If you want the error file in a differente directory, you can do: cp /usr/share/backgrounds/*.jpg /week/pictures/final/jpg/ 2> /desired_directory/cp.err


1

Try to use find command : find /usr/share/backgrounds -iname "*.jpg" -type f -exec /bin/cp {} /week/pictures/final/jpg 2>cp.err \;


-1

Try stali, a suckless Linux distribution following KISS principle.


4

You're looking in the wrong place, because this isn't really to do with the mount command itself. What you're doing is mounting a special filesystem, in this case, a cgroups hierarchy, and the options happen to be how you attach different cgroup subsystems like cpu or memory. Red Hat* has some good documentation on cgroups in general and the mount options ...


2

Subshells do have overhead. On my system, the minimal fork-exec cost (when you run a program from disk when the file ins't cold) is about 2ms and the minimal forking cost is about 1ms. With subshells, you're talking the forking cost alone, as no file needs to be execed. If the subshells are kept reasonable low, 1ms is quite negligible in human-facing ...


0

Doing a lot of research, I could not find any evidence of some PCI sound card that is supported by kernel 2.0. Also grepping for "pci" in drivers/sound does not yield any matches. I tried to find out if it could be possible to backport some driver from 2.2 but apparently the sound architecture has changed quite a bit, most if not all 2.2 sound drivers ...


0

Just in case anyone else has this issue: I simply waited a bit longer instead of killing the program immediately, and it worked. Just ignore the scary messages.


2

This is a warning based on information provided by the kernel. Misalignment mostly has performance impacts; on SSDs it may result in additional wear. It won't cause corruption! Software RAID 10 + LVM on mixed drives, sector alignment? has lots of useful information on this, including recipes to set things up correctly.


0

Thomas Dickey's answer addresses the issue in general, for any (ELF) binary. Given the way your question's phrased, you might find the __DATE__ and __TIME__ predefined macros useful; they allow the compilation date and time to be referred to within a program (so a program knows its own compilation date and time). Here's a quick example: #include ...


0

stat -c %z displays last creation/updating time of file and it's not changeable or preservable. Hence if you copy the file to other place, it will always get new now creation time. What are you looking for is stat -c %y, to display last modification time, which is usually preserved by most tools dealing with files and directories.


0

You can copy preserving the modification time, e.g., cp --preserve=timestamps source destination or (more generally: mode, ownership and timestamps) cp -p source destination although in some cases, preserving ownership is not wanted. Similarly, you can copy to remote systems using scp's -p option: scp -p source remote:destination but scp does not ...


1

dd in your example does full system image backup, byte to byte mirroring /dev/sda to /dev/sdb. However you must be sure that /dev/sdb if equal or larger size disk. Modern systems do not permit plain copying like that because they embed some other unique identity information like UUIDs into volumes; there maybe issues with LVM setups, on-disk cryptography ...


0

Simply adding my sudo /Morreels/./launcher line to the .bashrc file in /home/pi folder ran everything and fixed it !


4

This is referring to the fact that Linux (like all Unix-style systems) exposes most of the resources it manages through objects which look like files: /dev-style devices, /proc and /sys entries... In the context of your quote, this property is mentioned because it allows access permissions to be reasoned about in a consistent fashion.



Top 50 recent answers are included