date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,433,997,497,000
I copied /etc/DIR_COLORS to ~/.dir_colors because /etc/DIR_COLORS.xterm was being used and colours in ls --color=auto were too dark. Now, how do I get this file to take effect immediately? (i.e. Without restarting the shell?) Is there something like what Ctrl-X Ctrl-R does for ~/.inputrc?
From man dir_colors: The program ls(1) uses the environment variable LS_COLORS to determine the colors in which the filenames are to be displayed. This environment variable is usually set by a command like eval `dircolors some_path/dir_colors` So you need to run eval "$(dircolors ~/.dir_colors)" now, and every ...
How do I reload ~/.dir_colors?
1,433,997,497,000
I have a 3G/GPS device that creates 5 tty nodes, although it's only one physical USB connection. Basically, a multi port usb-serial adapter. I'm trying to create some udev rules to make sure those nodes always have the same name, or at least a symlink to them. I can indeed find the device at /sys/devices/platform/pxa2...
Your rules all have syntax errors in them: = is for assignment == is for comparison, so you were not actually looking at what DEV equaled, you were assigning it. You need , between all the statements, there were none before SYMLINK+=. Fist Rule ACTION=="add", DEV=="/devices/platform/pxa27x-ohci/usb1/1-2/1-2.2/1-2.2:...
Udev rule to match multiple node USB device
1,433,997,497,000
I'd like to know how I can check to see if my cronjob will run at the specified time I set it at. Is there anyway I can test this without having to wait for that time? Here are my crontab -l results: root@work:~$ crontab -l 3 */23 * * * /opt/lampp/bin/php /opt/lampp/htdocs/site/cron/my_script.php > /dev/null If I did...
The only way to be sure is to let it run and inspect the results. You can modify your command to log the output somewhere and inspect that, or let it email you the output. You could add another identical line which runs the command within 5 minutes or so, for debugging. eg. If it's 3:13 pm right now, I might add this...
How can I ensure my cronjob will run at specified time?
1,433,997,497,000
I never thought about this before, but I was wondering why they chose runlevel 2. Every other distro and OS I've used default to runlevel 3 (with the exception of AIX which also defaults to runlevel 2).
The Debian distribution (and hence Ubuntu, which is derived from it) does not define any differences between runlevels 2-5 as a matter of policy. It is up to the local system administrator to make use of runlevels as they see fit. Since there is no difference between runlevels 2-5, a default runlevel 2 was chosen.
Why does debian and ubuntu default to runlevel 2?
1,433,997,497,000
I need to randomize the time before a given command starts. I realize it's relatively trivial to do this within a script, or to write a "wrapper" script to do this, but I'm wondering if anyone knows a lightweight binary program that's already out there that will accomplish this without requiring an interpreter to be l...
If you want finer-grained control than maxschlepzig's nice bash incantations, it's a reasonably easy thing to just code up: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <time.h> int main(int argc, char**argv){ useconds_t mdelay=0, delay; if (argc<3){ fprintf(stderr,"%s <delay (in milli-...
Lightweight utility/program to run a command after a random delay
1,433,997,497,000
What criteria distinguishes various distributions of Linux, such as Debian, Ubuntu, Fedora, OpenSUSE? In other words, given a release of a Linux OS, what features mean it is classified into one distribution not the other? I heard that different distributions are grouped differently, for example, Debian-based, Gentoo...
From the Linux distributions Wikipedia entry: A Linux distribution is a member of the family of Unix-like operating systems built on top of the Linux kernel. Such distributions (often called distros for short) are Operating systems including a large collection of software applications such as word processors, spreads...
Classification of Linux distributions
1,433,997,497,000
What is the convention for numbering the linux kernels? AFAIK, the numbers never seem to decrease. However, i think I've seen three kinds of schemes 2.6.32-29 2.6.32-29.58 2.6.11.10 Can anybody explain what are the interpretations of these numbers and formats?
2.6.32-29: 2.6.32: base kernel, -29 final release by ubuntu 2.6.32-29.58: 2.6.32: base kernel, -29.58 ongoing release (-29) by ubuntu 2.6.11.10: 2.6.11: base kernel, .10 tenth patch release of it. (2.6.11 was chosen by volunteers (read Greg KH) to be a "long term maintenance" release).
Numbering convention for the linux kernel?
1,433,997,497,000
What exactly are shmpages in the grand scheme of kernel and memory terminology. If I'm hitting a shmpages limit, what does that mean? I'm also curious if this applies to more than linux
User mode processes can use Interprocess Communication (IPC) to communicate with each other, the fastest method of achieving this is by using shared memory pages (shmpages). This happens for example if banshee plays music and vlc plays a video, both processes have to access pulseaudio to output some sound. Try to fi...
What are shmpages in laymans terms?
1,433,997,497,000
Can the initramfs image be compressed by a method other than gzip, such as lzma?
Yes. I use in-kernel initrd and it offers at least the following methods: None (as it is compressed with kernel) GZip BZip LZMA (possibly zen-only) You can use it on external file and with LZMA (at least on Ubuntu). Wikipedia states that Linux kernel supports gzip, bzip and lzma (depending, of course, what algorithm...
Can the initramfs image use a compression format other than gzip?
1,433,997,497,000
After a comment from OP, I discovered that /dev/stdout gives blocks of 10 KiB even after disabling buffering, but - does not. Why is this? I could not find anything regarding this in man tar nor man stdout. Note that /dev/stdout goes to 00002800, not 000000a1. The output is correct, except is padded with null bytes. >...
The difference in behaviour comes from tar: when writing, it applies a “blocking factor”, which by default uses 10240-byte records (that’s 2800 in hexadecimal). This happens even when compressing, which is why some tarballs result in error messages from gzip when they are extracted. The behaviour is disabled at the en...
Why does tar's handling of stdout and - differ?
1,433,997,497,000
The system clock is maintained by the kernel, whereas the hardware clock is maintained by the Real Time Clock (RTC). Do both clock run at same frequency? Are both independent of each other? What happens when Real time clock fails? Does it affect the system clock? Can anyone let me know the difference between both th...
both clock run at same frequency? Usually there are two clocks inside a computer/device/system. One is powered from a battery (usually a CR2032, could be the main battery or even a supercap in an embedded system) and runs from an dedicated chip. The other one is driven by the CPU clock source (with its own quartz cry...
System Clock vs. Hardware Clock (RTC) in embedded systems
1,433,997,497,000
I am new to Linux. I know that there are ways to convert between file formats in Linux through the terminal. But is there any way I achieve the following? I have 3 folders, inside those folders, there are 15 more folders. Each of those folders has 12 files in .xls format, and some other .R files and pdf files. Is ther...
It will require libreoffice From this Stack Overflow question Unix command to convert xls file into xlsx file? : libreoffice --convert-to xlsx my.xls --headless Note that the --convert-to option implies the --headless option (it did not in Libreoffice version 4.2.3 when the SO answer above was written in 2014, but ha...
Converting multiple .xls format files to .xlsx format
1,433,997,497,000
A common scenario for setting up a container/sandbox is wanting to create a minimal set of device nodes in a new tmpfs (rather than exposing the host /dev), and the only (unprivileged) way I know to do this is by bind-mounting the desired ones into it. The commands I'm using (inside unshare -mc --keep-caps) are: mkdir...
Well, this seems to be a very interesting effect, which is a consequence of three mechanisms combined together. The first (trivial) point is that when you redirect something to the file, the shell opens the target file with the O_CREAT option to be sure that the file will be created if it does not yet exist. The secon...
Why do bind mounts of device nodes break with EACCES in root of a tmpfs?
1,433,997,497,000
I tried this: xprop -id $(gedit & echo $!) -f MY_VAR1 8s -set MY_VAR1 MyCustomVar Than i tried to xprop and click on the gedit window - MY_VAR1 was not present there. So i thought maybe i should put sleep in there... i tried: xprop -id $(gedit & sleep 5 & echo $!) -f MY_VAR1 8s -set MY_VAR1 MyCustomVar Waited 5 seco...
As Jeff noted, PID and Window ID are different things, and there isn't always an easy way to map one to another — some processes have no window, some processes share a window, and others still have many windows (at least they do at the X level, even if you only see a single window). When I start gedit I have one visib...
How to set custom property with xprop and open that program in one line?
1,433,997,497,000
Is there any way to read total running time of a linux system from BIOS or CPU? I've searched BIOS informations by dmidecode. But it gives release date which is not proper for my question. Then I've checked out /proc. But it holds uptime values just from last reboot. Maybe, writing these uptime values for every boot c...
This isn’t something the firmware tracks, as far as I’m aware. Even BMCs don’t measure total uptime. This won’t help with past uptime from previous boots, but you can start recording uptimes now, by installing a tool such as uptimed and setting it up so that it never discards values (set LOG_MAXIMUM_ENTRIES to 0 in up...
Total runtime of machine
1,433,997,497,000
I have a script that asks for the user's password and I want to check if the given password is wrong or not. #A little fragment of my script read -sp 'Your password: ' password; if [[ $password -ne WHAT GOES HERE? ]]; then MORE CODE HERE else MORE CODE HERE fi
There's no fully portable way to check the user's password. This requires a privileged executable, so this isn't something you can whip up from scratch. PAM, which is used on most non-embedded Linux systems as well as many embedded systems and most other Unix variants, comes with a setuid binary but it doesn't have a ...
Check user's password with a shell script
1,433,997,497,000
I'm currently trying to scp a file from one server to another, using an ssh key on my local computer. this is the command I'm currently using: sudo scp -r -o "ForwardAgent yes" <new_folder> <second-server-path> and I've followed this github doc to verify that my ssh agent is being forwarded to the second server's te...
scp does not support to forward your agent (hardcoded to be disabled in the code) so this is not possible what you are trying. The problem is in sudo. Connection to ssh-agent is stored in environment variable SSH_AUTH_SOCK (echo $SSH_AUTH_SOCK) and this variable is not preserved during the sudo so there are two possi...
Using scp with a forwarded ssh agent
1,433,997,497,000
I want to make a very minimal linux os which only have a terminal interface and basic commands/applications (busybox is my choice for commands/apps). I don't want the installation option on my os. I just want it to be booted and run completely from RAM. I'm planning to use ISO-Linux as bootloader. No networking, no v...
Technically you can achieve this. Though, kernel do not have any built-in user-interface. You need to follow steps as: 1. Create a initramfs with static busybox and nothing else. This initramfs will have few necessary directories: like proc, sys, tmp, bin, usr, etc 2. Write a "/init" script, whose main job will be: ...
How to make a minimal bootable linux (only with terminal) from kernel source code? [duplicate]
1,433,997,497,000
The following command produced the result of the following image using convert, where an overlay box containing the letter "A" was layered over the PDF: convert online_gauss.pdf -fill white -undercolor '#00000080' -pointsize 40 -gravity South -annotate +0+5 ' A ' online_gauss_annot.pdf However, convert rasterizes t...
Well, I've come up with a solution using TikZ within a crafted LaTex document. The result is not exactly the same, but I think it is even nicer: This required having a tex document with placeholders that will be replaced by the arguments to a sh script. % file: add_legend.tex \documentclass{standalone} \usepackage{g...
Overlay text in PDF via command line
1,433,997,497,000
I tried to copy /dev/Storage/Storage (an LV under LVM) to an image file using a dd | pv | dd pipeline. dd reported an error, and I want to know whether dd finished copying my disk or stopped due to the error. I'm not sure since it gave me two different outputs: one with an error at the top and one without. I'd take a ...
You are using the default 512 bytes dd block size. You would significantly improve performance by using a larger block size, say 128k or even 1m. There are two outputs because you are running two dd commands, the first one is the device reader and it shows an I/O error. You are likely using LVM given the device name ...
Interpreting dd Input/Output error
1,433,997,497,000
I have a situation where I need to find the files having World Write (WW) permission 666 and I need to re mediate such files with 664 .. for this I have used this command find /dir/stuct/path -perm -0002 -type f -print > /tmp/deepu/permissions.txt when I execute the command I get the files which have WW permissions.....
Think about your requirement for a moment.  Do you (might you possibly) have any executable files (scripts or binaries) in your directory tree?  If so, do you want to remove execute permission (even from yourself), or do you want to leave execute permission untouched?  If you want to leave execute permission untouched...
How to chmod the files based on the results from find command
1,433,997,497,000
I am trying to install ap-hotspot on Ubuntu-14.04 When I enter the command: sudo add-apt-repository ppa:nilarimogard/webupd8 It gives me this message "Cannot add PPA: 'ppa"nilarimogard/webupd8' Please check that the PPA name and format is correct" How do I proceed? Since I am using college proxy to access the In...
Since you can't add the repository, you can always add them from a terminal using the command line. Browse to the list of the repositories at the WebUpd8 Website. Copy down the address of the master repository, which is Master Repository. You want to add this one because it contains all the others. sudo cp /etc/a...
Unable to add PPA repository from terminal
1,433,997,497,000
Moved from Stack Overflow, where I realize it was off-topic since it was asking for sources - far as I can tell, the rules forbid that there but not here. I know that the kernel in Android is now mostly the Linux kernel with a few exceptions like wakelocks (as described by John Stultz.) But is it close enough to be co...
The LSB, POSIX, and the Single UNIX Specification all significantly involve userland. Simply using a kernel that is also used as the basis of a "unix-like", "mostly POSIX compliant" operating system -- GNU/Linux -- is not sufficient to make Android such as well. There are, however, some *nix-ish elements, such as th...
Is Android compatible with the Linux Standard Base?
1,433,997,497,000
Out of curiosity, is it possible to find out which bootloader was used to start a given system? Was the system booted by GRUB, LILO or any other boot loader? I guess there must exist some /sys or /proc variable for the same? EDIT: Boot Info Summary: => Lilo is installed in the MBR of /dev/sda sda1: _________________...
I don't believe this info is tracked in meaningful way under either /sys or /proc. About the only way I can fathom this would be accessible to you after a boot is by interrogating the system either by looking to see if a GRUB or Lilo configuration file was present, or by making use of a script such as bootinfoscript. ...
Find bootloader
1,433,997,497,000
I really like hexdump, especially because you can define a custom format; say: $ echo -e '\x00\x01\x02\x03' | hexdump -v -e '1/1 "%_ad: "' -e '4/1 "%02X "' -e '1/1 " : "' -e '4/1 "%_p"' -e '1/1 "\n"' 0: 00 01 02 03 : .... 4: 0A : . So, I can choose to have, say, 4 bytes per line, written as hexadecimal first...
Failing a dump program with suitable dump options, you can always cobble something together by using both hexdump and xdd and then joining the output with paste. Its not pretty, but using a shell that supports process substitution (bash will do): mkfifo fifo echo -e '\x00\x01\x02\x03' | tee fifo | paste -d' ' \ ...
Achieving hexdump-like format, that includes binary strings, on the command line?
1,433,997,497,000
What is ALSA? I read the Wikipedia page but couldn't understand it. All I understand is that it is a module in the kernel that has something to do with sound. What happens if you don't include it in the kernel, does it mean that the speakers won't work or something. I am asking because I am trying to install a versio...
ALSA stands for Advanced Linux Sound Architecture, I'd encourage you to poke around their project website if you're truly curious. Specifically I'd take a look at the "I'm new to ALSA pages & tutorials. The ArchLinux wiki probably describes it the best. The Advanced Linux Sound Architecture (ALSA) is a Linux kernel ...
What is ALSA in the Linux kernel?
1,433,997,497,000
I have an LDAP user who accesses a server based on having the appropriate LDAP host attribute via sssd. This user does not show up in /etc/passwd because he is not local. How do I modify his home dir location if he has already logged in and it was created in the default location? RHEL 6 Is it just usermod -d /new...
This is actually shockingly easy. If your nsswitch is files ldap; just add an entry for them in /etc/passwd and modify whatever parameter you want. If they don't already exist in /etc/passwd, you could do getent passwd <username> | sed 's|/home/<username>|/home/remoteusers/<username>|g' >> /etc/passwd for instance t...
Edit home directory for an LDAP user in Linux
1,433,997,497,000
I would like to get the list of files that are used during the process of Linux boot. We are developing the protected enterprise system based on the RHEL 6.4. The integrity of specified files will be checked by a special hardware. So the question is - how to get the list of these files (with resolved dependencies com...
Thanks to RHEL support, the clear solution has been discovered. It is based on systemtap kernel module usage. Quoted from here to avoid link rot. And thank you again for all of your advice :) I could not even imagine that systemtap is able to start even before the init script and track the booting process. I very appr...
How to list all the files used during Linux boot
1,433,997,497,000
I'm trying to measure the disk IO latencies of a running process to make a histogram. I could do this with DTrace in operating systems that provide it (e.g. as in this Joyent paper), but my application is running in Linux. My first thought was to try perf, and I can get counters but I can't find any way to get time de...
This is actually complicated. But there is hints: Learn about SystemTap, this is linux analog of DTrace. I think they may even have example script for similar task. Learn blktrace. You may be able to parse its output, in theory. This will be more device latency (service time) than response time program get on read()....
Measure disk IO latencies of a running process
1,433,997,497,000
Jiffies in most Linux system are defaulted to 250 (4ms). The questions is that what happens when a program has a usleep() less then 4ms ? Of course it works as should when it is scheduled. But what happens when linux scheduler takes out this program to wait, because another program has to operate ? How does the preemp...
See time(7), and the manpages it references. An excerpt: High-Resolution Timers Before Linux 2.6.21, the accuracy of timer and sleep system calls (see below) was also limited by the size of the jiffy. Since Linux 2.6.21, Linux supports high-resolution timers (HRTs), optionally configurable via CON...
How preemption works on Linux when a program has a timer less then 4ms?
1,433,997,497,000
/usr/src/linux-3.2.1 # make install scripts/kconfig/conf --silentoldconfig Kconfig sh /usr/src/linux-3.2.1/arch/x86/boot/install.sh 3.2.1-12-desktop arch/x86/boot/bzImage \ System.map "/boot" You may need to create an initial ramdisk now. -- /boot # mkinitrd initrd-3.2.1-12-desktop.img 3.2.1-12-deskto...
You should be using mkinitramfs, not mkinitrd. The actual initrd format is obsolete and initramfs is used instead these days, even though it is still called an initrd. Better yet, just use update-initramfs. Also you need to run make modules_install to install the modules.
How to create an initrd image on OpenSuSE linux?
1,433,997,497,000
I have a question about giving a shell account to somebody. How safe is it? He could read /etc. How can I give a secured shell account that will only restrict the user to some bins and his own home? Is the only way a chroot jail?
One of the most easy/efficient way to control what a user can do is lshell. lshell is a shell coded in Python, that lets you restrict a user's environment to limited sets of commands, choose to enable/disable any command over SSH (e.g. SCP, SFTP, rsync, etc.), log user's commands, implement timing restriction, and mo...
How can I safely give a shell to somebody?
1,433,997,497,000
Following on from topics raised in other questions, I believe that when the Linux Kernel is trying to free up physical RAM it makes some kind of decision between discarding pages from its disk cache or flushing other pages into swap. I'm not certain of this, perhaps I've completely misunderstood the mechanism. In any...
The name given to the overall task of freeing physical pages of memory is reclaim, and it covers a number of tasks. Reclaim is mostly driven by page allocations, with various levels of urgency. On an unloaded system, page allocations can be satisfied without effort and don’t trigger any reclaim. On moderately loaded s...
How does the kernel decide between disk-cache vs swap?
1,433,997,497,000
Is there any limit for the maximum nested directories in the ext4 filesystem? For example ISO-9660 filesystem AFAIK cannot have more than 7 level of sub-directories.
There isn’t any limit inherent in the file system design itself, and experimentation (thanks ilkkachu) shows that directories can be nested to a depth exceeding limits one might naïvely expect (PATH_MAX, 4096 on Linux, although that limits the length of paths passed to system calls and can be worked around with relati...
Nested directory depth limit in ext4
1,433,997,497,000
There are three spin_lock functions in the kernel I am currently busy with. spin_lock spin_lock_irq spin_lock_irqsave I only find contributions covering only two of them (including Linux documentation). Then answers or explanations are formulated ambigouos or contrary to each other or even contain comments saying th...
A brief description is given in Chapter 5. Concurrency and Race Conditions of Linux Device Drivers, Third Edition void spin_lock(spinlock_t *lock); void spin_lock_irqsave(spinlock_t *lock, unsigned long flags); void spin_lock_irq(spinlock_t *lock); spin_lock_irqsave disables interrupts (on the local processor only) ...
spin_lock vs. spin_lock_irq vs. spin_lock_irqsave
1,433,997,497,000
From Understanding The Linux Kernel Unix is a multiprocessing operating system with preemptable processes. Even when no user is logged in and no application is running, several system processes monitor the peripheral devices. In particular, several processes listen at the system terminals waiting for user login...
The term graphics shell can be both a graphical shell or a command line shell running under it. Meaning, the user graphical interface (GUI) or the command line that controls the GUI functions. First, let's begin with the shell, what "shell" means: the definition of the word "shell" means a program, or even a group of ...
graphics shell vs graphical shell
1,433,997,497,000
Does anyone have documentation on ext4-rsv-conver? $ pgrep -a -f ext4-rsv-conver 153 ext4-rsv-conver 161 ext4-rsv-conver 7451 ext4-rsv-conver $ dpkg -S ext4-rsv-conver dpkg-query: no path found matching pattern *ext4-rsv-conver* I can't find anything about ext4-rsv-conver in Google. My system is Debian 9.
These processes are kernel threads, used by the ext4 implementation to handle conversion work from writeback, i.e. “completed IOs that need unwritten extents handling and have transaction reserved”. That probably doesn’t explain much, but it does mean they’re nothing to worry about. Basically the kernel ends up with w...
What is "ext4-rsv-conver" process?
1,516,899,074,000
I am running syslog server (rsyslog 8) on my centos machine. I want to map other device in my network to send the logs to this syslog server. If mapping is done correctly where exactly the syslogs will get stored in centos machine. /var/log/messages folder ?
Syslog is a standard logging facility. It collects messages of various programs and services including the kernel, and stores them, depending on setup, in a bunch of log files typically under /var/log. In some datacenter setups there are hundreds of devices each with its own log; syslog comes here handy too. One just ...
File location for Syslogs in Centos machine
1,516,899,074,000
I read about a developer saying it doesn't work, "and probably never will". Why is this? The two OSes aren't that radically different, I think.
Wine on macOS can run 64-bit applications since version 2.0. Here are the release notes for 2.0 The main highlights are the support for Microsoft Office 2013, and the 64-bit support on macOS.
Why can wine run 64bit programs on Linux but not on Mac?
1,516,899,074,000
So on my Linux desktop, I'm writing some large file either to a local disk or an NFS mount. There is some kind of system buffer that the to-be-written data is cached in. (Something in the range of 0.5-2GB on my system, I think?) If the buffer is full, all file access blocks, effectively freezing the system until the w...
Typically Linux uses a cache to asynchronously write the data to the disk. However, it may happen that the time span between the write request and the actual write or the amount of unwritten (dirty) data becomes very large. In this situation a crash would result in a huge data loss and for this reason Linux switches t...
Prevent large file write from freezing the system
1,516,899,074,000
We have a Linux server running Debian 4.0.5 (Kernel 4.0.0-2) with 32G RAM installed and 16G Swap configured. The system uses lxc containers for compartmentalisation, but that shouldn't matter here. The issue exists inside and out of different containers. Here's a typical free -h: total used ...
Remember how I said: The system uses lxc containers for compartmentalisation, but that shouldn't matter here. Well, turns out it did matter. Or rather, the cgroups at the heart of lxc matter. The host machine only sees reboots for kernel upgrades. So, what were the last kernels used? 3.19, replaced by 4.0.5 2 months...
Permanent swapping with lots of free memory
1,516,899,074,000
I wonder whether for the average Linux user it is considered as bad -from a point of view of security or any other relevant viewpoints- to have no or almost no entropy left in /dev/random. Edit: I don't need to generate random numbers (I would use /dev/urandom for that and even for password generation and disk encryp...
Entropy is fed into /dev/random at a rather slow rate, so if you use any program that uses /dev/random, it's pretty common for the entropy to be low. Even if you believe in Linux's definition of entropy, low entropy isn't a security problem. /dev/random blocks until it's satisfied that it has enough entropy. With low ...
Is it bad to have a low entropy in /dev/random?
1,516,899,074,000
Is it possible to have a vanilla installation of Ubuntu 14.04 (Trusty) and run inside it containerized older Ubuntu versions that originally came with older kernels? For example for 12.04 I'd assume the answer is yes as it has linux-image packages for subsequent Ubuntu releases, such as linux-image-generic-lts-saucy a...
You can run older Linux programs on newer kernels. Linux maintains backward compatibility (at least for all documented interfaces), for the benefit of people who are running old binaries for one reason or another (because they don't want to bother recompiling, because they've lost the source, because this is commercia...
Is it possible to run a 10.04 or 12.04 or earlier LTS containerized under LXC or Docker on Trusty?
1,516,899,074,000
I have been using sendmail to send out mails using internally available mail server. But currently port 25 is blocked for security reasons. I would like to know if there is a way to specify port number in the sendmail utility. I am trying to make use of the secure SMTP-MSA port 587 as an alternative assuming I could ...
Unless explicitly configured otherwise, mail will be transmitted over port 25. You can route mail using other ports, or even other protocols than SMTP but that will typically only work within your own network. The mailservers from your intended recipients will most likely only accept incoming email via SMTP on port 2...
Using port 587 with sendmail
1,516,899,074,000
I am using iptables to to mark the package and want to route based on the marks. First I added the ip rule: sudo ip rule add fwmark 1 prohibit (The "prohibit" is just for test, I will change it to some route table later.) Then I began to mark the packages: sudo iptables -A OUTPUT -d 192.168.1.0/24 -j MARK --set-mark...
mangle is for mangling (modifying) packets, while filter is intended to just filter packets. A consequence of this, is that in LOCAL_OUT, after traversing the tables and getting the filtering decision, mangle may try to redo the routing decision, assuming the filtering decision is not to drop or otherwise take control...
iptables: what the difference between filter and mangle
1,516,899,074,000
I have acquired a new wireless keyboard, and I've tested it out on both a Windows and a Linux box. It worked on both, but with an initial difference - Windows took a minute or two, to look up the keyboard's (Logitech's) drivers on the Internet and install them. It visually notified my of doing so and displayed its pro...
Linux hardware drivers are kernel modules. Because of the open source model and licensing of the kernel, very few of these are written by hardware manufacturers; most of them are reverse engineered or based on standardized public protocols. Pretty sure bluetooth is in the later realm, and also that things like mice a...
How are drivers for peripheral hardware installed in Linux?
1,516,899,074,000
I am learning how to create kernel modules and it was all working fine: I compiled, inserted the .ko with sudo insmod cheat.ko, and the printk messages inside the init function (set by module_init) appeared correctly in /etc/log/syslog. Then I made changes to the module, removed it with sudo rmmod cheat.ko, reinserted...
The Linux kernel is only willing to unload modules if their module_exit function returns successfully. If some function from the module crashes, the kernel may be able to recover, but the module is locked in memory. It may be possible to rummage through the kernel data structures and forcibly mark the module as unload...
Cannot remove or reinsert kernel module after error while inserting it without rebooting
1,516,899,074,000
I'm intending to replace a NAS's Custom Linux with Arch Linux (details at the bottom), of course wishing to preserve all user data and (due to the SSH-only headless access) attempting to be fool-proof since a mistake may require firmware reinstallation (or even brick the device). So instead of running the installation...
with the required skill and especially knowledge about the installed linux it is not worth while anymore to replace it. and whatever you do, you probably never want to replace the already installed kernel. however, you can have your arch linux relatively easy and fool proof! the concept: you install arch linux into so...
How to safely replace one Linux distribution with another one via SSH?
1,516,899,074,000
I have a Linux (Ubuntu 12.04) PC connected to the internet with a Greenpacket WiMax USB modem. I want to share the Internet connection with another computer running Windows 7 Home Premium, connected to the Linux PC over a LAN. Is this possible? How? Is the reverse possible instead (connecting the internet to the Windo...
You need to set up NAT on the Linux box. There are numerous howtos on the Net when you search for NAT and iptables, maybe including the distro you use. Here is a howto for Debian which should work on other distros as well: http://debianclusters.org/index.php/NAT_with_IPTables Here are some lines that come from a Germa...
How do I share internet with Windows from my Linux box?
1,516,899,074,000
I am looking for a way to fragment an existing file in order to evaluate the performance of some tools. I found a solution for NTFS file system called MyFragmenter as described in this thread. However I can't find anything for ext2/3/4... I guest I can develop my own file fragmenter but due to time constraint I would ...
If you want to ensure fragmentation but not prevent it (so you only have partial control over what happens), and you don't care about the specifics of the fragmentation, here's a quick & dirty way of doing things. To create a file of n blocks in at least two fragments: Open the file with synchronous writes, write m <...
How to deliberately fragment a file
1,516,899,074,000
Let's say I have two identical disks, and I set one LVM logical volume on them (no mirroring). Question: What will happen when one of the disks fails? I will lose all the data from all the disks I will lose the data from broken disk, but I get data from still working one something else (what) ? Thank you in advance ...
The worst and most likely case is that you will lose everything. If you have a single logical volume spanning both drives, and you lose one drive with no mirroring, you've essentially wiped out half the file system. From this point, it gets mildly better depending on what file system you are running on your volume. A...
Does LVM increase the risk of data loss?
1,516,899,074,000
I want to configure my Linux so that it will be used as a network router (gateway). Can anybody give me some hints on this? (links are welcome!)
For a simple router, there are really only two steps that need to be done. Enable routing The first step is to enable routing in the kernel. By default, the kernel drops packets that it doesn't recognize; once you enable routing, it'll forward them. You need to issue either of these two commands when the computer boot...
How to build a gateway from my Linux OS
1,516,899,074,000
I was forced to shutdown (using the power button) and reboot after my laptop froze with just a black screen. After such an incident, where should I look for error messages etc. that might indicate what caused the freeze? I am running Xubuntu (Lucid) with Fluxbox as my window manager. Any suggestions are welcome but I ...
If the screen and input devices (keyboard and mouse or trackpad) froze, the first place to start by looking would be in /var/log/Xorg.0.log (assuming that Xorg is running on the first display server). If that doesn't yield any immediate clues, the next logs to check would be /var/log/messages.log and /var/log/dmesg.lo...
Where should I look for error messages after a freeze-up and reboot in Linux?
1,516,899,074,000
After apt-get install chromium and running it on Debian 12, ps alx | grep -e ^F -e ^5.*chromium returns: F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND 5 1000 3452315 3452313 20 0 33884428 16712 do_sys S ? 0:00 /usr/lib/chromium/chromium --type=zygote --crashpad-handler-...
BTW : where the flag F value 5 means used super-user privileges according to man ps. Indeed but not only : 5 = 1 + 4 PROCESS FLAGS The sum of these values is displayed in the "F" column, which is provided by the flags output specifier: 1 forked but didn't exec 4 used super-user privilege...
Super-user privileges for Chromium browser
1,516,899,074,000
I am testing PAM scenarios on RedHat 7.5 The pam module pam_succeed_if.so looks like the most basic level of conditional testing that PAM has to offer, and it is not meeting my needs. You can only create tests on the user, uid, gid, shell, home, ruser, rhost, tty, and service fields. In my situation, I do want to test...
Well it turns out I'm actually an idiot, the pam_exec.so module is perfectly fine for creating PAM conditionals. Tim Smith was correct in assessing that both tests in my /etc/security/deny-ssh-user.sh script were NEVER setting the variable SSH_SESSION to true. I didn't take that into consideration because the script w...
How to create a conditional PAM entry
1,516,899,074,000
We have a process that in recent weeks had a once-off memory leak that resulted in it consuming all memory on our RHEL 7 box We now wish to set limits around this such that it will never take any more than a certain amount We are using the ulimit -v setting to set this amount (as the -m setting does not work) Therefor...
Some description about how ulimit works: ulimit has deal with setrlimit and getrlimit system calls. It's easy to ensure by strace-ing of bash process (ulimit is component of the bash). I set 1024kb of max memory size: $ ulimit -m 1024 In another console: $ strace -p <my_bash_pid> . . . getrlimit(RLIMIT_RSS, {rlim_cur...
Is setting ulimit -v sufficient to avoid memory leak
1,516,899,074,000
I'm dual-booting Linux Mint 18.2 and Windows 10. I've synchronized OneDrive from Windows, but I can't seem to access the OneDrive folder from Linux. Terminal shows that I have a OneDrive folder, but ls -all gives me the following error on the OneDrive folder: unsupported reparse point I've done a bit of Googling a...
I found it! Michael's WSL link provided the answer. I just need to delete the reparsepoint for OneDrive before I shutdown Windows. Here's my code: fsutil reparsepoint delete "C:\Path\To\OneDrive\Folder"
Accessing OneDrive folder on Windows partition
1,516,899,074,000
I have read that the /dev directory contains device files that points to device drivers. Now my question is, when i do ls -l, i get output something like this what does this 5th and 6th column value represent and its significance?
these are major, minor numbers, more info on which you can find here : http://www.makelinux.net/ldd3/chp-3-sect-2.shtml Traditionally, the major number identifies the driver associated with the device. For example, /dev/null and /dev/zero are both managed by driver 1, whereas virtual consoles and serial terminals are...
ls -l output in /dev directory of Unix/Linux system [duplicate]
1,516,899,074,000
I recently purchased an external USB hard drive and wanted to use it as a portable boot drive. I installed Linux Mint 18.1 on it and got everything working. Then I started to think about using that drive to install Linux on other machines. I assumed that whatever a live boot USB does should be possible from a full-blo...
There is an example to install debian from a Linux-mint live USB (or any debian based distro). If you have a debian based distribution already installed on your hdd , you can install other debian based distro using chroot and debootstrap from the existing OS. Boot from the live USB .Use gparted to create your root , ...
Install Linux from Linux
1,516,899,074,000
This might be a bit of a confused question... I've recently started playing around with docker and am trying to setup a basic lamp server. I have a docker image of centos with httpd, php, and mysql. However, in a docker container I can't start services in the way I would usually do via systemd / service. I can get ht...
You cannot use systemctl If your PID 1 is not systemd. You can find your PID 1 with ps -q 1. Being able to start and stop services the normal way is one advantage mentioned in this article about Running systemd in a non-privileged container. Others are logging or tracking of child processes as described in Andrei's an...
Running a program as a service or directly, what's the difference
1,516,899,074,000
man bash says: backward-delete-char (Rubout) Delete the character behind the cursor. When given a numeric argument, save the deleted text on the kill ring. Is Rubout just Delete key on keyboard? Because it has the same function as bash describes backward-delete-char. But when I try: backward-kill-line (C-x Rubout)...
There are three concepts to be clarified in the simple description of: backward-delete-char (Rubout) Keys There is a key called Delete, one which you are using in your examples. That key erase "the next character". If the line contains test1 and the cursor (the blinking indicator) is over the letter s, Delete will ...
what is Readline backward-delete-char (Rubout)
1,516,899,074,000
How can I get a list which users are authorized to a folder and which permissions they have? I tried already the most common ones like 'ls', 'namei' or 'getfacl'
When you ls -ld */ you get a list (-l) of your directories (-d) in the current path. You may see the access rights of owner, group and others. For more details regarding the access rights you may check: This link When you check the output from the ls command you can see the owner of the file or directory and next to...
List of user permissons for a specific folder
1,516,899,074,000
So I have a desktop with a fast SSD and large HDD. I am trying to get a well configured large, fast zpool out of it. I have read that I can carve separate partitions into the SSD for the ZIL and L2ARC which would seem to do what I want, except I have to manually configure how big each partition should be. What I don't...
While Marco's answer explained all the details correctly, I just want to focus on your last question/summary: Is it a good idea to set up SSD + HDD in same pool, or is there a better way to optimize my pair of drives for both speed and capacity? ZFS is a file system designed for large arrays with many smaller disks....
Combining SSD + HDD into single fast, large partition?
1,516,899,074,000
I'm new with dbus, and saw different ways to log out from terminal depending on desktop env. But I'm curious is there any way to log out from any desktop env using dbus messages? On GNOME: dbus-send --session --type=method_call --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionMa...
On systemd setups you should be able to forcibly terminate a session via logind dbus interface: busctl call org.freedesktop.login1 /org/freedesktop/login1 \ org.freedesktop.login1.Manager TerminateSession s \ $(loginctl show-user $UID --property=Sessions --value) Note that busctl was introduced in systemd v. 221 - a...
Universal way to logout from terminal via dbus
1,516,899,074,000
I need to loop over the network interfaces available in Linux. I'm interested in all kinds of interfaces (loopback, ethernet, vlan, bridge) - whatever shows up in ifconfig -a. Is there a way to enumerate the interfaces in Linux? By any command or by reading a file?
You can get a list of these interfaces on most systems from the following: ls -A /sys/class/net But beware of parsing the output from ls in your script. Edit To get a total number of network interfaces pipe the output of this command into wc as recommended in Nikolay's comment as in: ls -A /sys/class/net | wc -l
How to find out the number of network interfaces available in a linux system?
1,516,899,074,000
I'm using Linux Mint 13 MATE 32bit, I'm trying to build the kernel (primarily for experience and for fun). For now, I like to build it with the same configuration as precompiled kernel, so firstly I've installed precompiled kernel 3.16.0-031600rc6 from kernel.ubuntu.com, booted to it successfully. Then I've downloaded...
Despite what file says, it turns out to be debugging symbols after all. A thread about this on the LKML led me to try: make INSTALL_MOD_STRIP=1 modules_install And low and behold, a comparison from within the /lib/modules/x.x.x directory; before: > ls -hs kernel/crypto/anubis.ko 112K kernel/crypto/anubis.ko And af...
Linux kernel manual build: resulting binary is 10 times larger than precompiled binaries
1,516,899,074,000
Having the following directory structure [sr@server directory]$ tree . ├── folder1 │   ├── fileA │   └── fileB └── folder2 └── fileC 2 directories, 3 files I want to set a default facl on folder1 and folder2 that, for the user jim has the following permissions . ├── folder1 --x │   ├── fileA r-- │   └── ...
What you request is not supported by Linux's ACLs. setfacl -m u:jim:r-X (capital X) gives Jim permission to read all files including directories, and to execute only directories and files that are executable by their owner. Making directories non-readable has very limited usefulness. If you tell us what you're trying ...
setfacl default --x on directories and r-- on files for user
1,516,899,074,000
I am trying to perform loadkeys operation. For normal user, I am getting permission denied error. the error is as follows. <tim@testps>~% loadkeys mykeys Loading /usr/tim/mykeys Keymap 0: Permission denied Keymap 1: Permission denied Keymap 2: Permission denied KDSKBENT: Operation not permitted loadkeys: could not de...
You need root capabilities to use loadkeys. It is common to set the setuid permission bit on loadkeys. Setting this bit will cause any processes spawned by executing the loadkeys file to run as the owner of the file (usually root). For added security, you should change loadkeys's permissions to 750, make a group for i...
Loadkeys gives permission denied for normal user
1,373,495,376,000
I'm almost to the point where I can post the solution I wound up with for my complex port bonding question. However, in reading the bonding.txt file, I see this option text: ad_select Specifies the 802.3ad aggregation selection logic to use. The possible values and their effects are: stable or 0 The active a...
Yes, given the following config: .-----------. .-----------. | Switch1 | | Switch2 | '-=-------=-' '-=-------=-' | | | | | | | | .-=----.--=---.---=--.----=-. | eth0 | eth1 | eth2 | eth3 | |---------------------------| | bond0 | '-------------------...
Bonds vs. Aggregators
1,373,495,376,000
I'm running on 4G RAM with an extra 6G swap partition, SSD is a pretty decent SAMSUNG MZMPA128HMFU model. System responds very well to workloads when things stay in RAM, but as soon as things reach the swap partition in any meaningful quantity (let say 1GB+ swap used), responsiveness goes completely down the drain du...
I'd strongly suggest getting more memory installed so that you are not swapping. Any swapping just KILLS the performance of a Linux or UNIX(tm) system. So install enough memory to stop the swap!
Linux (3.4) SSD swap partition usage causes extreme latency - how to eliminate?
1,373,495,376,000
I am setting up a machine to run a number of virtual machines. I am using a single HDD with a boot partition and an LVM partition. I read on the Arch wiki that logcial volumes which will be used for swap should be setup with -C y To create a contiguous partition, which means that your swap space does not get parti...
I am not aware of any requirement that swap space be contiguous on disk under Linux, with LVM or otherwise. I have never arranged for my swap LVs to be contiguous and have never run into any problem (it's possible that all my swap LVs just happened to be contiguous, I've never looked). Linux supports non-contiguous sw...
Does swap need to be on a contiguous LVM logical volume
1,373,495,376,000
I'm interested in running an rsync script whenever any new volume is mounted on my Debian box. What are some potential triggers / strategies for listening for a new volume mount?
You can create a new rule to /etc/udev/rules.d/. First read the file /etc/udev/rules.d/README. In the new rule file, add something like KERNEL=="sd?1",ACTION=="mount",RUN+="/path/to/script.sh" (I did not try the above line, try your own rules.) Note that the script will be run as root. You might want to use su to cha...
Run shell script when new volume mounted
1,373,495,376,000
I still have two old ATA drives (one is only 8GB, one is somewhat defect) and I've been thinking about putting them into my PC and activating swap on them, too. What will be effect of this? Will my system spread data across the drives evenly so that swapping becomes faster?
Firstly, using a slow or defective hard drive for swap is not a good idea. It's like having really slow or buggy memory in a way. How your system spreads data across your swap partitions depends on the priority you give them in your /etc/fstab As an example, /dev/hda5 none swap sw,pri=2 0 0 /dev/hdb5 none swap sw,pri=...
Can I accelerate swap by using multiple harddrives?
1,373,495,376,000
Is there a GNU Linux built-in for getting a list of the filenames of shared libraries? I have considered parsing the output of ldconfig -p. However, I'm not sure about consistency in output from system to system. I am already aware that I could use find but given that the linker / loader has a cache of libraries and...
If you want to catch them all, there is no other choice but to do full filesystem traversals. ldconfig knows only about the libraries in the standard paths and the extra paths it is configured to look in (usually defined in /etc/ld.so.conf*). The usual suspect places where other libraries can be found are $HOME and /o...
How do I get a list of shared library filenames under Linux?
1,373,495,376,000
I formatted an external hard drive (sdc) to ntfs using parted, creating one primary partition (sdc1). Before formatting the device SystemRescueCd was installed on the external hard drive using the command dd in order to be used as a bootable USB. However when listing devices with lsblk -f I am still getting the old FS...
From the output of lsblk -f in the original post I suspected that the signature of the installed SystemRescueCd was still present in the external hard drive. So I ran the command wipefs /dev/sdc and wipefs /dev/sdc1 which printed information about sdc and all partitions on sdc: [root@fedora user]# wipefs /dev/sdc DEVI...
Why is lsblk showing the old FSTYPE and LABEL of a device that was formatted?
1,373,495,376,000
Did some googleing and looked into the man pages, but didn't find specific answer for this numbers. For Example, # ip -d -stat ne show dev eth1 | column -t | sort -V 192.168.200.41 used 1034/4635/1032 probes 6 FAILED 192.168.200.44 lladdr 00:c0:b7:xx:xx:xx used 1037/1032/266 ...
After a look at iproute2 source code, the fifth fields gives timer information on ARP cache entries: X/./. : Number of seconds since the ARP entry was last used ./X/. : Number of seconds since the ARP entry was last confirmed ././X : Number of seconds since the ARP entry was last updated Those timers are notably use...
What is the fifth coloum in the output of "ip -stat neighbour show" stand for?
1,373,495,376,000
head -num is the same as head -n num instead of head -n -num (where num is any number) Example: $ echo -e 'a\nb\nc\nd'|head -1 a $ echo -e 'a\nb\nc\nd'|head -n 1 a $ echo -e 'a\nb\nc\nd'|head -n -1 a b c This head -1 doesn't seem to be documented anywhere. $ head --help Usage: head [OPTION]... [FILE]... Print th...
The info page and the online manual for GNU head contain this part: For compatibility head also supports an obsolete option syntax -[NUM][bkm][cqv], which is recognized only if it is specified first. The idea that head -1 is the same as head -n 1 is that the dash is not a minus sign, but a marker for a command lin...
Why isn't "head -1" equivalent with "head -n -1" but instead it's the same as "head -n 1"?
1,373,495,376,000
I'm working in an environment where I pretty much only have access to busybox tools, and trying to convert a date in the format Mon Jan 1 23:59:59 2018 GMT to a unix timestamp, in a shell script. I can't change the format of the input time I am parsing. It seems that busybox date can not understand this date format, o...
The busybox date2 is fully capable of parsing the date in the given string with some help1 (except for the GMT time zone). $ gdate='Mon Jan 1 23:59:59 2018 GMT' $ TZ=GMT0 busybox date -d "$gdate" -D '%a %b %d %T %Y %Z' Mon Jan 1 23:59:59 GMT 2018 The help is given with the -D option: a description of the source form...
How can I convert a date with a named month to a unix timestamp with only Busybox tools?
1,373,495,376,000
As you could notice from the topic it needs to be able get cpu's stepping code properly. As Wikipedia says there're stepping codes like A0, A2, B0 etc. So, commands in linux (ubuntu 16.04) give: # dmidecode -t 4 | grep Stepping | awk '{ printf $8": "$9"\n" }' # Stepping: 2 # lscpu | grep Stepping # Stepping: 2 # cpu...
There’s no way to map stepping numbers to stepping names using only information from the CPU. You need to look at specification updates from Intel; these contain descriptions of the errata fixed in various revisions of CPUs, and also contain identification information allowing the various steppings to be identified (w...
Get CPU stepping in Linux
1,373,495,376,000
When we perform this (on linux redhat 7.x) umount /grop/sdc umount: /grop/sdc: target is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) We can see that mount failed on busy. But when we do remount then ... remount is success as the following: mount -o rw...
man mount : remount Attempt to remount an already-mounted filesystem. This is commonly used to change the mount flags for a filesystem, especially to make a readonly filesystem writeable. It does not change device or mount point. The remount functionality follows the standard way how the mount command works with op...
what the difference between remount to umount/mount?
1,373,495,376,000
Sometimes I forget to run systemctl daemon-reload after editing some unit file, and I get a warning about it when doing systemctl restart ***.service. Why it was decided to only issue a warning instead of reloading the unit automatically? (the warning happens, so change was detected and so it is possible to simply aut...
It appears to be a specific design choice, based around race conditions and the complexity of reading the entire conf tree. However, one approach is to use systemctl edit, which triggers a unit reload after it exits. Some discussion of the issue here, and here.
Why can't systemd reload unit files automatically?
1,373,495,376,000
os: centos7 test file: a.txt 1.2G monitor command: iostat -xdm 1 The first scene: cp a.txt b.txt #b.txt is not exist The second scene: cp a.txt b.txt #b.txt is exist Why the first scene don't consume IO, but the second scene consume IO?
It could well be that the data had not been flushed to disk during the first cp operation, but was during the second. Try setting vm.dirty_background_bytes to something small, like 1048576 (1 MiB) to see if this is the case; run sysctl -w vm.dirty_background_bytes=1048576, and then your first cp scenario should show I...
why linux cp command don't consume disk IO?
1,373,495,376,000
It seems that every process has private memory mappings that are neither readable nor writeable nor executable (whose flags are "---p"): grep -- --- /proc/self/maps 7f2bd9bf7000-7f2bd9df6000 ---p 001be000 fc:00 3733 /lib/x86_64-linux-gnu/libc-2.19.so 7f2bd9e04000-7f2bda003000 ---p 00003000 fc:00 ...
Note that there are two memory regions of 2044KB with null permissions. As mentioned earlier, the ELF's 'execution view' is concerned with how to load an executable binary into memory. When ld.so brings in the dynamic libraries, it looks at the segments labelled as LOAD (look at "Program Headers" and "Section to Segm...
What is the purpose of seemingly unusable memory mappings in linux?
1,373,495,376,000
I have a SSD drive with LUKS encrypted partition. How to discard all data with one command? Or damage it to non-recoverable state? Even if partition is in use.
If your SSD is encrypted with LUKS, erase the header is good enough e.g dd if=/dev/urandom of=/dev/sda1 bs=512 count=20480 See the following link for details https://wiki.archlinux.org/index.php/Dm-crypt/Drive_preparation#Wipe_LUKS_header
Emergency wipe SSD
1,373,495,376,000
What do the terms CC, LD and SHIPPED refer to during the Kernel Source compilation process? Am I correct to assume that [M] indicates that it is being compiled as a module?
CC means that the file listed is being compiled from C by the C compiler. LD means that the file listed is being linked from a number of object files by the linker (ld); in this case, aacraid is built from a number of files including src.o. SHIPPED means that the file listed was shipped in the kernel source and is bei...
What do the terms CC, LD and SHIPPED refer to during the Kernel Source compilation process?
1,373,495,376,000
This question asks for the best way to create a directory when using mv if it doesn't exist. My question is why isn't this an inbuilt feature of mv? Is there some fundamental reason due to which this would not be a good idea?
Keep in mind that there is more than one implementation of mv. The mv you use on linux is not from the exact same source as the one on OSX or Solaris, etc. But it is desirable for them all to behave in the same way -- this is the point of standards. It's conceivable that a mv implementation could add an option for t...
Will `mv` ever have the ability to create directories?
1,373,495,376,000
I've noticed that some procs, such as bash, have their entire /proc/<pid>/ resources readable by the user who created that proc. However other procs, such as chrome or gnome-keyring-daemon, have most of their /proc/<pid>/ resources only accessible by root, despite the process itself being owned by the normal user and ...
Linux has a system call, which will change the dumpable flag. Here is some example code, which I wrote several years ago: #include <sys/prctl.h> ... /* The last three arguments are just padding, because the * system call requires five arguments. */ prctl(PR_SET_DUMPABLE,1,42,42,42); It may be that gnome-keyring-dae...
What causes /proc/<pid>/* resources to become owned by root, despite the procs being launched as a normal user?
1,373,495,376,000
I'm running a local vagrant VM, Ubuntu 13.10 with nginx reverse proxying to uwsgi. Running sudo /etc/init.d/nginx status returns * nginx is running However running sudo /etc/init.d/uwsgi status returns * which one? If I take a look at the log file for the wsgi app I can see that uwsgi is running, worker process...
Changing the pidfile option to pidfile2 seems to fix this issue. pidfile2 = /tmp/myapp-master.pid Interestingly the service uwsgi stop returns [OK] but the service uwsgi start returns [fail] So I'm assuming the error happens when a non privileged user (i.e. www-data) is trying to write to the pidfile which has been c...
"sudo service uwsgi restart" returns [fail] however uwsgi logs show processes have been created and python app is running
1,373,495,376,000
I found two ways to change the TTY font: dpkg-reconfigure console-setup editing /etc/default/console-setup Either way I'm limited to the fonts in /usr/share/consolefonts (I'm using Debian). How do I install new console fonts? What are the requirements for this kind of font? ... in particular: would it be possible t...
Installing FbTerm was what I went with to get nice fonts in my CLI environment. It's a frame buffer terminal emulator (so no need for X org) that supports nice rendering of the same kinds of fonts you would use in a GUI.
Changing TTY font to a non-default font
1,373,495,376,000
For ten years I have been generating billings for me and my wife in this way: Create TeX template with LyX or by hand Using in this source placeholder text Then: cat template | sed s/placeholder1/somevalue1/ |sed s/placeholder2/somevalue2 ... > output.tex pdflatex output.tex Sadly in last years this process is bec...
I have seen PDF files generated by using Python and ReportLab. In the open source version you have to do some programming to get to the output, but there are several examples and this should be straightforward for someone who could handle TeX. What I have not used but what seems even simpler is to use rst2pdf. The gen...
Easiest method to create pdf from template using command line (without pdflatex)?
1,373,495,376,000
I have made some changes to /etc/ssh/sshd file and wanted these effects should take place. I know I can run below command for the effects to take place. /etc/init.d/sshd reload But on my box I could not find /etc/init.d/sshd itself. So is there any other command can I run which is equivalent to /etc/init.d/sshd relo...
Try: $ sudo /etc/init.d/sshd restart systemd If that doesn't work and your using a distro such as Fedora/CentOS/RHEL and it's using systemd then try this: $ systemctl sshd.service reload You can get all the commands that sshd.service will accept by doing this. Hit the Tab key after typing the following: $ systemctl...
What are the commands to apply changes made to /etc/ssh/sshd_config?
1,373,495,376,000
192.168.25.1 = router 192.168.10.1 = gateway/modem 192.168.25.144 = this pc (which is 'linuxpc' running fedora 17) What happened during these log entry events below? Specifically what do the last two log entries mean. Oct 10 13:24:22 linuxpc dhclient[5779]: DHCPREQUEST on p14p1 to 192.168.25.1 port 67 (xid=0x466a6633...
First 3 lines are messages from dhclient which: sent a DHCP request to the router received DHCP lease set up the interface next 6 lines are from the NetworkManager, which basically restates the above in more detail reason probably is, that the dhclient instance was spawned by NM (rather silly if you ask me, but that...
Understanding /var/log/messages entries
1,373,495,376,000
Sometimes when using VoIP I experience disruptions. I would like to check if the problems could be caused by my internet provider. How could I best test the quality of my bandwidth (throughput and latency)? Until now, I have used a script which sends 3600 pings per hour and saves min/max/avg., but I am not sure how re...
MTR is probably the tool you're looking for. I've been using it for a long time and it's helped me troubleshoot a lot of network connectivity problems. It's like traceroute, but it runs continuously and shows you detailed info of every hop along the way. From the wiki: MTR relies on ICMP Time Exceeded (type 11, code ...
How to test the quality of my network connection for VoIP services
1,373,495,376,000
I am repeating tens of thousands of similar operations in /dev/shm, each with a directory created, files written, and then removed. My assumption used to be that I was actually creating directories and removing them in place, so the memory consumption had to be quite low. However it turned out the usage was rather hig...
Curious, as you're running this application what does df -h /dev/shm show your RAM usage to be? tmpfs By default it's typically setup with 50% of whatever amount of RAM the system physically has. This is documented here on kernel.org, under the filesystem documentation for tmpfs. Also it's mentioned in the mount man p...
operation in /dev/shm causes overflow
1,373,495,376,000
I am using initramfs to boot Centos via PXE. The initramfs used memory is listed within the "cached" value in /proc/meminfo or via free. Since I need to calculate performance data, I need to know whether the memory used by the initramfs is reclaimable (i.e. can be swapped out to disk) or not. Typically only a very sma...
EDIT: Answer updated/corrected. Although the kernel documentation about this topic says that "Rootfs is a special instance of ramfs (or tmpfs, if that's enabled) [...]", it is in reality still a ramfs, as a short look in the code shows (rootfs is not mentioned in mm/shmem.c). Some patches (see e.g. here and here) wer...
Can initramfs be paged out to swap disk?
1,373,495,376,000
I am attempting to extract a tarball (*.tgz, to be exact) and receiving terminal errors on extracted symlinks. Unfortunately, I cannot simply recreate the archive as this is a legacy archive for a system that no longer exists which was created before I was even out of high school (have to love working for a big compa...
-h (or --dereference) to dereference will only work upon creation. Reference: http://www.gnu.org/software/tar/manual/tar.html#SEC138 According to a similar answer here: How do I dereference links when extracting from a tar file? you can mount the archive then copy from it, though I have not tested this myself.
Ignore Symlinks when Extracting Tarball
1,373,495,376,000
I have a computer with two WD 1TB drives and I want to configure disk mirroring on it. I tried setting up RAID during the installation by creating RAID partitions but that does not work for me. Is there a convenient software that I can install to do the job for me? If no, what shell commands can be used? Once it is se...
You can do that. You need to be a bit careful, but this is not dangerous¹ if you are very careful not to mistype anything and it doesn't leave any gotchas in the setup. I highly recommend not doing any of the manipulations on a live system. It's possible in some cases but requires extra care. Boot from a liveCD/liveUS...
How to set up disk mirroring (RAID-1)
1,373,495,376,000
I've got hard system configuration there and I don't want to re-install it again but I need more space now. Current system space is 30GB. Seems like it's not possible to re-size disk so what I need is to re-init my system on new disk and here I have some questions. I will copy all the data to host machine first (wind...
Virtualbox images can be resized from outside Virtualbox. Run this command on the VDI: VBoxManage modifyhd SLACK.vdi --resize 100000 That last number is the size in MiB.
How to re-size virtual disk with installed Linux system?
1,306,122,705,000
We have many unused PC machines and we would like to use them to set up educational lab for high performance computing applications. Which Linux distribution is the most convenient to set up and easy to manage in educational environment? I would be thankful if someone provides me with a list of advantages and disadvan...
There's the rocks linux distro which is made for clustering, and is based on CentOS/RHEL. The strong point of rocks is that it'll for the most part manage and do a lot of the minutia for you. It'll do automatic installation and reinstallation, and if your computers can boot via PXE, the initial install will consist o...
Straightforward Linux Clustering
1,306,122,705,000
I would like to associate the Start menu with the Windows key on the keyboard?
In KDE 4, the sequence to find the shortcut key is System Settings -> Keyboard and Mouse -> Global Keyboard Shortcuts -> Plasma Workspace then modify the shortcut key for "Activate Application Launcher Widget". An alternative way to get to the shortcut is to simply right-click on the Kickoff menu and choose "Appli...
How to associate the Fedora Start menu with the Windows keyboard?