Hot answers tagged

5

apt-get install whois Requires a network connection that can see the kali repo at http://http.kali.org/


5

Logfiles are plain text files, and each line is appended at the end. So there is no loss of data when using non-UTC timezone. Of course, you may view the files using a tool which can get confused. However, the usual reason for using UTC is to avoid ambiguity: you do not have to know what the local timezone is to interpret the data. So yes, using UTC in ...


5

When troubleshooting problems with daemons, you should always check the system logs. In this particular case, if you check your system logs on the NAS host, you'll see something similar to: Authentication refused: bad ownership or modes for directory /home/admin The problem is shown in this output: admin@NAS:~$ ls -alh drwxrwxrwx 6 admin users 4.0K Jun ...


4

This proves yet again that if you run random scripts off the Internet, you lose. Who wrote that tutorial? More importantly, who wrote this "iRedMail" thing? (never heard of it). Did you review the script, so that you're sure it didn't do anything else wrong? In the best case, that script (I didn't review it) simply has a bug which caused it to set ...


4

The MBR partition format is three decades old, and subject to weirdness for historical reasons. Back then, the computer needed to know the geometry of the hard disk. How is data organized on a hard disk? In three dimensions: cylinder, heads and sectors. (Diagram by LionKimbro) The geometry was stored with maximum values that were large enough for the ...


4

When you write the command line parsing bit of your code, you specify what options take arguments and which ones do not. For example, in a shell script accepting an -h option (for help for example) and an -a option that should take an argument, you do opt_h=0 # default value opt_a="" while getopts 'a:h' opt; do case $opt in h) opt_h=1 ;; ...


3

ss uses the AF_NETLINK socket layer to talk to the kernel. This is a lower level protocol but allows for data to be transferred very quickly and in large chunks. A quick strace on CentOS 7 shows it sets the transfer window to be 1Mb.


3

The ADD command needs the filename to be relative to the current directory. See https://docs.docker.com/engine/reference/builder/ The path must be inside the context of the build; you cannot ADD ../something /something, because the first step of a docker build is to send the context directory (and subdirectories) to the docker daemon. This means you ...


3

The wc (word-count) utility is able to count lines in a file: $ wc -l num.txt ... or rather, it counts the number of newlines in the file, which most of the time is the same thing (actually, on a Unix system, that is defined as the same thing). The manual (on Mac OS X) states: "Characters beyond the final <newline> character will not be ...


3

There's no way to tell for sure whether a file has been renamed. When a file is renamed, its inode number doesn't change. (This may not be true for “exotic” filesystems, such as network filesystems, but it's true for all “native” Unix filesystems.) However the converse is not true: if a file is deleted, a new file may be created with the same inode number. ...


3

Try running watch netstat -i while traffic is flowing. The active interface will have increasing counters. The command netstat -rn may give you some more information. I would expect traffic to flow on the interface with the lowest irtt value.


3

To number lines, you may use nl. To remove columns (or rather filter out the ones you want to keep), you may use cut: $ cut -f 2- cols.txt | nl 1 0 chr1 3000575 3000801 0 chr1 4340023 4340249 32 32 2 0 chr1 3000641 3000801 -1 chr1 3311943 3311783 32 32 3 0 chr1 3000674 3000801 -1 ...


3

With awk $ awk '{$1=FNR-1; print}' OFS='\t' file 0 0 chr1 3000575 3000801 0 chr1 4340023 4340249 32 32 1 0 chr1 3000641 3000801 -1 chr1 3311943 3311783 32 32 2 0 chr1 3000674 3000801 -1 chr1 3001534 3001407 32 32 3 0 chr1 3000674 3000801 -1 chr1 3001534 3001407 32 32 4 0 chr1 3000674 3000801 -1 chr1 ...


2

Short: no Long: a pseudo-terminal slave connection is one end of a connection, like a pipe. Both are ways that data is passed back and forth between user processes through the kernel. Once one end is closed, you lose the connection. The ptsname description in POSIX says: Upon failure, ptsname() shall return a null pointer. This could occur if fildes ...


2

I don't think Rob's answer is right. Those mails are apparently sent by the software that you installed. You need to fix the installation. Sadly, you don't provide enough information to pinpoint the problem exactly, especially information about the failed installation of that anti-spam plugin.


2

You can use a parallel shell such as clustershell or pdsh. This way, assuming you already set up a passwordless SSH authentication from a central machine, you can run a command on each of the 100 servers at the same time. You can also go further and do various groups in order to organize them logically. Lets assume your machines are named aws0, aws1, aws2, ...


2

Your shell is likely not bash. Change it with chsh. Also, there's a problem with part of the $PS1 value: PS1=" \w \u\[$(tput sgr0)\]" The $(...) will be evaluated when you set PS1, but just that one time. If you would like to execute tput sgr0 every time the prompt displays, use single quotes: PS1='\w \u\[$(tput sgr0)\] \$ ' (I have also moved the ...


2

A lot depends on what the supplied ppd for the printer proposes. List the options, and their current settings shown by an asterisk next to that option. The options and values are entirely arbitrary, but fairly conventional so you might see eg: $ lpoptions -l PageSize/Media Size: Photo4x6tab A6 8x10 Legal Letter EnvDL ... InputSlot/Media Source: *Auto Main ....


2

Unix (and Linux) has the concept of real user and effective user. A setuid program such as /usr/bin/passwd will set the effective user to the owner of the file; in this case it sets the effective user to root. Now what a program does with these elevated permissions is up to the program itself. In the case of the passwd program, if you pass a username then ...


2

The strings aren't actually ANSI sequences. Rather, they started as ANSI sequences, but are translated (due to some scripting error) on your remote machine so that most of the characters are converted to a different form. An ANSI sequence for instance would have escape[A possibly with an optional ; before the A, but the problematic output shows a 133 ([ ...


2

ip route will show you where your system is sending packets. man ip-route will start you on a path to controlling where the packets go.


2

Logfiles do not "handle" time zones, they just record what some application or service wrote there. So if an application writes "just the messages" and "directly to the log file", you're out of luck. Some syslog servers (like syslog-ng) allow you to "decorate" the "raw" log data by time stamps, where you can choose to use UTC or local time with or without ...


2

If you create a "logical" partition then the tool will automatically create an extended partition for it and this will be reflected in the screen display after you create the logical partition. This won't work if you've already created 4 primary partitions because the extended partition needs one of those slots, but as long as you've only created 1->3 ...


2

It shows ? since there is no TTY (terminal interface) to which this process is attached. This is fortunate since sshd is a system daemon and should not be dependent on a client session. As mentioned in the comments, closing a session will terminate all related processes for that TTY, which is not desired for system wide processes.


1

The passwd binary is suid because it needs root permission to modify the /etc/shadow file. It will not allow an unprivileged user to modify a different user's password. It will allow root to modify any user's password, but that is not why it is suid.


1

Apparently, Puppy Linux does not require sudo because "Puppy Linux typically is a single user OS. The single user is run as the root account with full privileges." So execute the command without sudo. However, you might require that if you are using fido (read the page pointed above).


1

Building on Rahul’s answer: $ ls -ltr | grep -v '^d' | awk 'NR==2 {print $NF; exit}' | xargs -I '{}' mv -- '{}' ../complete/ Notes: You say you want to do something with “the oldest file”.  All the answers are assuming that you mean least recently modified.  If you mean least recently changed, say so; the answers will be slightly different.  If you mean ...


1

To copy the oldest file to ../complete: cp -v "$(find ../in -maxdepth 1 -type f -printf '%T@ %p\0' | sort -zn | \ sed -zn '1s/[0-9,\.]\+ //p')" ../complete To copy the all except the oldest to ../error: find ../in -maxdepth 1 -type f -printf '%T@ %p\0' | sort -zn | \ sed -zn '2,$s/[0-9,\.]\+ //p' | xargs -0 cp -vt ../error Explanation: find -...


1

Stop Those Irritating Dr. Web Antivirus Cron Update Emails on Plesk 11.5+ After recently updating our server, we started receiving some irritating cron emails from the DrWeb daemon. One every hour to be exact, that’s twenty-four every day, agh! Here is a simple way to turn it off. Log in as root to your server via SSH and open /etc/drweb/drweb32.ini. Search ...


1

I worked it out - our system used CloudLinux and the other user was operating under CageFS determined by running: /usr/sbin/cagefsctl --list-enabled Following the instructions at: https://www.ndchost.com/wiki/cloudlinux/how-to-add-commands-to-cagefs-users, I then added xvfb to the Cage: vi /etc/cagefs/conf.d/binutils.cfg Then added the lines: [custom] ...



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