date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,339,116,601,000 |
Sometimes, when I have numerous tabs open in Firefox, one of those tabs will start consuming a lot of CPU%, and I want to know which tab is the culprit. Doing this is a very manual process for which I'd like to find automation.
I wish I had an application that could monitor firefox exclusively in a manner that produce... |
You can type about:performance in the address bar of firefox. Then you will get a table where there will be pid of each tab of firefox with Resident Set size and Unique Set Size. And below this there will be some lines explaining the performance of each tab (like performing well) and if a tab is not performing well th... | Monitoring CPU% of Tabs in Firefox |
1,339,116,601,000 |
The study guide LPIC-1 Training and Preparation Guide (Ghori Asghar, ISBN 978-1-7750621-0-3) contains the following question ...
Which of the following commands can be used to determine the file type?
(A) file
(B) type
(C) filetype
(D) what
... and claims that the answer is: "(B) type".
But isn't "(A) file" the co... |
Yes it seems like your book is wrong.
The file command tells what kind of file it is. From the man file: "file -- determine file type".
A few examples:
$ file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.... | Is this study guide wrong about commands for determining file types? |
1,339,116,601,000 |
I have disabled system beeps locally by adding set bell-style none to my local .inputrc file; however, when remote ssh to machines I will still get system beeps for using TAB for autocomplete, which I do a lot. I know I can modify the remote machine's .inputrc file or the remote accounts .bashrc file, but that is intr... |
Here's a workaround, first, create a file .inputrc.mine in the home directory of your remote user with line
set bell-style none
then log in to the server using
ssh -t user@server 'export INPUTRC=~/.inputrc.mine; /bin/bash'
Without -t your bash would not work (input/output redirected to the previous command).
| Disable System Beeps over SSH |
1,339,116,601,000 |
Looking to learn about game development? Are you a Linux enthusiast looking to test the claim that "Linux runs on everything"? Perhaps you are a software developer who is looking to release for multiple architectures, and you don't have another MIPS Little Endian machine on-hand for testing your programme. Whatever yo... |
First of all there are several prerequisites for installing Linux on your PS2, please note that this guide is aimed at installation on a slim PS2, if you have a fat PS2 you should download and install the copy of Sony's PS2 Linux here: [link] (https://sourceforge.net/projects/kernelloader/files/Sony%20Linux%20Toolkit/... | How to install Linux on the Playstation 2 |
1,339,116,601,000 |
A trivially conflicting package foo can be made to work with bar, by running dpkg --force-conflicts -i foo. But eventually it's time to upgrade, and 'apt-get' objects:
% apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f in... |
Since OP asked for a list of commands (with which to change the relevant metadata of the package) in the comments to Gilles' answer, here it is:
# download .deb
apt download parallel
# alternatively: aptitude download parallel
# unpack
dpkg-deb -R parallel_*.deb tmp/
# make changes to the package metadata
sed -i \
... | Set apt-get options to tolerate harmless 'dpkg --force-conflicts' kludge? |
1,339,116,601,000 |
How can I get hard disk capacity, usage, etc. using the /proc or /sys filesystems?
If it is possible, please tell me which file(s) I need to process to get that information.
|
This is Answer
cat /sys/block/sda/size
Above file will returns some number like 312581808, then this number need to multiply by 512 standard block size then u ll get long int value in bytes, then u can convert to GB.
| How to get hard disk information from /proc and/or /sys |
1,339,116,601,000 |
I was playing a game on Steam and all a sudden I got a kernel panic. I manually shut down the computer and booted back into Linux Mint 17.1 (Cinnamon) 64-bit, and went to go check through my log files in /var/log/, but I couldn't find any references or any kind of messages relating to the kernel panic that happened.
I... |
To be sure that your machine generates a "core" file when a kernel failure occurs, you should confirm the "sysctl" settings of your machine.
IMO, following should be the settings (minimal) in /etc/sysctl.conf:
kernel.core_pattern = /var/crash/core.%t.%p
kernel.panic=10
kernel.unknown_nmi_panic=1
Execute sysctl -p aft... | Kernel Panic dumps no log files |
1,339,116,601,000 |
This is something that has been so confusing to me for a long time.
I am using Linux but I have gaps in my understanding of certain aspects and one is about the terminal.
As I came to understand it what we mean with the console is an emulator of old terminals.
But I can not understand what is the deal with this.
As I ... |
Weird aspects of Unix usually exist for good reason, so you're right to look for one. In this case, though, the good reason has long since become obsolete, and you're looking at an antique artifact of a bygone era.
Just about the only "terminal" in existence today is xterm & variants. Their capabilities vary very s... | Why do we need so many terminal emulator packages and what is their use? |
1,339,116,601,000 |
When I installed my SSD I just mounted with discard and didn't sweat it. However today I was reading about the pros and cons of using fstrim instead and decided to run the program to get an idea of how long it would actually take (still with my partitions mounted with discard). The command took several minutes on both... |
Two things here:
fstrim trims all the data that is unallocated in the filesystem (well, not really all the data, only the data blocks that are not allocated, I don't think the unused parts of the inode table or the parts of not-completely used blocks are trimmed), regardless of whether discard is in used or not. fstr... | fstrim trims more than half of partition size even though partition mounted with discard |
1,339,116,601,000 |
mkdir ~/mnt/2letter
echo PASSWORD | sshfs -o password_stdin www-data@localhost:/var/www/sites/2letter ~/mnt/2letter -o sshfs_sync,cache=no,password_stdin
After this:
$ ls -ld ~/mnt/2letter/
drwxr-xr-x 1 www-data www-data 4096 Jan 28 21:29 /home/porton/mnt/2letter/
I need to access /home/porton/mnt/2letter/ under my UI... |
Try chucking in the two following options
-o idmap=user,uid=<YOUR UID>
| UID/GID with sshfs of Linux FUSE |
1,339,116,601,000 |
Given a device file, say /dev/sdb, is it possible to determine what driver is behind it?
Specifically, I want to determine what driver my storage devices are using. fdisk -l lists 2 devices: /dev/sda and /dev/sdb. One is a SATA hard drive and the other is a USB Mass Storage device - actually an SD card.
How do I deter... |
Run udevadm info -a -n /dev/sda and parse the output. You'll see lines like
DRIVERS=="ahci"
for a SATA disk using the ahci driver, or
DRIVERS=="usb-storage"
for an USB-connected device. You'll also be able to display vendor and model names for confirmation. Also,
ATTR{removable}=="1"
is present on removable devices... | What driver is behind a certain device file? |
1,339,116,601,000 |
I got an external Debian server. The problem is that my university campus doesn't allow connections to go outside when the port is different than TCP port 22, 80, 443, or UDP port 123. I tested them manually. On my Debian server I would like to listen to all my UDP and TCP ports so I can clearly figure out which TCP a... |
tcpdump usually comes as standard on Linux distros. It will log all packets visible at the server note that
you probably want to set it running with a filter for your client IP to cut down on the noise
I think this includes packets not accepted by iptables on the local machine - but you might want to test this
e.g... | How to listen to all ports (UDP and TCP) or make them all appear open in Debian |
1,339,116,601,000 |
Currently, I have something like:
iptables -A INPUT -p ICMP --icmp-type 8 -j DROP
iptables -A INPUT -s x.x.x.x -p ICMP --icmp-type 8 -j ACCEPT
However, when I run the second command, it looks as if iptables just stops. I have to break out of it to get back to terminal. Perhaps I am doing it all wrong, but some insi... |
You need to run your rules in the opposite order. Iptables is sensitive to the order that commands were run. If a rule matches, it doesn't go on to check more rules, it just obeys that one. If you set the drop first, the accept rule will never get tested. By setting the specific accept with the source IP, then setting... | iptables drop all incoming ICMP requests except from one IP |
1,339,116,601,000 |
I have a statically linked binary for a tool that I'm trying to run on RHLE4. The tool complains about glibc. It needs 2.4 and the one in the system is 2.3.
Here is the message that it spits out:
./wkhtmltoimage-i386: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by ./wkhtmltoimage-i386)
Is there a way ... |
Since the source code for this wkhtmltoimage tool is available, I'd
suggest you
recompile it
from source with your system's native glibc. It will likely be even
quicker than recompiling glibc, which is no easy task.
A statically linked executable already includes code for all the C
library calls it needs to make, so ... | Running a statically linked binary with a different glibc |
1,339,116,601,000 |
ps -o pid,ppid,stat,exe -e | grep deleted
generates output like this:
1777 1346 Sl /usr/bin/python3.10 (deleted)
1778 1346 Sl /usr/bin/python3.10 (deleted)
1825 1327 Ss /usr/lib/bluetooth/obexd (deleted)
2007 1 Sl /usr/bin/python3.10 (deleted)
2101 1346 S /usr/bin/python3.1... |
On Linux, ps gets that information by doing a readlink("/proc/<pid>/exe").
$ ls -l /proc/self/exe
lrwxrwxrwx 1 chazelas chazelas 0 Dec 17 10:35 /proc/self/exe -> /usr/bin/ls
That file is a magic symlink to the file that the given process (or any of its ancestor as not all processes execute files) last executed. If th... | ps -o pid,ppid,stat,exe -e | grep deleted has "(deleted)" appended to the executable path |
1,339,116,601,000 |
Environment:
I am using a CentOS-7 as a hypervisor for running several LXCs under libvirt. Each container runs a minimal installation of CentOS-7 with cut down FreePBX (Asterisk, Apache, MySQL + bits).
Symptoms:
There are 16 containers running without any problems. When I start one more it does start, but after the 17... |
I believe you are not hitting a global limit, but an inotify limit. This would be seen on containers running systemd because systemd uses the inotify facility for its bookkeeping, but the host would also be affected. Containers not using systemd (nor inotify) would probably be unaffected.
/proc/sys/fs/inotify/max_use... | "Error: Too many open files" while starting service in environment with several LXCs |
1,339,116,601,000 |
lseek man page:
When users complained about data loss caused by a
miscompilation of e2fsck(8), glibc 2.1.3 added the link-time
warning
"the llseek function may be dangerous; use `lseek64
instead."
This makes this function unusable if one desires a warning-free
compilation.
Since glibc 2.28, this function symbol is ... |
The problem was that glibc included a llseek symbol, with no corresponding declaration in its header files. e2fsck’s configuration script detected the symbol, and assumed that meant the function was usable. However, the implicit function declaration didn’t match what the function expected, and the function call ended ... | What happened to llseek and e2fsck? |
1,564,750,780,000 |
On Ubuntu 18.04 I create a RAID 1 array like this:
mdadm --create /dev/md/myarray --level=1 --run --raid-devices=2 /dev/sdc /dev/sdd
I then add the output of mdadm --detail --scan /dev/md/myarray to /etc/mdadm/mdadm.conf. It looks like this:
ARRAY /dev/md/myarray metadata=1.2 name=MYHOSTNAME:myarray UUID=...
The dev... |
How do I get a consistent device path for my MD device, ideally the exact one I specified ("/dev/md/myarray")?
After mdadm --create /dev/md/foobar ..., both hostname and name are stored in the mdadm metadata, as you should verify with mdadm --examine or mdadm --detail:
# mdadm --detail /dev/md/foobar
Name... | MD device name changing to include "HOSTNAME:" after first reboot. How do I get a consistent name? |
1,564,750,780,000 |
I have a laptop running linux with nvidia optimus/intel hybrid graphics where all outputs are connected to the intel card. It is driven by the i915 driver.
An external monitor or beamer is discovered only one time a boot cycle: If I disable or unplug it (and then plug it again), it cannot be enabled again, because the... |
This isn't the xrandr-approach the I know works in X, but for console you can try this — you can write to that /sys/class/drm/card0-DP-1/status file as well. I couldn't find proper documentation, but thankfully Linux is open source. Reviewing the source code, it looks like it takes a few values: detect, on, on-digital... | How to make linux detect/re-probe monitors with intel i915 driver? |
1,564,750,780,000 |
How could I check the file system format of a disk image?
I know that I can check with the file command but I would like to automate the behaviour.
$ file img.raw
img.raw: data
$ file img.ext4
img.raw: Linux rev 1.0 ext4 filesystem data, UUID=346712e7-1a56-442b-a5bb-90ba4c6cc663 (extents) (64bit) (large files) (h... |
Finally found what I needed
blkid -o value -s TYPE <image> will return the fs type or nothing if it's raw data.
EDIT:
As mentioned by @psusi, parted has a machine parsable output. I find it less convenient than using blkid but it could also be useful.
parted -m <image> print | tail -n +3 | awk -F ":" '{print $(NF-2... | Check disk image file system type |
1,564,750,780,000 |
I have a script running in a server and it will create many sub-processes( around 800 ). I want to kill them all in one stretch. Below is the ps information.
root 26363 0.0 0.0 119216 1464 ? Ss Mar02 0:00 SCREEN -S website_status
root 26365 0.0 0.0 108472 1844 pts/12 Ss Mar02 0:00 \_ /b... |
Have you tried pkill -signal -P ppid?
From the pkill manual:
pkill - look up or signal processes based on name and other attributes
-signal Defines the signal to send to each matched process
-P ppid Only match processes whose parent process ID is listed
If you wanted to kill 2432, and all its children, you shoul... | Best way to kill processes created by bash script? |
1,564,750,780,000 |
I will be using Ubuntu Linux for this project.
For training of a particular application at a conference I need:
To have each student be able to ssh into the same user account on a server
Upon each login automatically put the user in separate isolated environments
Each isolated environment includes the application, ex... |
With Docker you can do this very easily.
docker pull ubuntu
docker run -t -i ubuntu /bin/bash
# make your changes and then log out
docker commit $(docker ps -a -q | head -n 1) sandbox
cat > /usr/local/bin/sandbox <<EOF
#!/bin/sh
exec docker run -t -i --rm=true sandbox /bin/bash
EOF
chmod a+x /usr/local/bin/sandbox
... | replicate and isolating user environments on the fly |
1,564,750,780,000 |
I have a daemon that uses syslog(3) to log to a file that is not a descendant of /var/log. Currently, this requires that SELINUX be disabled. How can I configure an enabled SELINUX to allow this logging?
I am an SELINUX novice. Any guidance or advice would be appreciated.
|
If you look at the context set for the directory /var/log you'll noticed the following things.
First, the directory /var/log has the following selinux context set:
$ ls -Z /var | grep "log$"
drwxr-xr-x. root root system_u:object_r:var_log_t:s0 log
Second, the log file, /var/log/messages, has no additional conte... | Configuring SELINUX to allow logging to a file that's outside /var/log |
1,564,750,780,000 |
I am on Linux 2.6.32-26-generic
When I look in to the linux source code for "ioctl.h" hearer file, I could see many variants. (for different platforms, I guess). i.e.
./fs/ocfs2/ioctl.h
./fs/btrfs/ioctl.h
./fs/ceph/ioctl.h
./include/config/i2o/config/old/ioctl.h
./include/asm-generic/ioctl.h
./include/linux/hdlc/ioctl... |
I believe file is being included is /usr/include/sys/ioctl.h (not from /usr/src/linux or some). And on my system it belongs to glibc, not kernel or kernel-headers.
Actually, nothing gets included from kernel source - headers inside /usr/src/linux (or so) are being used only for kernel compilation. If some software nee... | "sys/ioctl.h" header in linux |
1,564,750,780,000 |
I want to migrate the configuration of an Ubuntu desktop to a new box with different hardware. What is the easiest way to do this? /etc/ contains machine and hardware specific settings so I can't just copy it blindly. A similar problem exists for installed packages.
edit: This is a move from x86 to x86-64.
|
First, if you're going to keep running 32-bit binaries, you're not actually changing the processor architecture: you'll still be running an x86 processor, even if it's also capable of doing other things. In that case, I recommend cloning your installation or simply moving the hard disk, as described in Moving linux in... | How do I migrate configuration between computers with different hardware? |
1,564,750,780,000 |
I set a group called music, using the command groupadd -g 500 music.
Then I add alice to the music group, and set alice to be the admin of the music group, using these two commands gpasswd -a alice music and gpasswd -A alice music.
Now alice can add people to the music group without the foil of the denied permission, ... |
You can set the administrators list to the empty list:
gpasswd -A '' music
which will revoke such privilege.
The actual storage of the administrators information is in the 3rd field of the entry in /etc/gshadow, the shadow side of /etc/group, as described in gshadow(5):
Each line of this file contains the following... | How to cancel the admin permission of a group? |
1,564,750,780,000 |
A simple example. I'm running a process that serves http request using TCP sockets. It might A) calculate something which means CPU will be the bottleneck B) Send a large file which may cause the network to be the bottleneck or C) Complex database query with semi-random access causing a disk bottleneck
Should I try to... |
Linux:
The Linux kernel have a great implementation for the matter and have many features/settings intended to manage the ressources for the running process (over CPU governors, sysctl or cgroup), in such situation tuning those settings along with swap adjustment (if required) is recommended, basically you will be ada... | Should I attempt to 'balance' my threads or does linux do this? |
1,564,750,780,000 |
I've downloaded my contact list in a .vcf format to my linux machine. I would like to be able to consult it without having to connect to the internet. The search feature is most important. I've got a script with grep and so on but I was hoping someone had already done the work to make things beautiful and readable.
|
There are a number of console-based tools designed to process vCard files; I know of the following:
Rolo, a full-screen address-book manager;
Khard, a console-based CardDAV client (which works fine with locally-stored vCard files);
mutt_vc_query, a simple querying tool for vCard files (designed for Mutt, but usable s... | Is there a linux local tool to view, search, add contacts to/from a .vcf file? |
1,564,750,780,000 |
Suppose I don't know where my Django source is stored, but I know that it contains these directories in this way: django/contrib/admin.
How can I use the find command or any more appropriate coreutils command to find where this partial directory path (structure) is available?
Example output:
/home/me/python/extracted/... |
You should use -path flag for such purpose
find /home/me -path "*django/contrib/admin*"
| How to find a partial directory path? |
1,564,750,780,000 |
Based on what I have read about pseudoterminals in Linux, there are two types of pseudoterminals: BSD-style pseudoterminals (which is deprecated) and UNIX 98 pseudoterminals.
I have created two images that shows my understanding of these two types of pseudoterminals.
The following image shows how the BSD-style pseudot... |
You are curiously fascinated by names. /dev/ptmx is not a "driver", it's just a name in the filesystem, which has a special meaning.
A process opens a new master pty by calling posix_openpt(), which returns a file descriptor; the same effect can be achieved by calling open() on /dev/ptmx. Each time a process calls ope... | BSD-style pseudoterminals vs. UNIX 98 pseudoterminals |
1,564,750,780,000 |
In FreeBSD there are an utility to support circular log files called clog.
This is very interesting for avoid the maintenance of the logs of some services (outside systemd and their journald).
Are there any alternative to do the same in linux and/or with rsyslog?
|
There are tools to do much the same in both FreeBSD and Linux, and other operating systems besides.
Making automatically-rotated strictly size-capped logs
The following tools maintain strictly size-capped, automatically rotated, rotateable-on-demand, log file sets in a directory that one specifies.
Dan Bernstein's ... | Circular log in linux [duplicate] |
1,564,750,780,000 |
I'm using CentOS 6.8
I'd like to know if I can I find all files with the .log extension and order by file size and display the file size next to the filename?
I'm currently using this command to find all files with the .log extension:
find . -name \*.log
|
This seems to work for me:
find . -name \*.log -ls | sort -r -n -k7
where...
find = https://man7.org/linux/man-pages/man1/find.1.html
. = current folder
-name = allows you to search for a file name pattern, in this case the asterisk is preceded by a slash to allow it to be a wildcard.
-ls = lists output in ls -dils ... | Can I find all files with the .log extension and order by file size? |
1,564,750,780,000 |
Situation: increase swap size (/dev/sda3) greater than Ram (8 GB) when HD 128 GB
Motivation: 8 GB RAM is too little; 30 GB free space in my SSD; I want to turn 20 GB to SSD swap
Characteristics of system
Swap non-immutable/changeable. I cannot find any evidence why /mnt/.swapfile should be immutable so you do not nee... |
You just want to increase the swap size on your system using the space from sda2. Your sda2
/dev/sda2 104G 74G 25G 75% /
You can add additional swap space to your system by using swap file created on / that will utilize your sda2. Just do:
dd if=/dev/zero of=/swapfile bs=20480 count=1M
and then do:
sudo... | How to Allocate More Space to Swap and Increase its Size Greater than Ram? |
1,564,750,780,000 |
I'm trying to understand how Linux capabilities are passed to a process that has been exec()'d by another one. From what I've read, in order for a capability to be kept after exec, it must be in the inheritable set. What I am not sure of, though, is how that set gets populated.
My goal is to be able to run a program a... |
It turns out that setting +i on the wrapper does not add the capability to the CAP_INHERITABLE set for the wrapper process, thus it is not passed through exec. I therefore had to manually add CAP_DAC_OVERRIDE to CAP_INHERITABLE before calling execl:
#include <sys/capability.h>
#include <stdio.h>
#include <unistd.h>
i... | Passing capabilities through exec |
1,564,750,780,000 |
Is there a way to generate cartesian product of arrays without using loops in bash?
One can use curly brackets to do a similar thing:
echo {a,b,c}+{1,2,3}
a+1 a+2 a+3 b+1 b+2 b+3 c+1 c+2 c+3
but I need to use arrays as inputs, and most obvious tricks fail me.
|
You could use brace expansion. But it's ugly. You need to use eval, since brace expansion happens before (array) variable expansion. And "${var[*]}" with IFS=, to create the commas.
Consider a command to generate the string
echo {a,b,c}+{1,2,3}
Assuming the arrays are called letters and numbers, you could do that ... | Array Cartesian product in bash |
1,564,750,780,000 |
Yesterday I had to install a Windows with its Grub override.
Well, it's not the first time I had to fix Grub, so I used LiveCD, mounted the root partition (I don't have boot, just / and home) and ran grub-install --root-directory=/mnt/ /dev/sda. However, it didn't work.
After Googling a while I found a tutorial in whi... |
proc and sys filesystems are provided by the running kernel -- when the kernel is not running, they cease to exist. This means that when you chroot into another operating system, these filesystems are not present. Many programs expect them to exist so that they can function, for example, they may require information a... | What are these commands for? |
1,564,750,780,000 |
Environment
My LAN setup is quite basic:
A router connected to the ISP's modem and the internet
My development pc directly connected to the router
The router provides DHCP but does not run its own DNS server. In fact, there is no DNS server hosted anywhere on my LAN (typical home network setup). The router is config... |
Is 192.168.1.1 your router's IP address?
nameserver 192.168.1.1 suggests your router is advertising itself as a DNS server, rather than "sending the ISP's DNS servers".
What brand and model of router do you have? Does the web interface show log messages?
I'm wondering if your router is forwarding the request to your ... | Reverse DNS lookups slowing down network operations on LAN |
1,564,750,780,000 |
Is there any way to change the brightness and color? Using any command line tools?
I am trying in Fedora and Ubuntu but no luck so far.
Follow up:
[command] [conneccted output] [effects R:G:B, value 0 to 255]
| / | / | /
^ ^ ^ ^ ^ ... |
You can modify gamma settings (colors and effectively contrast too) using xrandr tool. First determine the output name of your monitor:
$ xrandr -q | grep connected
DFP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
CRT1 disconnected (normal left inverted right x axis y axis)
In ... | How to use command line to change brightness and color? |
1,564,750,780,000 |
I'm experimenting with generating some custom kernels using genkernel.
However, each iteration leaves a file in /boot called System.map-genkernel-<arch>-<version>.
Is it safe to rename and/or delete the System.map-* files?
|
The System.map file is mainly used to debug kernel crashes. It's not actually necessary, but it's best to keep it around if you're going to use that kernel. If you've decided you don't need that kernel, then it's safe to delete the corresponding map file.
If you're really low on disk space, you could compress the ma... | Safe to delete System.map-* files in /boot? |
1,564,750,780,000 |
I'm trying to delete a bunch of old ZFS snapshots but I get errors saying that the datasets are busy:
[root@pool-01 ~]# zfs list -t snapshot -o name -S creation | grep ^pool/nfs/public/mydir | xargs -n 1 zfs destroy -vr
will destroy pool/nfs/public/mydir@autosnap_2019-02-24_03:13:17_hourly
will reclaim 408M
cannot des... |
This appears to be unintended behavior on ZoL, I left the ZFS box alone for a few days and finally gave up and rebooted the said box, and I was able to destroy those snapshots after reboot.
| ZFS on Linux: cannot destroy snapshot, dataset is busy |
1,564,750,780,000 |
After getting a new VPS with Debian 9, I created a new user using root.
I created a new username called joe with this command adduser joe. Then, I used usermod -aG sudo joe to grant administrative privileges.
After that, I logged out and used Putty to login as joe. I entered the password for joe. After entering the pa... |
Apparently /home/joe doesn't have execute permission for the user. Execute permission for the directory allows to traverse it.
Try sudo chmod 755 /home/joe and then log in again.
| Could not chdir to home directory /home/user: Permission denied |
1,564,750,780,000 |
I use CentOS 7 with kernel 3.1.0
I know there is a hitman in Linux called oom killer which kills a process that uses too much memory out of available space.
I want to configure it to log the activities so that I can check whether it happens or not. How can I set it up?
Thanks,
|
OOMkiller's activities are guaranteed to be in /var/log/dmesg (at least for a time). Usually the system logger daemon will also put it in /var/log/messages by default on most distributions with which I've worked.
These commands might be of help in tracking the logs down:
grep oom /var/log/*
grep total_vm /var/log/*
... | How to make OOM killer log into /var/log/messages when it kills any process? |
1,564,750,780,000 |
Today I removed my GPU out of an Linux (Ubuntu) machine, and after that the ethernet stopped working. Running 'service networking restart' threw an error message, and when I ran 'ifconfig' only the local loopback was visible. After this I re-installed my GPU and out of nowhere the internet started working again??
I wo... |
Your networking devices are renamed to correspond with their location on the PCI bus. When you removed your GPU, your ethernet device changed from enp2s0 to enp1s0.
In order to reconnect, you have a few options:
Create profiles for enp1s0 that match those of enp2s0
Change the rules for naming devices to give this car... | Internet not working without gpu installed? |
1,564,750,780,000 |
In bash, the following works for setting the date from a UNIX timestamp ( seconds from the epoch ):
date +%s -s @`date +%s`
In Busybox, this does not work. How can I do the same for the date command with Busybox? Thanks.
|
Try
date @`date +%s`
I don't think it's got anything to do with bash.
Busybox's date command is a lightweight version of the more classic GNU/FSF date
| BusyBox Date Command Set Time with UNIX Timestamp |
1,564,750,780,000 |
On my CentOS 7, at one point, sudo ss -plt listed a port marked as LISTENING on *:30565, but there was no information whatsoever in the process column of its row. The other listening ports were showing their owning process as usual, like users:(("sshd",pid=1381,fd=3)), but that one row did not have any process informa... |
The point on netstat not showing the process information on some situations, for instance NFS, is that NFS is a kernel module, and as such, it does not run as a normal process, and does not have a PID.
You can regularly find threads about this situation if including NFS on your google searches:
netstat doesn't report ... | "netstat -p"/"ss -p" not showing the process of a listening port |
1,564,750,780,000 |
Without initramfs/initrd support, the following kernel command line won't work:
linux /bzImage root=UUID=666c2eee-193d-42db-a490-4c444342bd4e ro
How can I identify my root partition via UUID without the need for an initramfs/initrd?
I can't use a device name like /dev/sda1 either, because the partition resides on a... |
I found the answer burried in another thread:
A UUID identifies a filesystems, whereas a PARTUUID identifies a partition (i.e. remains intact after reformatting). Without initramfs/initrd the kernel only supports PARTUUID.
To find the PARTUUID of the block devices in your machine use
sudo blkid
This will print, for... | How to identify root partition via UUID without initramfs/initrd |
1,564,750,780,000 |
I have a 24/7 always-on Debian Jessie based headless home server that has a large 1TB SSD for the OS and all of my frequently accessed files. This same system has 4 larger hard disk drives in a SnapRAID array. These are mainly for archiving infrequently accessed Blu-rays and want those drives to remain spun down in st... |
You can use blktrace (available in Debian) to trace all the activity to a given device; for example
sudo blktrace -d /dev/sda -o - | blkparse -i -
or just
sudo btrace /dev/sda
will show all the activity on /dev/sda. The output looks like
8,0 3 51 135.424002054 16857 D WM 167775248 + 8 [kworker/u16:0]
... | hard disks spin up by processes / applications that simply get a list of disks? How to prevent? |
1,564,750,780,000 |
What I'm trying to do:
I'm trying to scan my File-Server for malware, and I'm using clamav/clamscan, where the man page say's it can scan files up to 4GB.
This man page states:
--max-filesize=#n
Extract and scan at most #n kilobytes from each archive. You may pass
the value in megabytes in format xM or xm, where x... |
I've found this(thanks to @FloHimself): Brief Re-introduction to ClamAV Bytecode Signatures, it's an good overview/supplement of some of the usages of the program and some useful options:
Excerpt:
Bytecode signatures are a specialized type of ClamAV signature which
is able to perform additional processing of the sc... | Warnings/Errors when running clamav/clamscan, scanning 3TB hard-drive |
1,564,750,780,000 |
I have win 7 and linux mint 14 installed. Is it possible to modify the GRUB Menu to show Windows as the first option instead of Linux, which it currently does. Mainly so that during boot it starts Windows by default.
|
If the order of your boot menu is important (and not just that Windows boots by default), and you don't have anything bootable besides Linux Mint and Windows (like OSX, BSD) you can do:
cd /etc/grub.d
mv 30_os-prober 09_os-prober
as the alphabetical order of the files in /etc/grub.d, determines in what order they are... | reorder GRUB to list Windows on top |
1,564,750,780,000 |
I have a VPS I'm planning to delete. This particular cloud provider makes no guarantee that the data on the drive will be wiped before giving the disk to the next person. What's a best effort attempt I can make to secure-wipe sensitive data (whether existing as files or as deleted data) on the drive?
Assume the provi... |
Use the scrub command1 on the user data portions2 of the VPS filesystem.
BEWARE: The following commands purposely destroy data.
Here is a list of ideas for scrubbing targets, in a sensible order, but you may need to vary it for your particular VPS configuration:
Databases, typically stored under /var. For instance, i... | Secure wipe (scrub) filesystem of VPS from VPS itself |
1,564,750,780,000 |
I have an embedded system using jffs2 and want to pass rootflags=noatime in the kernel bootargs parameter.
This results in a kernel panic:
jffs2: Error: unrecognized mount option 'noatime' or missing value
[...]
No filesystem could mount root, tried: jffs2
Kernel panic - not syncing: VFS: Unable to mount root fs on u... |
Googling rootflags noatime brings up this post from 2003 by Andrew Morton, perhaps it still applies.
http://lkml.org/lkml/2003/8/12/236
While testing something, I tried to boot with 'rootflags=noatime', and
found the system wouldn't boot, as ext3, ext2, and reiserfs all failed to
recognize the option. Looki... | Kernel panic when passing noatime in bootargs |
1,564,750,780,000 |
Normally when system starts you have all output printed on the TTY1, and that's ok, but I start X-server via startx and achieve this by the following lines in the ~/.profile file :
if [[ $(tty) = /dev/tty4 ]]; then
exec startx &> ~/.xsession-errors
fi
So, as you can see I use TTY4 to start X-server, and I want to... |
I've found the answer. It's simple, you just have to add chvt 4 to /etc/rc.local file, and that's it.
| How to change the default TTY after boot? |
1,564,750,780,000 |
SERVER:/etc # ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 96069
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files ... |
Use pam_limits(8) module and add following two lines to /etc/security/limits.conf:
root hard nofile 8192
root soft nofile 8192
This will increase RLIMIT_NOFILE resource limit (both soft and hard) for root to 8192 upon next login.
| How to modify ulimit for open files on SUSE Linux Enterprise Server 10.4 permanently? |
1,314,161,608,000 |
If I'm using Ubuntu 11.04, how can I configure it such that that only two users can shut down/suspend/hibernate my PC: the root user and one regular user?
|
The shutdown binary will only work for the root user. The typical approach to this is to set up sudo rules to allow the user to execute shutdown as root. Assuming the user doesn't already have full sudo permissions
(the first user on an Ubuntu desktop system does, for example) you might add the following line to /e... | How can I set that only root + a given user can shut down my pc? |
1,314,161,608,000 |
Given a host that is in an unknown state of configuration, I would like to know if there is an effective way of non-interactively determining if the firewall rule set in place is managed by iptables or nftables.
Sounds pretty simple and I've given this quite a bit of thought, but haven't come back with a meaningful an... |
A variant of this problem was addressed recently in Kubernetes, so it’s worth looking at what was done there. (The variant is whether to use iptables-legacy or iptables-nft and their IPv6 variants to drive the host’s rules.)
The approach taken in Kubernetes is to look at the number of lines output by the respective “s... | Check whether iptables or nftables are in use |
1,314,161,608,000 |
Let's say I have the following trivial script, tmp.sh:
echo "testing"
stat .
echo "testing again"
Trivial as it is, it has \r\n (that is, CRLF, that is carriage return+line feed) as line endings. Since the webpage will not preserve the line endings, here is a hexdump:
$ hexdump -C tmp.sh
00000000 65 63 68 6f 20 22 ... |
As far as I’m aware, there’s no way to tell Bash to accept Windows-style line endings.
In situations involving Windows, common practice is to rely on Git’s ability to automatically convert line-endings when committing, using the autocrlf configuration flag. See for example GitHub’s documentation on line endings, which... | Handling Bash script with CRLF (carriage return) in Linux as in MSYS2? |
1,314,161,608,000 |
sudo dd if=/dev/sda of=/dev/null bs=1M iflag=direct
atopsar -d 5 # in a second terminal
top # in a third terminal
Results from atopsar :
19:18:32 disk busy read/s KB/read writ/s KB/writ avque avserv _dsk_
...
19:16:50 sda 18% 156.5 1024.0 0.0 0.0 5.0 1.15 ms
19:1... |
This was the result of a change in kernel version 5.0:
block: delete part_round_stats and switch to less precise counting
We want to convert to per-cpu in_flight counters.
The function part_round_stats needs the in_flight counter every jiffy, it
would be too costly to sum all the percpu variables every jiffy, so it
m... | `dd` is running at full speed, but I only see 20% disk utilization. Why? |
1,314,161,608,000 |
Using the command line tools available in a common GNU/Linux distro (e.g. Fedora/Debian/Ubuntu/etc), is there a general way to get the value of some specific WHOIS field (e.g. the registrant's organisation name), ideally without having to build a custom WHOIS parser that is hard-coded to handle the differences between... |
The problem appears to be at least two-fold:
WHOIS responses do not share a common schema, and
there is a dearth of WHOIS clients able to parse WHOIS responses and to map their fields (e.g. using a suitable ontology) onto a single schema. The Ruby Whois project is the most extensive effort I have found. It aims to pr... | Obtain WHOIS data field(s) without parsing? |
1,314,161,608,000 |
There's an issue with Ubuntu that hasn't been fixed yet, where the PC freezes or gets really slow whenever it is copying to an USB stick (see Why is my PC freezing while I'm copying a file to a pendrive?, http://lwn.net/Articles/572911/ and https://askubuntu.com/q/508108/234374).
A workaround is to execute the followi... |
These are sysctl parameters. You can set them either by writing to /proc/sys/CATEGORY/ENTRY or by calling the sysctl command with the argument CATEGORY.ENTRY=VALUE. These settings affect the running kernel, they are not persistent.
If you want to make these settings persistent, you need to set them at boot time. On Ub... | Pernicious USB-stick stall problem. Reverting workaround fix? |
1,314,161,608,000 |
I use Cinnamon on ArchLinux and Nemo is it's default file manager. I've tried 3 GUI file archivers (p7zip with WxGTK, peazip & file-roller), but none of them add a "compress option" in the context menu.
How can I add a "compress option" to Nemo's right click context menu?
|
custom nemo action
This ArchLinux wiki article titled: Nemo describes the steps required to create your own context menu item.
General steps
Create a .nemo_action file. The file has to have this extension! Here's an example virus scanner .nemo_action file:
clamscan.nemo_action:
[Nemo Action]
Name=Clam Scan
Comment=Cl... | How to make nemo support compressing files by context menu? |
1,314,161,608,000 |
I expected that timedatectl would update /etc/timezone when changing timezones, but no:
% sudo timedatectl set-timezone 'Asia/Kuala_Lumpur'
% cat /etc/timezone
Asia/Bangkok
Is there a reason that it doesn't? (Bug?)
If I manually update /etc/timezone to match timedatectl set-timezone, are there any side-effects I shou... |
timedatectl updates /etc/localtime, which is the documented way of setting the default timezone in most Linux-based environments (along with its override, the TZ environment variable, which is the only POSIX-defined way of specifying the timezone).
/etc/timezone appears to be mostly Debian-specific (including derivati... | `timedatectl set-timezone` doesn't update `/etc/timezone` |
1,314,161,608,000 |
I cannot ssh into my server from one of my Ubuntu installations, but if I use another Ubuntu installation or Windows operating system connecting with SSH works smoothly.
So something is broken in one of my Ubuntu installation and I'm struggling to find the exact problem.
I've tried reinstalling ssh/openssh-client/open... |
I've found solution for this problem (sorry for answering my own question).
I'm answering it because If someone has this problem then he/she can use solution that I found.
Actually problem is on both sides server as well as client side.
Server side problem was that /home/<user>/.ssh/known_hosts file on server was havi... | Can't ssh into my server from home linux but can ssh into same server from windows |
1,314,161,608,000 |
I know one situation of this will occur when u already installed the latest version of a package then it will occur.
is there any other situations that this error occur?
|
Yum shows this error when it is unable to proceed with the command.
There can be many reasons why this message could appear:
The package is already installed and up-to-date
The package does not exist on the configured repository
No repository is correctly configured
There was a problem fetching the package from the r... | when 'Error: Nothing to do' error occur in install through yum? |
1,314,161,608,000 |
I have a serial port /dev/ttyS2 that is connected to a supervisor. Normally, I use this line to send commands back and forth between CPU and supervisor.
However, under some settings, I want to just redirect the entire console to this port.
I can achieve this via a reboot and updating the uBoot kernel variable to dir... |
You could launch getty once you've booted to get a serial connection to your system. Note that this will not give you the default outputs typically seen with your console (Kernel Panics and other verbosities typically seen in console but not in normal terminals). But if you are just looking to get a login via serial a... | Redirect console to a serial port |
1,314,161,608,000 |
I'm interested in per-process network I/O counters, like those in /proc/net/dev and found what I thought was it under /proc/<pid>, i.e. /proc/<pid>/net/dev. But it seems that was too easy because they contain the same counters as the system.
If I diff between system and <pid> I get the same counters*. So that makes m... |
/proc/net/dev contains statistics about network interfaces, while /proc/<pid>/net/dev contains statistics about network interfaces from the process' point of view.
I suppose that if a process runs on a network namespace (see man ip-netns) where it has access only to a limited set of interfaces, only these will show u... | What is /proc/<pid>/net/dev? |
1,314,161,608,000 |
What I would like to achieve is an interactive program that runs either before or after asking the user for the password, but won't handle over the access to the computer unless it exited with success. To make it somewhat more understandable, here's an example:
I would like to gain access to my computer, by first writ... |
No stdout/stdin there at the PAM stage. You need to call pam_conv(3) via pam_get_item(3) to perform i/o.
Good example at ben.akrin.com including the relevant C source example.
pam_conv(3)
pam_get_item(3)
| How to add additional steps to login? |
1,314,161,608,000 |
I want systemd on mount /mnt/test to automatically call a program (in real life cryptsetup to unlock the underlying device, for testing here echo) before the file system is mounted and after it is unmounted.
With /etc/systemd/system/stickbak-encryption.service:
[Unit]
Description=stickbak encryption
Before=mnt-test.mo... |
I very recently asked myself the same question, but I quickly came to the realisation that it doesn't work that way.
When you use the mount command-line program, systemd is not involved: mount reads /etc/fstab (or takes options from the command-line) and mounts the device. When you start a systemd mount unit, it's par... | How to add a dependency to a systemd.mount that is activated by /bin/mount? |
1,314,161,608,000 |
How does Linux determine which network interface to use, when both are connected to the same network?
Note that this isn't a question on routing. I'm familiar with how that works. This is if, say, I have my laptop connected to my wireless router through both my ethernet card and my wireless card, or if I have two ethe... |
Well - this IS a routing-question.
The answer is simple: The first entry that will give the best routing-entry is "the winner". So look at netstat -rn to see which interface is first.
Update: The network-inferface-routing-settings normally get set up during system startup. So the startup order of network devices will ... | Network interface preference |
1,314,161,608,000 |
I am using prlimit in Ubuntu to do some resource restrictions in my sandbox which has been very helpful. However, I am not quite sure what to do with RLIMIT_NICE. The docs say:
RLIMIT_NICE (since Linux 2.6.12, but see BUGS below)
Specifies a ceiling to which the process's nice value can be
... |
In fact, RLIMIT_NICE allows you to bypass the basic rule that says that "a process can raise its nice value only if owned by root".
Demonstration:
# ulimit -e 30
# su nobody
$ nice -n -10 top
You will see that your top process runs with niceness -10.
Now if you try nice -n -11 top, it will run with niceness 0, becaus... | Is there any use for RLIMIT_NICE? |
1,314,161,608,000 |
I need to monitor the I/O statistics of a process that writes to disk. The purpose is to avoid write rates too high for long periods.
I know there's iostat tool to accomplish this task on a system-wide perspective.
Is there something similar to monitor single process disk usage?
|
What you want is iotop. Most distributions have a package for it, usually called (logically enough) iotop.
One very cool command (at least, on a system that isn't very busy) is iotop -bo. This will show I/O as it occurs. It also has options to only monitor specific processes or processes owned by specified users.
| Getting disk i/o statistics for single process in Linux |
1,314,161,608,000 |
Are there any linux/unix console applications similar to Yadis that would allow me to:
be set up from the console
backup multiple directories
backup / sync in real time after the files (text files) are changed
Update 1:
I write shell scripts, ruby scripts, aliases etc etc to make my work easier. I want to have back... |
You could probably hack this together using inotify and more specifically incron to get notifications of file system events and trigger a backup.
Meanwhile, in order to find a more specific solution you might try to better define your problem.
If your problem is backup, it might be good to use a tool that is made to ... | real time backup if file changed? |
1,314,161,608,000 |
Ok, Skype yet again has issues with sound. This time, it is unable to record audio. The system is using PulseAudio and I am using a web cam as a microphone. Actually, I tried another web cam and had both plugged in at one point. lsusb shows the devices plugged in. Skype only allows selecting pulseaudio as the inp... |
Try pavucontrol.
More information here - https://help.ubuntu.com/community/SkypeTroubleshooting#Selecting%20Microphone%20%28input%20device%29
yum install pavucontrol
You will have to select the right mic in the Recording tab of pavucontrol
| Sound input issue with skype, selecting a microphone? |
1,314,161,608,000 |
After analyzing the postfix logs on my server I noticed the following message :
Sep 4 15:12:50 vps66698 postfix/smtpd[25401]: connect from unknown[195.22.126.189]
Sep 4 15:12:50 vps66698 postfix/smtpd[25401]: disconnect from unknown[195.22.126.189]
What is this message and how to improve the safety of my server ?
T... |
Normally when a remote machine tries to connect to your postfix server, postfix will attempt to do a DNS lookup of the address and report that in the file
eg
connect from 66-220-155-155.outmail.facebook.com[66.220.155.155]
or
connect from mail-it0-x249.google.com[2607:f8b0:4001:c0b::249]
Now if the IP address can no... | Connect / disconnect unknown postfix log |
1,314,161,608,000 |
If you send a SIGSTOP to a web server, does the kernel just tell the network stack to block/sleep all connections to that server's socket(s) until it is continued? It seems that the server timeout values don't matter; it will wait indefinitely, but how?
Will requests sit in the socket buffer indefinitely? What if th... |
From the point of view of any part of the system that isn't concerned with the process's state and stats, a process that is stopped (i.e. won't be scheduled until it receives a SIGCONT) is indistinguishable from a process that's running, but isn't responding to a particular query. For example, the network stack operat... | What happens to requests to a service that is stopped with SIGSTOP |
1,314,161,608,000 |
Platform: RHEL 5.10
netcat Version: 1.84-10.fc6
I was trying to figure out if my inability to ssh was TCP-level and usually I use nc for this. This time, however, I got something unexpected.
[bratchley@ditirlns01 ~]$ nc -vz dixxxldv02.xxx.xxx 22 -w 15
nc: connect to dixxxldv02.xxx.xxx port 22 (tcp) timed out: Operatio... |
Shortly after posting, I found the problem:
[bratchley@ditirlns01 ~]$ host ditirldv02.ncat.edu
ditirldv02.ncat.edu has address 152.8.143.20
ditirldv02.ncat.edu has address 152.8.143.5
[bratchley@ditirlns01 ~]$
So it appears that nc will cycle through all A records for a given host and test each one individually. The ... | nc both fails and succeeds |
1,314,161,608,000 |
I have a windows PC that is on network A and a windows PC on network B. Also in network B I have several Linux servers. From the PC on network A, I can ssh to any server on network B. I cannot, however, connect to the PC on network A from a computer on network B.
... |
Solution 1: From your PC on network A, create a reverse ssh tunnel with something like Putty by connecting to a Linux host on Network B. The local port should be 3389, the remote host 127.0.0.1 and the port is arbitrary (lets use 6000 as an example). Then from your PC on network B, use putty to connect to the same Lin... | I need to RDP to a server through a reverse tunnel |
1,314,161,608,000 |
I tried to slow down my CPU with powernowd and cpufreq-selector. I hoped that with lower frequency it will be less hot and I won't hear my fan every time I will run internet radio.
I used the following commands
sudo cpufreq-selector -f 800000
and
sudo powernowd -m 0 -l 40 -u 60
but this wasn't sufficient for more qu... |
The very important thing is to lower down the cpu clock first.
The second important part is to verify there is no physical cooling problem (like dust on the fans, cat or dog hairs in the heatsink ect)
On most computers, the fan speed is directly operated by the bios or the os automatically.
The cleaning/lowering cpu s... | Slow down the CPU |
1,314,161,608,000 |
Does OpenBSD use bcrypt by default?
Why doesn't every modern Linux Distribution use BCRYPT?
http://codahale.com/how-to-safely-store-a-password/
https://secure.wikimedia.org/wikipedia/en/wiki/Bcrypt
WHY????
|
A couple of reasons:
The BCrypt-based scheme isn't NIST approved.
Hash functions are designed for this kind of usage, whereas Blowfish
wasn't.
The added security is BCrypt is based on it being computationally expensive,
rather than the type of algorithm. Relying on computationally expensive operations isn't good for... | BCRYPT - Why doesn't the Linux Distributions use it by default? |
1,314,161,608,000 |
The memory resource controller for cgroups v1 allows for setting limits on memory usage on a particular cgroup using the memory.limit_in_bytes file. What is the Linux kernel's behavior when this limit is reached?
In particular:
Does the kernel OOM kill the process and if so is the oom_score of the process taken into... |
By default OOM is overseeing cgroups.
memory.oom_control
contains a flag (0 or 1) that enables or disables the Out of Memory killer for a cgroup. If enabled (0), tasks that attempt to consume more memory than they are allowed are immediately killed by the OOM killer. The OOM killer is enabled by default in every cgro... | What's the Linux kernel's behaviour when processes in a cgroup hit their memory limit? |
1,404,399,176,000 |
I have a high-availability cluster (Heartbeat) connected via serial line and two ethernet NICs. I'd like to set up a monitoring script capable of recognizing disconnected serial line (basically the same question was answered at SO, however I am not satisfied with such a general answer).
I cannot simply open the seri... |
RS232 has no "cable presence" indicator of any kind. You're just getting transmission or metadata (control) signals through, or you don't - that's all you know. If you receive an incoming signal (CTS|DSR|CD) you know the cable is connected. If you don't receive any incoming signal, the state of the cable is indetermin... | How do I know if a serial port is actually transmitting data, without opening the device? |
1,404,399,176,000 |
I would like to use HDMI on my graphic card for audio output. ALSA shows it as a card with 4 devices and I can get sound through one of them (the other three are different channels, perhaps? I have only stereo output connected). Although Pulseaudio has the right card set as default, it seems to me that it plays on the... |
It seems like I found a solution, at least for this particular case.
Since I knew the card and device number assigned by ALSA, I just had to open /etc/pulse/default.pa. in editor and change this line
#load-module module-alsa-sink
into this
load-module module-alsa-sink device=hw:2,7
where 2 and 7 are my particular in... | Changing default audio device in Pulseaudio |
1,404,399,176,000 |
Days ago I broke my laptop display by accident, the right side of the screen is damaged, but the most part of the left side is usable. I did some research trying to find a way to modify the dimension of the screen to fit into the area with no damage and I found xrandr.
I found the next .sh archive but I can't find a ... |
Just set the screen size with xrandr --fb (no --mode, --transform, whatever).
$ xrandr --fb 800x768
xrandr will complain about the screen size being too small, but will apply the settings nonetheless.
Example:
$ xrandr --fb 1520x1080
xrandr: specified screen 1520x1080 not large enough for output VGA-0 (1920x1080+0+0)... | Xrandr problem trying to avoid broken display |
1,404,399,176,000 |
Can I remove the mouse pointer entirely from X? As in removing it and not just hiding it?
I don't use the mouse at all. Everything I do is completely keyboard driven, so I hide the mouse pointer and disable my touchpad. However, the cursor still has a position on my screen, which causes applications to fire hover even... |
Configure your X session to start with the argument -nocursor. For example:
exec /usr/bin/X -nocursor -nolisten tcp "$@"
| Can I remove the mouse pointer entirely from X? |
1,404,399,176,000 |
I have a Ubuntu 12.04 system. On that system I have one USB 3.0 port. In this port I am trying use my USB 2.0 device, but every time when I plug in that USB 2.0 device into the USB 3.0 port, the system gets hung and I try to shutdown but it won't allow me to.
If I continue to match Port types to Device speeds (2.0 to... |
This issue is retalted to the kernel. I have the same type of problem. To resovle this issue I updated my kernel. For this I reffred this link
| USB 2.0 device is not working in USB 3.0 ports |
1,404,399,176,000 |
Mod note: The entire network is pretty against shopping recommendation questions; there was an attempt to edit this one to avoid it, but it seems to have failed. The goal is "how do I decide which printer to buy", not "which printer should I buy". If you're naming a specific model in your answer, you're probably doin... |
This site helps find linux-compatible printers: http://linuxdeal.com/printers.php?type=aio
This site helps let you know if printers you already have or want are linux-compatible: http://www.openprinting.org/printers
| Do any "All In One" Printer/Scanners work on Linux? |
1,404,399,176,000 |
I'm currently reading the book How Linux Works and in chapter 5 it talks about Linux parameters. Curious I started to see what were the parameters passed to my installed kernel when it boots up and noticed:
BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64
I have been searching online for an explanation for this parameter but ... |
According to http://homepage.smc.edu/morgan_david/cs40/lilo-readme.txt:
LILO always passes the string BOOT_IMAGE=<name> to the kernel, where
<name> is the name by which the kernel is identified (e.g. the label). This
variable can be used in /etc/rc to select a different behaviour, depending
on the kernel.
So it ... | What is the BOOT_IMAGE parameter in /proc/cmdline |
1,404,399,176,000 |
I use the following dspcat command on AIX and can dump message catalogs created with the gencat command:
dspcat –g /u/is/bin/I18N/l/lib/libca/libcalifornia.117.cat >> /tmp/message.smc
I have spent a good solid hour looking for hints on how to dump one of these catalogs on Linux but this command does not seem to be a... |
I found the source code for dspcat.c: http://www.smart.net/~rlhamil/. Specifically in this tarball. I tried compiling it and was missing a variable:
$ make
cc -O -DSOLARIS dspcat.c -o dspcat
dspcat.c: In function ‘format_msg’:
dspcat.c:11:23: error: ‘NL_TEXTMAX’ undeclared (first use in this function)
static ... | Is there a utility like dspcat on Linux? |
1,404,399,176,000 |
Threads/websites I searched but didn't fully help me
Split a physical X display into two virtual displays?
https://chipsenkbeil.com/notes/linux-virtual-monitors-with-xrandr/
https://askubuntu.com/questions/150066/split-monitor-in-two/998435#998435
Context
I have a screen with a 5120x1440px screen resolution. I want ... |
Taking into account the comments, I'd suggest DWM (a dynamic/tiling window manger) with fake full screen patch. This patch allows apps to "fullscreen" into space currently given to them, a window or half screen or whatever. It would be ideal for your scenario, half screen for gaming (faked full) and the rest for other... | Use xrandr to split display in two virtual screens |
1,404,399,176,000 |
How to display meminfo in megabytes in top? discusses how to change the units of memory (e.g. megabytes, gigabytes, etc.) when using top. Is there a way to do this in htop as well? man htop doesn't address this, neither does it seem evident from the info displayed via F1 when running the program.
Alternatively, if t... |
I don't think it is possible, but, if you are up for building your own htop, not impossible. The code is at github and if you look at Meter.c you will see the logic they use to decide what to display.
| htop - change units for memory usage display |
1,404,399,176,000 |
I'm running Arch linux on my laptop, which is kernel 3.12.9 right now. Something has changed about the way the kernel maps in a dynamically-linked executable and I can't figure it out. Here's the example:
% /usr/bin/cat /proc/self/maps
...
00400000-0040b000 r-xp 00000000 08:02 1186756 /usr/bin/cat
0060a00... |
I finally figured this out. The kernel does map only 2 segments. The third piece is a portion of one of the two loaded by the kernel. The run time linker, the program named in the INTERP pheader, which is /usr/lib/ld-2.24.so for me right now, changes the permissions on the mappings using mprotect() so that there are r... | /proc/self/maps - 3rd mapped piece of file? |
1,404,399,176,000 |
I'm using RHEL 6 . I'm unable to play the video using Movie Player. It shows an error, Movie Player requires additional plugins to decode this file.
The following plugins are required : MPEG-4-AAC decoder and H.264 decoder. But RHEL asking for a subscription. How to solve this problem or Suggest me any alternate sof... |
I solved the problem by installing the RPM Fusion repo and then
yum install gstreamer-ffmpeg
| Movie Player requires additional plugins to decode this file |
1,404,399,176,000 |
See USB driver bug exposed as "Linux plug&pwn", or this link
Two choices [GNOME, Fedora 14]:
Use the gnome-screensaver
Use the "switch user" function [gnome menu -> log out -> switch user]
So the question is: which one is the safer method to lock the screen if a user leaves the pc?
Is it true that using the [2] met... |
Well your first link is about kernel mode arbitraty code execution there is not much you can do against that. Logging out won't help. Grsecurity and PaX could prevent this but I'm not sure. It surely protect against introducing new executable code but I can't find any evidence that it randomizes where the kernel code ... | Is locking the screen safe? |
1,404,399,176,000 |
I've been building LFS/BLFS for about a month now, with multiple failures and almost no successes, and I've just been informed that there exist Xorg-like window systems that are incredibly tiny, as Xorg's LFS build is over 200MB of just source packages.
I Googled around the web, but the Wikipedia article on TinyX poin... |
Xfree86 (http://www.xfree86.org/) includes "tiny" X servers in their build. I believe they are video-card-specific, in that there's an MGA server, and an ATI server, etc etc. No loadable modules.
I have built XFree86 from source a coule of years ago (under Slackware 3.2!) but I don't think I tried the "tiny" servers... | What is the most compatible tiny X server? |
1,404,399,176,000 |
I am trying to understand the difference in behaviour between FreeBSD ACLs and Linux ACLs. In particular, the inheritance mechanism for the default ACLs.
I used the following on both Debian 9.6 and FreeBSD 12:
$ cat test_acl.sh
#!/bin/sh
set -xe
mkdir storage
setfacl -d -m u::rwx,g::rwx,o::-,m::rwx storage
touch ou... |
In short I’d say (assume) they’re using umask differently.
0022 is exactly group-other unset W. You can change umask to remove write prohibition and check the result.
Citing Solaris aka SunOS manual (and comments as well) since that seems to be pretty related: "… The umask(1) will not be applied if the directory co... | Why did FreeBSD lose the w mask but Debian retained it? |
1,301,414,593,000 |
I've compiled linked and created a program in C++ now I have
foobar.out
I want to be able to put it into the bin directory and use it like system wide commands e.g.
ssh, echo, bash, cd...
How can I achieve that?
|
There are two ways of allowing you to run the binary without specifying its path (not including creating aliases or shell functions to execute it with an absolute path for you):
Copy it to a directory that is in your $PATH.
Add the directory where it is to your $PATH.
To copy the file to a directory in your path, f... | Creating a program in bin |
1,301,414,593,000 |
I always boot up my GNU/Linux laptop in console mode. But sometimes I need to bring up the GUI mode. it always requires entering the root password. So I wrote the following script "gogui.sh" and put it in /usr/bin:
#!/bin/bash
echo "mypassword" | sudo service lightdm start
It is a really stupid idea, as if someone re... |
Passing a password to sudo in a script is utterly pointless. Instead, add a sudo rule adding the particular command you want to run with the NOPASSWD tag. Take care that the command-specific NOPASSWD rule must come after any general rule.
saeid ALL = (ALL:ALL) ALL
saeid ALL = (root) NOPASSWD: service lightdm start
Bu... | Passing root password safely in a shell script |
1,301,414,593,000 |
Once in a while (often a long while), I have a difficulty where I execute a command that completely screws up a Linux machine.
Most recently, I accidentally mounted-again the root partition (thinking it was the new USB drive I had just formatted), and then proceeded to recursively chown the partition to myself (again,... |
Run your installation in a virtual machine. Take a snapshot of a known good state. Take snapshots before doing anything risky. Do almost nothing in the host environment. If you screw up, connect to the host environment and restore the snapshot.
| What are the recommended ways of defending a remote *nix install from a hamfisted admin? |
1,301,414,593,000 |
I installed Emacs using sudo apt-get install emacs. The problem is that when I launch Emacs from the command line (e.g. emacs main.c) it opens Emacs with a GUI. I prefer the command line version which runs in the terminal emulator.
How can I install (or change some default) so that Emacs will open in the command line ... |
Installing emacs-nox instead of emacs should do the trick.
| How to install/default to the command line version of Emacs? |
1,301,414,593,000 |
I had swap from a swapfile working for quite some time, but for some reason it stopped working.
sudo fallocate -l 4G /home/.swap/swapfile
sudo chmod 600 /home/.swap/swapfile
sudo mkswap /home/.swap/swapfile
# /etc/fstab
/home/.swap/swapfile swap swap defaults 0 0
sudo swapon -a
swapon: /home/.swap/swapfile: swapon ... |
Please try replacing
fallocate -l 4G /home/.swap/swapfile
with
dd if=/dev/zero of=/home/.swap/swapfile bs=1M count=4096
| Swapfile Swapon invalid argument |
1,301,414,593,000 |
With a bash script, can I read the mac address of my eth0 and print it to a file?
|
ifconfig will output information about your interfaces, including the MAC address:
$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:289748093 errors:... | Print mac address to file |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.