Tag Info

Hot answers tagged

6

Device files on Unix systems in general are just one way for user programs to access device drivers; there isn't a one-to-one mapping from devices files to physical hardware, and not all hardware has a device file (or even a device driver). The kernel itself doesn't use device files to interact with hardware. As pointed out by lcd047, network cards don't ...


5

You realy should'nt do this. In case you enter your password with just 1 char wrong, everyone who has access to that list/logfile can guess your password. Log who and when someone failed to authenticate. What your trying to achieve is a security risk.


5

Linux kernel maintainers are listed in the MAINTAINERS file in the kernel source code. There's a specific section for memory management: MEMORY MANAGEMENT L: linux-mm@kvack.org W: http://www.linux-mm.org S: Maintained F: include/linux/mm.h F: include/linux/gfp.h F: include/linux/mmzone.h F: include/linux/memory_hotplug.h ...


5

smem is the standard tool for this. It's clean and simple. On a Debian based system, install it via package manager: sudo apt-get install smem A sample (clipped) output from my system: $ smem -s swap -t -k -n PID User Command Swap USS PSS RSS 831 1000 /bin/bash 0 3.8M ...


5

What sets the size of the tmpfs? (On my machine it resides in /dev/shm) I can see its entry in /etc/fstab, but no notation of its size. The kernel documentation covers this underneath the mount options: size: The limit of allocated bytes for this tmpfs instance. The default is half of your physical RAM without swap. If you oversize your tmpfs ...


4

In the linux kernel source code in sysrq.c at line 415, there is a struct defined, what should happen when a certain key is pressed. So you see, no command in a terminal is excuted, instead of this, hard coded functions in the kernel are called. So, as long as the kernel is not crashed, you can press those keys, doesn't matter which application is running in ...


4

Brendan Gregg's iosnoop (part of his perf-tools) will give you detailed information about an application's I/O; for example: # ./iosnoop Tracing block I/O... Ctrl-C to end. COMM PID TYPE DEV BLOCK BYTES LATms supervise 1809 W 202,1 17039968 4096 1.32 supervise 1809 W 202,1 17039976 ...


3

You can use X forwarding on Windows as well; all you need is an X server (such as Xming) and an SSH client (such as PuTTY). Xming includes documentation explaining how to go about things; basically, you enable X forwarding in PuTTY, start the X server on your Windows machine, SSH to the Linux machine and run your Java application. You might find that rather ...


3

Generally, stopping and starting the system cron daemon is a bad idea. Commenting out the line isn't always convenient so here are a couple of related alternatives Use a semaphore One solution to this requirement is to use a semaphore - or flag - to indicate whether or not the script is permitted to run. In this instance the semaphore can be represented by ...


3

You could use the kernel isolcpus option in conjunction with the taskset command. On the Raspberry Pi reserve the core(s) you want to use by appending the following to the line in /boot/cmdline.txt. E.g. to reserve cores 2 and 3. isolcpus=2,3 Then use taskset to assign programs to the core(s). E.g. to launch the Python interpreter. taskset -c 3 python ...


3

If timeout times out, it exits with status 124; you can check this to determine whether the script timed out or not.


3

Whatever you're saying about ~$, home$, and /home$ doesn't make much sense.  I guess you're talking about your command line prompt; if so, it would have been useful to show what you typed and what happened (and then explained what you expected). But I can read minds, so I believe that I understand the issue: ~ and ~user239887 (assuming user239887 is your ...


3

You may try inotify (often packaged inotify tools since kernel 2.6). It will monitor a part of your filesystem and inform you on events like creating/deleting files or directories. A simple use would be: inotifywait -m -r /tmp/ Then, when filesystem activity occurs, you'll see: #=> I'm creating /tmp/b /tmp/ CREATE,ISDIR b /tmp/ OPEN,ISDIR b /tmp/ ...


2

I think the best advice is just in this forum post. Here are your options (2 and 3 are more-or-less the same in terms of effect, really): Use a package manager and a repository. That means you get updates, you get official releases, signed releases, etc. etc. etc. If you can't or won't use a package from a repository, build a package for the software and ...


2

You can avoid to use eval source /tmp/config.txt counter=1 line0="machine$counter[0]" echo ${!line} And much better to call echo via loop for counter in 1 2 3 do line="machine$counter[@]" for element in "${!line}" do echo $element done done


2

Use the eval command. eval "echo \${machine${counter[0]}}" Notice that the first $ is escaped so that it isn't evaluated until eval processes the string. The way this works is that eval executes a command the same as if you had typed it at the command prompt. The difference is that the command that is executed can be constructed programmatically. So in ...


2

The route or the ip utility get their information from a pseudo filesystem called procfs. It is normally mounted under /proc. There is a file called /proc/net/route, where you can see the kernel's IP routing table. You can print the routing table with cat instead, but the route utility formats the output human readable, because the IP adresses are stored in ...


2

I did a quick search on my Debian stable machine, and with the exception of xroach and oneke, they are all available with the names you gave. However, the correct name for oneke is oneko, and it is available in Debian with that name. What is your distribution? Doing a little searching produces the Debian bug report Debian Bug report 158188: xroach: not ...


2

As stated by jpkotta, network-manager is likely the culprit. You can see its status by running ps -aux | grep network-manager | grep <username>. If you get a result, it is running, otherwise it isn't. It will keep overwriting any changes you make with ifconfig as long as it is running. Kill network-manager by running sudo service network-manager ...


2

You might try writing your own gettimeofday() routine, loading it into a compiled library, and using LD_PRELOAD to have your application get a faked time. This should not affect any other applications.


2

kill-ports() { for port in "$@"; do fuser -n tcp "$port" -k -TERM; done } (You absolutely do not need the quotes in this case, but it's always good to use them, or else you'll get complains/edits from people.)


2

There is a solution, thanks to @StéphaneChazelas comment: "Just do: lsof -ti "tcp:$1" | xargs -r kill, that's what -t is for (and -r tells xargs not to run the command if there's no argument. That's for GNU xargs. Some other implementations like FreeBSD do that automatically)" In the end it looks like this and also works (Some cleanup by me too): ...


2

The entries in /dev/mapper are LVM logical volumes. You can think of these as Linux's native partition type. Linux can also use other partition types, such as PC (MBR or GPT) partitions. Your disk is divided in MBR partitions, one of which (/dev/sda2) is an LVM physical volume. The LVM physical volume is the single constituent of the volume group ...


2

To allow XDM remote logins you can do following: Edit file: /etc/X11/xdm/Xaccess change(uncomment) line: # * #any host can get a login window to: * #any host can get a login window and change(uncomment): # * CHOOSER BROADCAST #any indirect host can get a chooser to: * CHOOSER BROADCAST #any ...


2

This could be due to some resource limit, either on the server itself (or) specific to your user account. Limits in your shell could be checked via ulimit -a. Esp check for 'ulimit -u' max user processes, if you have reached max processes, fork is unable to create any new and failing with that error. This could also be due to swap/memory resource issue


2

as linked in the wikipedia article in external links ... you can see that documentation here: Linux Magic System Request Key Hacks edit: this is also found in Linux kernel source under the Documentation subdirectory


2

awk awk 'FNR==NR { a[$2, $3]=$4 next } ($2, $3) in a{ print $0, a[$2, $3] } ' file2.txt file1.txt > out.txt join join -j 2 \ <(sort -k2,3 file2.txt | sed 's/ /+/2') \ <(sort -k2,3 file1.txt | sed 's/ /+/2') \ -o ...


1

: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether 56:9c:21:33:37:c8 brd ff:ff:ff:ff:ff:ff inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0 valid_lft forever preferred_lft forever This is a "default" bridge network created by libvirt,for give network to virtual machines(nat if ...


1

If I were to decrease the ext4 partition size on that HDD and install windows on on the remainder, would it still affect my bootloader, that resides on the SSD (Mess up my bootloader so that I can not boot to Linux anymore)? No, it would not affect the bootloader or anything else on the other disk, unless a mistake is made and the new installation goes ...


1

I'll say what I always do. Please NEVER use regular expressions to parse XML. It's bad news. XML has some various formatting which means semantically identical XML will match or not match certain regular expressions. Simple things like line wrapping, unary tags, etc. This means you create brittle code, which one day might mysteriously break because of an ...



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