Tag Info

Hot answers tagged

128

As far as I know, the only condition under which sl shows the current directory is when you mistype it as ls.


65

That's probably because your /etc/sudoers file (or any file it includes) has: Defaults requiretty ...which makes sudo require a TTY. Red Hat systems (RHEL, Fedora...) have been known to require a TTY in default sudoers file. That provides no real security benefit and can be safely removed. Red Hat have acknowledged the problem and it will be removed in ...


50

Looking at the RFC for TCP: RFC 793 - Transmission Control Protocol, the answer would seem to be no because of the fact that a TCP header is limited to 16-bits for the source/destination port field.      Does IPv6 improve things? No. Even though IPv6 will give us a much larger IP address space, 32-bit vs. 128-bits, it makes no attempt ...


48

I'll answer your questions in three parts: file types, permissions, and use cases for the various forms of chmod. File types The first character in ls -l output represents the file type; d means it's a directory. It can't be set or unset, it depends on how the file was created. You can find the complete list of file types in the ls documentation; those ...


42

This is all due to the fact that the X server is out-dated, ill-suitable for today's graphics hardware and basically all the direct video card communication is done as an extension ("patch") over the ancient bloated core. The X server provides no builtin means of synchronization between user rendering the window and the screen displaying a window, so the ...


37

A couple of things come to mind: Recover from a kernel panic A kernel panic, by definition, cannot be recovered from without restarting the kernel. Recover from hangs which leave you without terminal access If the system is unresponsive and you're stranded without a way to issue commands to recover, the only thing you might be able to do is to reboot. ...


36

It can. There are 2 different out of memory conditions you can encounter in linux. Which you encounter depends on the value of sysctl vm.overcommit_memory (/proc/sys/vm/overcommit_memory) Introduction: The kernel can perform what is called 'memory overcommit'. This is when the kernel allocates programs more memory than is really present in the system. This ...


33

You should use the at command: $ sudo at 6:45 [sudo] password for root: warning: commands will be executed using /bin/sh at> poweroff at> <EOT> Don't type the <EOT>, but press Ctrl+D at the second at> prompt. The significant advantage of using at over using shutdown with a TIME argument, is that it involves real, persistent, ...


32

These /dev nodes appear because the standard PC serial port driver is compiled into the kernel you're using, and it is finding UARTs. That causes /sys/devices/platform/serial8250 (or something compatible) to appear, so udev creates the corresponding /dev nodes. These UARTs are most likely one of the many features of your motherboard's chipset. Serial UARTs ...


29

Yes! This is a big deal, and incredibly common. And there are two basic approaches. One way is simply with scripted installs, as for example used in Fedora, RHEL, or CentOS's kickstart. Check this out in the Fedora install guide: Kickstart Installations. For your simple case, this may be sufficient. (Take this as an example; there are similar systems for ...


28

Lemma: sl prints a steam locomotive Lemma: Valid file names cannot contain forward slashes (although paths can) Lemma: The steam locomotive contains forward slashes: $ touch ' ( ) (@@) ( ) (@) () @@ O @ O @ O > (@@@) > ( ) > (@@@@) > > ...


27

Here's a patch to fix that bug :) diff --git a/sl.c b/sl.c index 2eeceb3..f2213ad 100644 --- a/sl.c +++ b/sl.c @@ -37,6 +37,7 @@ #include <curses.h> #include <signal.h> #include <unistd.h> +#include <stdlib.h> #include "sl.h" int ACCIDENT = 0; @@ -71,6 +72,13 @@ void option(char *str) int main(int argc, char *argv[]) { ...


23

You can check the source code here - https://github.com/mtoyoda/sl, alas there is no other options other than the ones documented and sadly nothing that will actually print the names of files. So it looks like @sfyn's answer is the correct one.


23

No matter the fancy name used here, both are solutions to a specific problem: A better segregation solution than classic Unix chroot. Operating system-level virtualization, containers, zones, or even "chroot with steriods" are names or commercial titles that defines the same concept of userspace separation, but with different features. Chroot was introduced ...


22

To get this information from sysfs for a device file, first determine the major/minor number by looking at the output of ls -l, eg $ ls -l /dev/sda brw-rw---- 1 root disk 8, 0 Apr 17 12:26 /dev/sda The 8, 0 tells us that major number is 8 and the minor is 0. The b at the start of the listing also tells us that it is a block device. Other devices may ...


21

Use rsync(1): rsync \ --remove-source-files \ --chown=unicorn:unicorn \ /home/poney/folderfulloffiles /home/unicorn/


21

SCSI is not only a type of hardware interface, but also a command protocol, which is used for abstraction of most of the modern storage devices. Linux scsi driver is a high level driver that handles a variety of storage hardware. Protocol: http://en.wikipedia.org/wiki/SCSI_command Extract from SCSI on wikipedia: Other technologies which use the SCSI ...


20

uptime If you want it in numerical form, it's the first number in /proc/uptime (in seconds), so the time of the last reboot is date -d "$(</proc/uptime awk '{print $1}') seconds ago" The uptime includes the time spent in a low-power state (standby, suspension or hibernation).


20

The 1 GiB limit for Linux kernel memory in a 32-bit system is a consequence of 32-bit addressing, and it's a pretty stiff limit. It's not impossible to change, but it's there for a very good reason; changing it has consequences. Let's take the wayback machine to the early 1990s, when Linux was being created. Back in those days, we'd have arguments about ...


20

I checked uname manual (man uname) and it says the following for the "-a" option: print all information, in the following order, except omit -p and -i if unknown In Ubuntu, I guess, options "-m", "-p" and "-i" (machine, processor and hardware-platform) are returning the machine architecture. For example, if you use the command uname -mpi You will ...


19

The command is: sudo updatedb See man updatedb for more details.


19

If you have ruled out any "external" factors, the following set of steps usually helps to narrow it down. So while this doesn't directly answer your question, it may help tracking down the error cause. Troubleshooting sshd What I find generally very useful in any such cases is to start sshd without letting it daemonize. The problem in my case was that ...


19

This is very easy to accomplish: #!/bin/sh [ "$(whoami)" != "root" ] && exec sudo -- "$0" "$@" When the current user isn't root, re-exec the script through sudo. Note that I am using sudo here instead of su. This is because it allows you to preserve arguments. If you use su, your command would have to be su -c "$0 $@" which would mangle your ...


19

You can use shutdown: sudo shutdown -h 06:45 & And to check it: ps -aux | grep shutdown If you want to cancel it: sudo shutdown -c This assumes of course that the shutdown time has already passed.


18

ARM is huge for linux. Aside from the Rasberry Pi and other hobbyist ARM SoC you have every Android phone and tablet and many of the Chromebooks running Linux on ARM. I couldn't find any hard numbers on total devices in use, but total android activations number somewhere north of 1 billion. The Chromebooks are Amazon's best selling laptops, though not ...


18

There is no guarantee that the groupname = username will exist. The most common scenario is that system administrators use on Linux is creating a new user locally on the system is without an explicit specification for the group, which means that the group will be created by default same as the user name and assign the user to have the default GID to be of ...


18

Consider this scenario: You have 4GB of memory free. A faulty process allocates 3.999GB. You open a task manager to kill the runaway process. The task manager allocates 0.002GB. If the process that got killed was the last process to request memory, your task manager would get killed. Or: You have 4GB of memory free. A faulty process allocates 3.999GB. ...


18

Yes and no. *nix has a huge advantage over Windows in package management. Unlike in Windows where you must rely on third-party packages to have sane (un)installers, *nix distributions offer package managers that take care of installation and uninstallation in a unified manner. As a result, when you remove a package, all the system-level files for that ...


18

Answer to my question, from Qualys: During our testing, we developed a proof-of-concept in which we send a specially created e-mail to a mail server and can get a remote shell to the Linux machine. This bypasses all existing protections (like ASLR, PIE and NX) on both 32-bit and 64-bit systems. My compiled research below for anyone else ...


18

You can do it with single command with sed 's/\(.*\)-/\1 /' The point is that sed is very greedy, so matches as many characters before - as possible, including other -. $ echo 'swp-RedHat-Linux-OS-5.5.0.0-03' | sed 's/\(.*\)-/\1 /' swp-RedHat-Linux-OS-5.5.0.0 03



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