Tag Info

New answers tagged

1

/sys is a special filesystem. You can't just create it and put files in it. It's like /proc, a fake filesystem provided by the kernel. Geting /sys working requires 2 things: In your kernel configuration, you need to have CONFIG_SYSFS=y. You need to mount it with mount -t sysfs none /sys (assuming you're running from an initramfs since you mention cpio). ...


0

You could always review it's source code for yourself, and you would see under no condition does it ever perform the actual ls command nor display directories. https://github.com/mtoyoda/sl The source is rather simple actually. Even if you are "not a coder" you should still be able to understand most of it. I believe the "bug" you posted above is really ...


2

An easy way to do this, if it meets your needs, would be to have a specific log file that gets rotated everyday. First you add to /etc/(r)syslog.conf, probably near the top in case there are any rules that discard something after logging it: *.* -/var/log/daily.log This will receive all messages; i.e., anything that's in any other log will be ...


0

I'm not 100% familiar with Airdrop but in looking at the Wikipedia page on the topic it essentially sounds like a file sharing (P2P) without having to have an access point in the mix. Basically 2 WiFi clients can share files among each other. To that end there are 2 options listed at the bottom of that same Wikipedia page. Shoutr Wi-Fi Direct The first ...


1

su executes your login shell as indicated in the login database. This is /root/zsh, which doesn't exist, so the command su fails. chsh only accepts changing the shell of a user who currently has a valid shell (listed in /etc/shells). Since /root/zsh is not accepted, chsh fails. The root user can change anyone's shell, but this test is made after the ...


0

Quote from http://superuser.com/questions/72226/linux-live-cd-for-distributed-computing-projects Dotsch/UX is one. Dotsch/UX - A USB/Diskless/Harddisk BOINC Ubuntu Linux Distribution The purpose is to make a Linux distribution for BOINC which easily installs and boot from a USB stick, hard disk and from diskless clients ...


0

You must skip the first line: awk 'BEGIN { FS=":" printf "%-10s %-35s %-55s\n", "RANK", "PERFORMER","SONG" print "=====================================================================\n"} FNR==1{next}{printf "%-10s %-35s %-55s\n", $1, $3, $2}' songs If you don't mind the order of output, try: $ awk -F':' 'FNR==1{next}{a[$5]+=1} END{for(i in a){print ...


4

The simplest method I know to list all of your interfaces is ifconfig -a EDIT If you're on a system where that has been made obsolete, you can use ip link show


9

The kernel lists them by name in /sys, both separately in (e.g.) the tree of PCI devices -- although finding them there if you don't know where they are to start with is not simple -- and together via symlinks in /sys/class/net. E.g.: > ls /sys/class/net em1 lo wlp6so Another example: > ls /sys/class/net lo p6s1 wlan0 If you are not sure which is ...


1

You try to achieve several things here: Connect to a host without user interaction Run some script and save its output To 1: It is best to generate an ssh key pair with ssh-keygen and store the public key on your host machine. Generate it without using a password, then ssh won't ask you for one on connection. Use client$ ssh -i <keyfile> to ...


1

The whole setup is too long to be described here, also there are multiple ways how you might want to configure it, so to provide an overview: You need to setup OpenVPN server. I would advice to do it on a VPS with external IP. Setup OpenVPN clients on other servers and android devices to connect to your OpenVPN server. You can find quick ...


1

First make sure the user that you are going to use to make the backups: can read all the 5 folders and their content is able to use ssh into the server with the LTO ( lets call that 'remote') without authentication into an acount named ltouser. If necessary setup such an account. can write to the tape after doing the ssh, assume the device name is ...


0

I have something similar setup and it works so you're configuration looks valid to me. I would suggest adding this line above the Match rule which will enable a bit more verbose messaging in your logs which might help you narrow focus on what the underlying issue is. Subsystem sftp internal-sftp -f AUTH -l INFO Be sure to restart sshd after the ...


0

mkdir /usr/src <--This directory may already exists cd usr/src wget https://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.27.7.tar.gz tar -xvf linux-2.6.27.7.tar.gz ln -s /usr/src/linux-2.6.27.7 /usr/src/linux cd /usr/src/linux tar -xvf <nameofdriverdownload>.tar.gz <--If all goes well, this should inject the driver you downloaded into the ...


0

There are a few commercial tools that could help you with this. Like @Not Now said, you could look at something that does log aggregation like Logstash or Splunk. You can also look at a purely metric based solution like Metrink.


2

lshw is an awesome tool to list the hardware found in your machine. You will have to install it first before running. $ yum install lshw $ apt-get install lshw Use yum or apt-get depending on the system you are using. Then to specifically list the storage hardware: # lshw -class storage *-storage description: SATA controller ...


13

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


2

Note that I0b0's answer is only a proof that sl will never display all and only the current directory listing. However, there are circumstances in which sl will display the current directory listing together with additional 'information'. For example, in an empty directory: $ touch ' ( ) (@@) ( ) (@) () @@ O @ O ...


1

You have to disable Secure Boot: Making UEFI Secure Boot work with open platforms "Secure boot" is a technology described by recent revisions of the UEFI specification; it offers the prospect of a hardware-verified, malware-free operating system bootstrap process that can improve the security of many system deployments. Linux and other open operating ...


4

You can use the udevadm tool to discover this. The command would be udevadm info -a -n /dev/sda, and then look at the DRIVER== parameters. # udevadm info -a -n /dev/sda | grep -oP 'DRIVERS?=="\K[^"]+' sd ahci This shows that there are actually 2 drivers involved in providing this device, sd and ahci. The first one, sd is directly responsible for the ...


0

If you alias it to ls, it'll print the current directory - in fact, once I stopped laughing at the steam engine locomotive, I added that to my list of aliases.


0

As others have said, I would probably do a reinstall if that happened to me. However, if I was trying to do a repair, I'd first start by copying the /lib directory from a live install into my system. If all of /lib was deleted, then nothing would work at first, not even the package manager(s), so such a step might be necessary. Then I'd go into my package ...


1

You can check file opened by apache with lsof command. i.e. sudo lsof -c apache2 -nP -i :80 will do this and also prints out processes using port number 80(http).


1

You're looking for bonding. This driver is intended for (surprise!) bonding individual links to one logical link. Several modes are supported, one of them is fail-over mode (you have one primary link, in your case wired ethernet, and several fail-over links, which take over when the primary link fails). What you'll need is CONFIG_BONDING enabled in the ...


0

You need a remote machine running ssh that you can connect to from the Pi. Enable AllowTCPForwarding on the remote machine then connect from the Pi and create a SOCKS proxy using the ssh connection. Then configure your iphone to use the Pi as a proxy and there you go. But there's 2 problems I see, 1, you'll have to make the SOCKS proxy accessible to other ...


1

You screwed up. You were told you couldn't format the disk because it was in use. It was in use. You were trying to format one of the existing disks, not the new one. Now you formatted the existing drive and lost your data. You will need to restore from backup. You can see from the pvdisplay output that /dev/sdd1 is 100% free, so that seems to be the ...


0

rm -rf directory/ also works faster for billion of files in one folder. I tried that.


0

I think in most of the cases without a functioning /lib directory many of the applications you'd need to do a repair job will no longer be present. I would bite the bullet and just do a re-install. If you're bent on trying anyway then here's what to do for RedHat based distros. For Redhat based distros such as CentOS/Fedora/RHEL you can use RPM to verify ...


3

In most cases this should be relatively easy to fix. You can generate a list of all installed packages using the /lib directory with: dpkg -S /lib | awk -F': ' '{ print $1 }' | tr -d , If you reinstall these packages, then it should fix the issue: apt-get --reinstall $(dpkg -S /lib | awk -F': ' '{ print $1 }' | tr -d ,) This of course depends on the ...


0

In terms of being quicker I think reinstall would be. As you would still need to pick system peace by peace, not to count the time it might take you to later debug some issues that could be caused by this, it would take you longer. I would suggest just rebuilding the machine as that will definitely bring system to a stable state.


5

When an server process starts it issues some system calls (socket() and listen()). The system then opens the port and creates a socket file descriptor for the process to interact with. You can see this with: Find the Apache master process id: root@frisbee:~# ps -ef | grep apache | grep root root 27440 1 0 16:06 ? 00:00:00 /usr/sbin/apache2 ...


5

I know that Lego Stormtroopr has logged a ticket so that the critical issue can be addressed. Who knows much time it might take for a fix to be rolled out? As such, I've provided a workaround so that the impact due to the grave issue is minimized. You can create a shell function sl that would execute sl: sl() { ((RANDOM%42)) && command sl || ...


2

make only reports the errors but they are in fact errors from your compiler (probably gcc): error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’ Basically, your code is buggy or inappropriate for your platform but make functions correctly.


2

The documented way to create the mysql account is: groupadd mysql useradd -r -g mysql mysql Add the -m option if you want that account to be used as a login account, which looks to be the case. If you have full sudo access, you can grant sudo rights to that use with using sudo visudo and adding a line similar the one starting with your username and ...


1

Another way to limit this is to use Linux's control groups. This is especially useful if you want to limit a process's (or group of processes') allocation of physical memory distinctly from virtual memory. For example: $ cgcreate -g memory:/myGroup $ echo $(( 500 * 1024 * 1024 )) > /sys/fs/cgroup/memory/myGroup/memory.limit_in_bytes $ echo $(( 5000 ...


1

Yes, sl will act just like ls if you set up the appropriate alias in bash or whatever shell you are using! I actually have several alias for ls including alias ls='ls -FG' alias ll=ls -l alias ll='ls -lFG' so thanks for the suggestion — I will add alias sl='ls -FG' (Not that I ever remember typing sl but then I tend to us ll or lh!)


19

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[]) { ...


5

The Linux kernel syscall API is the the primary API (though hidden under libc, and rarely used directly by programmers), and most standard IPC mechanisms are heavily biased toward the everything is a file approach, which eliminates them here as they ultimately require read/write (and more) calls. However, on most platforms (if you exclude all the system ...


4

In short, no it does not exist.   In long: There are 2 types of pipes in linux, named pipes (aka, fifo), and regular pipes. Named pipes are created with the mkfifo (man 3 mkfifo) system call. Named pipes exist as files on the filesystem. One process opens it for reading, and another opens it for writing. Regular pipes are created with the pipe (man ...


1

I had been struggling with the same problem on Centos6.4 x86_64. I got the following error : Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'" Error: Cannot find a valid baseurl for repo: base So, I fixed it by these steps: ...


1

This error message is your issue: Tue Apr 15 08:36:38 2014 vncext: VNC extension running! vncext: Listening for VNC connections on all interface(s), port 5901 vncext: created VNC server for screen 0 No protocol specified vncconfig: unable to open display ":1" No protocol specified xrdb: Can't open display ':1' No protocol specified ...


6

No. Trivial counter example, this will interact with the kernel: int main() { volatile char *silly = 0; *silly = 'a'; } That'll call the kernel's page fault handler, ultimately resulting in your process getting a SIGSEGV (presuming the compiler doesn't "optimize" that code to do something other than the obvious, since that's undefined behavior by ...


2

There is something kind of what you describe: there is a feature to limit the amount of RAM used by a process (RAM, as opposed to virtual memory). The RLIMIT_RSS limit sets an upper bound a program's resident set size, i.e. the part of the memory of that process which is resident in memory (as opposed to swapped out). However, it is not implemented on Linux. ...


4

There is no such tool because it does not make any sense from a single-program point of view. One can consider CPU/HDD/RAM/swap as resources. These resources can be shared in different ways by the operating system among processes, users, contexts, etc. In some specific situations, it makes sense to tell the operating system to enforce hard limits: Don't ...


7

s=/home/poney/; f=folderfulloffiles; d=/home/unicorn/ sudo mv $s$f $d && sudo chown -R unicorn:unicorn $d$f About the same length as the other answers, and note since they're all using the same library calls under the hood, they're all doing exactly the same thing -- unless, as Gilles notes, this is on the same filesystem and device, in which case ...


2

The purely awk solution, no redundant cat or grep commands: awk '/MemTotal/ {TOT=$2} /MemFree/ {FREE=$2} END {printf("%d kB Used\n", TOT-FREE)}' /proc/meminfo I see awk_FTW beat me to it but I though formatting the output could be nice.


24

Lemma: sl prints a steam locomotive Lemma: The steam locomotive contains forward slashes: $ touch ' ( ) (@@) ( ) (@) () @@ O @ O @ O > (@@@) > ( ) > (@@@@) > > ( ) > ==== ________ ...


0

I was eventually able to solve this by adding the following command to one of my startup scripts: klogconsole -l 3 This seems to make the system shut up. (At least, after the point where the command is executed.)


9

Per @Kevin in the comments below, the --file - |pipe syntax is redundant. So I've removed it. This can also be done with tar: sudo tar -C${SRC_DIR} --remove-files --group=unicorn --owner=unicorn -c ./* | sudo tar -C${TGT_DIR} -pvx


20

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



Top 50 recent answers are included