Tag Info

Hot answers tagged

15

fork() was the original UNIX system call. It can only be used to create new processes, not threads. Also, it is portable. In Linux, clone() is a new, versatile system call which can be used to create a new thread of execution. Depending on the options passed, the new thread of execution can adhere to the semantics of a UNIX process, a POSIX thread, ...


7

With write: write <user> Some text goes here CTRL-D (eof) Alternative: echo "Some text goes here" | write <user> See man write.


6

Try: cat /sys/class/net/eth0/speed I'm not sure what you mean by primary interface. On a host with an IPv4 stack, you could retrieve the interface where the first default route is with: ip route show 0/0 | grep -Pom1 'dev +\K[^ ]+' (assuming GNU grep). So: cat "/sys/class/net/$(ip route show 0/0 | grep -Pom1 'dev +\K[^ ]+')/speed" Not all IPv4 ...


5

Those are incomplete reads. It should go away if you add iflag=fullblock. By default, dd will happily accept smaller blocks from a pipe, if there isn't more data readily available. With the iflag, dd will wait until a full block of data has been gathered, or EOF. In regards to data consistency there should be no issue, so you should be getting correct ...


4

It appears that there's two clone() things floating around in Linux 2.6 There's a system call: int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ... /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ ); This is the "clone()" described by doing man 2 clone. If you read that man page close enough, you will see ...


4

You can use awk and its string comparison operator. ls | awk '$0 < "3_20150415"' In a variable: max=3_20150414 export max ls | LC_ALL=C awk '$0 <= ENVIRON["max"] "z"' concatenating with "z" here makes sure that the comparison is a string comparison, and allows any time on that day since in the C locale, digits sort before z.


4

I believe there is a confusion of terms at work here. In fact, both the IP layer and the link layer work together to make multicasting work. For both IPv4 and IPv6, multicast IP addresses are mapped to link-layer multicast MAC addresses. There are dedicated, multicast-only MAC addresses. For IPv4, the MAC address has the form 01:00:5e:xx:yy:zz and for IPv6 ...


3

The answer is "Other". You can get a glimpse of the memory layout with cat /proc/self/maps. On my 64-bit Arch laptop:: 00400000-0040c000 r-xp 00000000 08:02 1186758 /usr/bin/cat 0060b000-0060c000 r--p 0000b000 08:02 1186758 /usr/bin/cat 0060c000-0060d000 rw-p 0000c000 08:02 1186758 ...


3

You could maybe use radicale, though I only use it daily for my agenda. Edit : about security : the documentation states that the authentification modules were not extensively tested, and that you should rely on a proper http server if it is a concern to you. I my case I nailed the problem by restricting access to the port on the router, which makes the ...


3

The process of going from ext2 to ext4 is similar to your linked article for 3->4. You need to enable the features using tune2fs. The difference between going from 3->4 and 2->4 is that you also need to enable the journal feature. The complete command is this: tune2fs -O extents,uninit_bg,dir_index,has_journal /dev/sdxx You should fsck the filesystem ...


3

1) Desktop has a set of utilities tied to it, e.g., in kde you have kate as text editor, while in unity it's gedit. Theme only alters look of windows or icons 2) Distro comes with default desktop but is not limited to default one. I use Ubuntu, but I've been using openbox, blackbox, gnome, kde(which is default in kubuntu), lxde, and motif, interchangeably. ...


2

You can see the UUIDs for the various different components (physical disk, RAID, etc.) by running blkid Here is a sample from one of my systems: /dev/sda3: UUID="NAzDnw-zu08-iSt9-v76l-njNc-NElx-8RFzVg" TYPE="LVM2_member" /dev/sdc3: UUID="215b625b-8531-26ed-c610-01f443697250" UUID_SUB="087e72db-ff75-bcbe-5b41-8f79a6bb54f5" LABEL="server:3" ...


2

The UUID you use in the /etc/fstab is for identifying the filesystem on the raid (it was created when you formatted your raid). The UUID you see in the /etc/mdadm.conf is on every device (disc/partition) that is part of a particular raid to identify it, for mdadm that these devices belong to a particular raid. That UUID is created when the RAID is created, ...


2

I like virt-what, which encapsulates a lot of this in an easy interface: # virt-what # VMware vmware # virt-what # KVM/Qemu (libvirt) kvm # virt-what # A real physical server # virt-what # VirtualBox virtualbox


2

If you're logging into a Virtual Machine, some of the hardware listed should be related to that Virtual Machine. Using a command like dmidecode | grep VMware should let you see if you're logged into a VM from VMware. If you're not sure about what VM are you looking for, you could use just dmidecode | head -n 40 just to take a look at the system ...


2

The pam_env man page says: RETURN VALUES PAM_ABORT Not all relevant data or options could be gotten. PAM_BUF_ERR Memory buffer error. PAM_IGNORE No pam_env.conf and environment file was found. PAM_SUCCESS Environment variables were set. Additionally, if your system has been corrupted badly, pam_env.so itself ...


2

smbpasswd can do several things, and one of its main purpose is to let an user change his password (even he's working on a remote client machine). For instance, on a workstation, a client can type this to change his password: smbpasswd -r pdc.mydomain.com -r needs the PDC DNS name, and one may also use -U in case the SMB login name is different from the ...


2

It's correct in principle but you might consider reducing it to a single parted call. parted --script /device \ mklabel gpt \ mkpart primary 1MiB 100MiB \ mkpart primary 100MiB 200MiB \ ... Your alignment issue is probably because you use MB instead of MiB. You should not need an actual align-check command when creating partitions on MiB ...


2

I'm assuming we're discussing "regular" files, not device files or unix-domain sockets or something not-so-regular like that. I would say that files have names, metadata, and data. This corresponds directly to filenames, inodes and blocks. I believe that your two, hard-linked filenames are just two names for a single file. I don't believe that under Unix ...


2

Filenames are used to lookup inodes. Nothing else. Inodes are the main point to reference a file. Afile may not have any data blocks at all if it is zero size or if it is small enough to fit in the blocklist portion of the inode and the filesystem has that optimization. if there are two hard links pointing at one inode it is still one file, it just has more ...


2

If the given file is called /path/to/file and you want to find all hard links to it that exist under the current directory, then use: find . -samefile /path/to/file The above was tested on GNU find. Although -samefile is not POSIX, it is also supported by Mac OSX find and FreeBSD find. Documentation From GNU man find: -samefile name ...


1

There is standard package, named gettext for RHEL. Install it. As you need to compile something with gettext support you need to install dev packages to gettext yum install gettext-devel


1

/etc/hosts is meant as a first-step for DNS resolution. If you're trying to reach a host that's present there, it will use that record instead of querying DNS. As you've discovered, /etc/hostname is one option for hostname changes in Debian. In RHEL6, it's /etc/sysconfig/network, and in RHEL7 it's either the hostnamectl command or /etc/hostname. Changing ...


1

That file is contained in the fail2ban package as reported in the list of files or by running: # apt-file list fail2ban or # apt-file search jail.conf If it's not there, you can try reinstalling the package: # aptitude reinstall fail2ban or # apt-get install --reinstall fail2ban


1

There are several ways, but I think the easiest is to install the NoSquint Extention, which lets you set a default zoom level (for text and overall separately, if needed), and also makes it easy to adjust on a site-by-site basis.


1

Yes. This is easy. Install the system with the GUI libraries for X (drivers optional) and for the desktop environment you want. Then, run something like the TigerVNC server, and you're done.


1

When a file compiled with -pie (Position Independent Executable) such as : gcc -pie -fPIC hello.c Then you have : #file ./a.out a.out: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x2afb7892000a1dc5b9010c591b75987188aa2d66, stripped If you need more information , You ...


1

I am going to disagree with jordanm on two points. Enabling the journal is a little more complicated than he presents, but there is a plethora of discussions and tutorials available. The actions needed to convert an ext2 filesystem to ext3 or ext4 are as follows: do nothing. ext4 is a proper superset of ext3 which is a proper superset of ext2, there all ...


1

This is a regression in kernel 4.0, causing conversion filters in balance to have no effect; it looks like all conversions are affected (not just single->raid1 or raid1->raid5). See a recent mailing list thread, where there's currently no official fix. If you're up to patching your kernel, there's an easy patch to apply as a temporary fix. This is a ...


1

Noticed in my sshd_config: X11Forwarding no Changed it to yes and it works now.



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