Hot answers tagged

14

The word boundary has a similar effect to -w, but can be used as part of the expression. ‘\b’ Match the empty string at the edge of a word. [...] ‘\<’ Match the empty string at the beginning of word. ‘\>’ Match the empty string at the end of word. To match bar only when it's the whole word, but foo anywhere (including inside ...


5

If I code a application that has an X11 window, will it look and operate the same across linux os's Yes, but not really for the reason you might think. X11 is very low level, and concerns itself basically with drawing graphics primitives and providing a reasonably standardized (note that this does not mean sane; X11 can be called many things, but I ...


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 ...


3

If kernel was compiled with CONFIG_IKCONFIG_PROC, you will have the original .config in /proc/config.gz So in that case to see the full options: zcat /proc/config.gz Checking in my Armbian/Jessie with kernel 4.5.2 and BTRFS: $zgrep -i btrfs /proc/config.gz CONFIG_BTRFS_FS=y CONFIG_BTRFS_FS_POSIX_ACL=y # CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set # ...


3

/root/ is root's home directory. The permissions on /root/ are hopefully 700, preventing anyone but root from traversing the entire directory tree below it. You're being prevented from running the binary as a non-root user by permissions further up the directory tree. Installing anything into /root/ is unusual, you would normally install executable code ...


3

There is no consistency in naming the use of option, argument and flags and there is no enforcing authority within the software development world to enforce usage. This happens for all wording: after 30+ years of using the word directory, I now have to deal with people using the world folder, having been confused with Microsofts new-speak. Things you put on ...


3

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 ...


2

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 ...


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.


2

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, ...


2

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 ...


2

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 ...


2

The problem is probably that su - will clear all the environment variables except TERM, so you will lose the DISPLAY setting. Try setting DISPLAY=localhost:10.0 (for example) before the gedit.


2

I'm assuming you're referring to the 11-minute clock updates in Linux. If you want to keep ntpd running without updating the hardware clock, it appears the only viable option is to rebuild your kernel without the RTC_SYSTOHC option: Set the RTC time based on NTP synchronization If you say yes here, the system time (wall clock) will be stored ...


2

A flag is a type of option, an option of boolean type, and is always false by default (e.g. --verbose, --quiet, --all, --long, etc). An option tells the function how to act (e.g. -a, -l, --verbose, --output , -name , -c , etc), whist an arguments tells the function what to act on/from (e.g. *, file1, hostname, database).


2

Use chown's recursive option: chown -R owner:group * .* Specifying both * and .* will match all the files and directories that find would. The recommended separator nowadays is : instead of .. If you want to change the current directory's ownership too, this can be simplified to chown -R owner:group .


2

If you're running systemd (most Linux distributions released in the last couple of years do), then the absence of systemctl suggests that you've seriously broken your system. In that case nobody can say for sure (given the information in the question) whether your system will even come back up after a reboot. If you're not running systemd (because you ...


2

df reads /etc/mtab to find what device is mounted on a particular mount point. This can either be a file which is updated by the mount command, or a symbolic link to /proc/mounts which contains current information provided by the kernel. /etc/mtab has the advantage that it can provide more precise information: it's what was passed to mount, not some ...


2

Just to make things difficult, Linux has more than one library for working with certificates. If you're using Mozilla's NSS, you can Actively Distrust (their terminology) a certificate using certutil's -t trustargs option: $ certutil -d <path to directory containing database> -M -t p -n "Blue Coat Public Services Intermediate CA" For Firefox, ...


2

Try this command: service netifd restart Concerning your question: yes, rebooting your computer will have the effect of restarting all the services that are set to run at boot, but it's quite a brutal way to go if you just need to restart one service. Much better to find a solution for the latter.


2

With GNU tools: find file -prune -printf '%TY%Tm%Td%TH%TM%TS\n' Or date -r file +%Y%m%d%H%M%S.%N If your ksh is ksh93 and it has been built with the date builtin enabled: command /opt/ast/bin/date -m -f %Y%m%d%H%M%S.%N file (command /opt/ast/bin/date invokes the date builtin bound to /opt/ast/bin/date, if you add /opt/ast/bin at the front of $PATH, ...


2

awk solution. awk '{if(NR>1){$1="";sub(" ","")}}1'


1

You tftp server setting can be viewed in /etc/xinetd.d/tftp. server_args = -s /tftproot # tftproot is where your tftp base directory. Say you tftp server is hostx From hosty, try this command tftp hostx > tftp get file # file is any file under this /tftproot directory. > tftp quit ls -l file


1

You can use arp-scan: $ arp-scan --interface=eth0 192.168.0.0/24 or nmap: $ nmap -sP 192.168.0.0/24 to scan all addresses on a network for a response. The problem is: do you assume that every computer your Pi connects to is on the 192.168.0.0/24 network, as the examples above show, or not? If you do, then a scan won't take long - 3.56 seconds with ...


1

I don't want to put my foot in my mouth, but I don't think what you are trying to do is possible with any random machine you will connect this Pi to. Think about it. The problem is two fold. At boot time your R-Pi has a fixed address. Right ? If the machine you are connecting to is not configured with that IP address/subnet mask, how are the two going to ...


1

As thrig pointed out, all that's needed is to create the directory structure that you want under /etc/skel. Quoting from the useradd man page -k, --skel SKEL_DIR The skeleton directory, which contains files and directories to be copied in the user's home directory, when the home directory is created by useradd. This option is only valid if the -m ...


1

You can touch a hidden file, eg.filename, after formatting the filesystem and use the unless parameter of exec, cat .filename in your unless parameter. If the file exists, the exec won't run. Explained here. Something like this : exec { "/sbin/mkfs.ext4 /dev/sdxx && mount /dev/sdxx /mnt/sdxx && touch /mnt/sdxx/.filename": ...


1

Haven't tested this myself but this is how I have understood it to be possible. Live boot to server and mount big enough external hard drive where you can store image. Image server's hard drive: dd if=/dev/sdX bs=4k conv=noerror,sync of=/mount_point_of_extHDD/serverIMG.dd Then let's zero out unused blocks: file /path/to/serverIMG.dd Check startsector ...



Only top voted, non community-wiki answers of a minimum length are eligible