date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,558,028,264,000 |
I want to move large file created by external process as soon as it's closed.
Is this test command correct?
if lsof "/file/name"
then
# file is open, don't touch it!
else
if [ 1 -eq $? ]
then
# file is closed
mv /file/name /other/file/name
else
... |
From the lsof man page
Lsof returns a one (1) if any error was detected, including the failure
to locate command names, file names, Internet addresses or files, login
names, NFS files, PIDs, PGIDs, or UIDs it was asked to list. If the -V
option is specified, lsof will indicate the search i... | Move file but only if it's closed |
1,558,028,264,000 |
One can find several threads on the Internet such as this:
http://www.gossamer-threads.com/lists/linux/kernel/972619
where people complain they cannot build Linux with -O0, and are told that this is not supported; Linux relies on GCC optimizations to auto-inline functions, remove dead code, and otherwise do things th... |
You've combined together several different (but related) questions. A few of them aren't really on-topic here (e.g., coding standards), so I'm going to ignore those.
I'm going to start with if the kernel is "technically incorrect C code". I'm starting here because the answer explains the special position a kernel occu... | Linux cannot compile without GCC optimizations; implications? [closed] |
1,558,028,264,000 |
Is there a command to display a list of users who modified a file providing a file history?
I know that possible with svn/git etc.. but we have a config file that is not in SVN and someone modified it.
|
If you have not previously enabled some sort of auditing, there is not a tool that can report this after the file has been modified. You can get the date and time of when the file was last modified, but not a revision history.
Moving forward, you could install, setup, enable the auditd package.
From the auditctl man ... | Display a file's history (list of users that have modified a file) |
1,558,028,264,000 |
How can i do this in a single line?
tcp dport 53 counter accept comment "accept DNS"
udp dport 53 counter accept comment "accept DNS"
|
With a recent enough nftables, you can just write:
meta l4proto {tcp, udp} th dport 53 counter accept comment "accept DNS"
Actually, you can do even better:
set okports {
type inet_proto . inet_service
counter
elements = {
tcp . 22, # SSH
tcp . 53, # DNS (TCP)
udp . 53 # DNS (UDP)
}
And then:
... | How to match both UDP and TCP for given ports in one line with nftables |
1,558,028,264,000 |
I recently noticed I am only getting 100Mbit/s of througput on my gigabit home network.
When looking into it with ethtool I found my ArchLinux Box was using 100baseT/Half as link speed instead of 1000baseT/Full which its NIC and the switch connected to it support.I am not sure why but the NIC seems to not be advertisi... |
After hours of searching I found the solution in the most obvious place:
NetworkManager seems to somehow have disabled autonegotiation right in the settings for my ethernet port:
The weird part is that even after knowing NetworkManager can change the ethernet link-mode I cannot find even a single source online detail... | Linux disables ethernet auto-negotiation on plugging-in the cable? |
1,558,028,264,000 |
I'm trying to disable some CPUs of my server.
I've found this link: https://www.cyberciti.biz/faq/debian-rhel-centos-redhat-suse-hotplug-cpu/linux-turn-on-off-cpu-core-commands/, which offers me a method as below:
Here is what numactl --hardware gave me:
I want to disable all CPUs from 16 to 63, so I write a script n... |
Besides @Yves answer, you actually are able to use the isolcpus kernel parameter.
To disable the 4th CPU/core (CPU 3) with Debian or Ubuntu:
In /etc/default/grub add isolcpus=3 to GRUB_CMDLINE_LINUX_DEFAULT
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash isolcpus=3"
Run
sudo update-grub
Reboot the server.
isolcpus — Isol... | How to disable one CPU |
1,558,028,264,000 |
I looked at the stackexchange site but couldn't find anything. I looked at the wikipedia entry on Linux container https://en.wikipedia.org/wiki/LXC and as well as hypervisor https://en.wikipedia.org/wiki/Hypervisor but the explanation to both is beyond a person who has not worked on either will understand. I also saw ... |
A Virtual Machine (VM) is quite a generic term for many virtualisation technologies.
There are a many variations on virtualisation technologies, but the main ones are:
Hardware Level Virtualisation
Operating System Level Virtualisation
qemu-kvm and VMWare are examples of the first. They employ a hypervisor to mana... | What is a Linux container and a Linux hypervisor? |
1,558,028,264,000 |
I understand that /dev/kmem and /dev/mem provide access to the memory (i.e. raw RAM) of the system. I am also aware, that /dev/kmem can be completely disabled in kernel and that access can be restricted for /dev/mem.
It seems to me, having raw access to memory can be useful for developers and hackers, but why should I... |
There's a slide deck from Scale 7x 2009 titled: Undermining the Linux Kernel:
Malicious Code Injection via /dev/mem that contained these 2 bullets.
Who needs this?
X Server (Video Memory & Control Registers)
DOSEmu
From everything I've found from search thus far it would appear that these 2 bullets are the front-r... | kernel: disabling /dev/kmem and /dev/mem |
1,558,028,264,000 |
My program creates many small short-lived files. They are typically deleted within a second after creation. The files are in an ext4 file system backed by a real hard disk. I know that Linux periodically flushes (pdflush) dirty pages to disk. Since my files are short-lived, most likely they are not cached by pdflush. ... |
A simple experiment using ext4:
Create a 100MB image...
# dd if=/dev/zero of=image bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.0533049 s, 2.0 GB/s
Make it a loop device...
# losetup -f --show image
/dev/loop0
Make filesystem and mount...
# mkfs.ext4 /dev/loop0
# mount /dev/l... | Are short-lived files flushed to disk? |
1,558,028,264,000 |
From this answer the solution is to
modprobe loop max_loop=64
Which makes me allowed to use 64 loopback devices then
mknod -m 660 /dev/loop8 b 7 8
To create the devices. I did this for 8, 9, 10 and 8,9 works but 10 does not.
I then tried loopa to loopf and tried to mount a 11th device and i get the error
Error: Fai... |
Make sure you are running mknod -m 660 /dev/loop10 b 7 10. The format is mknod -m 660 /dev/loop<ID> b 7 <ID> where ID is the same.
Update [07/10/2014]
I also found a good blog post to always have more at boot. See https://yeri.be/xen-failed-to-find-an-unused-loop-device
Update [05/25/2016]
I run a CentOS server, and I... | How do I setup more then 10 loopback device? |
1,558,028,264,000 |
I'm trying to find a way to safely shutdown a network interface, i.e. without disturbing any processes. For this I need to find out what processes are currently using that interface. Tools like ss, netstat or lsof are helpful showing which processes have open sockets, but they don't show wpa_supplicant, dhcpcd, hostap... |
Such programs will be using Netlink sockets to talk to the network hardware's driver directly. lsof version 4.85 added support for Netlink sockets, but in my testing on CentOS 5.8, the feature doesn't appear to work very well. Perhaps it depends on features added in newer kernels.
However, it is possible to make a pre... | Find processes using a network interface |
1,558,028,264,000 |
How to disable system beep on Linux? I don't have superuser powers so I cannot recompile kernel/unload module.
|
For beeps generated in your shell (which seem to be the most annoying ones), add this to "~/.inputrc":
set bell-style none
Note that this is not terminal- but host-specific. That means that when you log in to another computer via ssh where this isn't set, the beep is back. (I tested on Fedora)
| How to disable system beep for non-privileged user |
1,631,465,526,000 |
When I use strace to examine a program, I often have a hard time finding where the syscalls from the dynamic loader end and the syscalls from the program begin.
The output from strace ./hello where hello a simple hello world C program is 36 lines. Here's a sample:
execve("./hello", ["./hello"], 0x7fffb38f4a30 /* 73 va... |
On x86_64 the main program starts just after arch_prctl(ARCH_SET_FS) and a couple of mprotect()s, so you can sed 1,/ARCH_SET_FS/d on the strace's output.
A trick you can use on all platforms is to LD_PRELOAD a small library which overides __libc_start_main() and does a pointless system call like write(-1, "IT_STARTS_H... | Can I skip syscalls made by the dynamic loader in strace? |
1,631,465,526,000 |
I recently noticed that in normal mode when I type Ctrl-i (command for jumps) it is "confused" for the TAB key. In particular, I have this mapping:
nnoremap <Tab> :tabnext<Enter>
|
Terminal I/O applications just see the composed characters sent by the terminal, and cannot distinguish amongst specific key chords, while GUI applications can, because GUIs tend to operate in terms of key press and release messages.
Most terminals, and most terminal emulators, send a ␉ (U+0009) character down the (v... | Conflict Ctrl-I with TAB in normal mode |
1,631,465,526,000 |
I need to find and delete files older than 1 week in the Development unit. There are limited number utilities available on this unit. -mtime find's predicate is not available. How do I check all files which are older than x days in this case?
|
-mtime is a standard predicate of find (contrary to -delete) but it looks like you have a stripped down version of busybox, where the FEATURE_FIND_MTIME feature has been disabled at build time.
If you can rebuild busybox with it enabled, you should be able to do:
find . -mtime +6 -type f -exec rm -f {} +
Or if FEATUR... | Finding files older than x days on a system with a stripped down busybox |
1,631,465,526,000 |
Trying to trouble-shoot this error which pertains to microcode, my card from lspci shows,
Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)
system.log shows,
iwlwifi: Detected Intel(R) Centrino(R) Advanced-N 6205 AGN, REV=0xB0
When I run modinfo, I get, (a lot of stuff cut off)
de... |
This is documented at the Linux Wireless wiki:
------------------------------------------------------------------------------
Device | Kernel | Module | Firmware |
----------------- | ---------| ------- | ------------------------------------ |
Intel® Centrino® | 2.6.36+ | iw... | Where can I find the microcode (ucode) that is being loaded by iwlwifi (Intel 6205)? |
1,631,465,526,000 |
If I have a windows client read a file on a Linux smb share at an interval <= 10 seconds, the windows client will show incorrect (cached?) information of that file.
I've reproduced this on multiple systems.
Example steps to reproduce:
1) set up linux samba share - for this example, using Debian and installing samba. e... |
I resolved this by placing
oplocks = False
in my smb.conf under my share settings.
https://www.samba.org/samba/docs/old/Samba3-HOWTO/locking.html#id2615926
| Windows clients will not refresh Linux samba file locally if reading file at intervals <= 10 seconds |
1,631,465,526,000 |
Executing (for example) the following command to get the list of memory mapped pages:
pmap -x `pidof bash`
I got this output:
Why some read-only pages are marked as "dirty", i.e. written that require a write-back? If they are read-only, the process should not be able to write to them... (In the provided example dirt... |
A dirty page does not necessarily require a write-back. A dirty page is one that was written to since the kernel last marked it as clean. The data doesn't always need to be saved back into the original file.
The pages are private, not shared, so they wouldn't be saved back into the original file. It would be impossibl... | Why read-only memory mapped regions have dirty pages? |
1,631,465,526,000 |
How can I do logrotate? I can see no effect when I do logrotate:
root@me-Latitude-E5550:/etc/logrotate.d# cd ..
root@me-Latitude-E5550:/etc# cd ..
root@me-Latitude-E5550:/# logrotate -d /etc/logrotate.conf
Ignoring /etc/logrotate.conf because of bad file mode.
Handling 0 logs
root@me-Latitude-E5550:/# chmod 644 /etc/... |
You are changing permission on logrotate.d. you need to chmod 644 /etc/logrotate.conf
And chown root:root /etc/logrotate.conf
And then it could work
| Ignoring /etc/logrotate.conf because of bad file mode |
1,631,465,526,000 |
I'm still new to Linux and Unix-like systems and I've tried to search on the internet about my issue. Unfortunately I don't get a feasible answer right now.
My problem is that the console(tty) on my Debian linux can't display any language other than English where it's a bit inconvenient for me as I have some folders a... |
Short answer: you can't.
Longer: the Linux console has limited ability to display Unicode in the console, supporting only 512 glyphs (which is a minuscule slice of Chinese). The reason this is because it stores the information in (kernel) memory. Furthermore, when doing this, it reduces the number of video attribute... | Linux console can't display any language other than English while the terminal under Gnome can |
1,631,465,526,000 |
I want to set up a directory where all new files and directories have a certain access mask and also the directories have the sticky bit set (the t one, which restricts deletion of files inside those directories).
For the first part, my understanding is that I need to set the default ACL for the parent directory. Howe... |
This is a configuration that allows members of a group, acltest, to create
and modify group files while disallowing the deletion and renaming of files
except by their owner and "others," nothing. Using the username, lev and
assuming umask of 022:
groupadd acltest
usermod -a -G acltest lev
Log out of the root account ... | Set sticky bit by default for new directories via ACL? |
1,631,465,526,000 |
If I create a tun interface with ip tuntap add mode tun command and force it administratively up with ip link set dev tun1 up command, then the interface itself is always "physically" down:
root@A58:~# ip link show dev tun1
46: tun1: <NO-CARRIER,POINTOPOINT,MULTICAST,NOARP,UP> mtu 1500 qdisc pfifo_fast state DOWN mode... |
The Linux kernel exposes this info now in /proc/$PID/fdinfo/$FD. For example:
# grep ^iff: /proc/*/fdinfo/*
/proc/31219/fdinfo/5:iff: tun0
/proc/31235/fdinfo/5:iff: tun1
/proc/31252/fdinfo/5:iff: tun2
/proc/31267/fdinfo/5:iff: tun3
Tested with Debian 5.8.10.
| How to find out which process keeps tunnel interface(tun) up? |
1,631,465,526,000 |
I have a setup with sftp only users:
Match Group sftponly
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
I get the following message in my secure.log:
fatal: bad ownership or modes for chroot directory
With the match keyword there comes some security stuff with it... the directories ... |
I have same settings on our server. We use same config of SSHD. Users' home directories are owned by root and within them there are folders documents and public_html owned by respective users. Users then login using SFTP and write into those folders (not directly into home). As SSH is not allowed for them, it perfectl... | Chrooted SFTP user write permissions |
1,631,465,526,000 |
I'm trying to secure my authorized_keys file to prevent it from being modified. I run this:
[root@localhost]# chattr +i authorized_keys
chattr: Inappropriate ioctl for device while reading flags on authorized_keys
I think it may be due to the filesystem:
[root@localhost]# stat -f -c %T /home/user/
nfs
there is a wa... |
NFS doesn't have a concept of immutable files, which is why you get the error. I'd suggest that you just remove write access from everyone instead, which is probably close enough for your purposes.
$ > foo
$ chmod a-w foo
$ echo bar > foo
bash: foo: Permission denied
The main differences between removing the write b... | `chattr +i` error on NFS |
1,631,465,526,000 |
My desktop has a nasty habit. When I have several high intensity applications running and my CPU is at maximum usage for a period of time, the core temperature rises and my computer auto-shuts off.
Is there a way I can monitor (write a script) my CPU temperature in the background and have some sort of warning when it ... |
You could write a script to display your temperature in dwm's status bar, for example:
temp (){
awk '{print $4"°C"}' <(acpi -t)
echo $temp
}
xsetroot -name "$(temp)"
Your sensors output may be more complex, depending on your setup: this works on one of my machines:
awk '/temp1/ {print +$2"°C"}' <(sensors)
If ... | How to monitor my CPU temperature with a minimal script to show a warning? |
1,631,465,526,000 |
Are there any wgetpaste alternatives?
As a clarification...
wgetpaste is an extremely simple command-line interface to various
online pastebin services.
The basic usage is to simply upload a local file to a pastebin-like online service for sharing.
|
I use an online service called sprunge.us. It lets you post pretty simply like this
command | curl -F "sprunge=<-" http://sprunge.us
I have curl -F "sprunge=<-" http://sprunge.us | xclip aliased to webshare on my system, so it becomes simply command | webshare. The added xclip at the end gets the url into the X clipb... | wgetpaste alternatives? |
1,631,465,526,000 |
While reading through the kernel documentation on ramdisk in
ramfs-rootfs-initramfs.txt i was having a doubt like the ramdisk explained there is same as the initrd features described in the post at the-difference-between-initrd-and-initramfs.
Could someone clarify me on this??
And if it is the same, i read that t... |
A ramdisk is a set of blocks that gets copied to an allocated chunk of memory, then treated as a block device. A normal filesystem is created on the ramdisk. The initrd (initial ramdisk) is a ramdisk that is mounted during bootup.
The initramfs is something different. It's a cpio archive of files that is loaded dur... | Is Ramdisk and initrd the same? |
1,631,465,526,000 |
We've bought a commercial application who just work only if their dongle usb is connected to the server. However sometimes the application can not recognize the dongle, so it doesn't work, but if someone eject the dongle physically from USB port and attach it again it will recognize and work fine.
There are 43 modules... |
Many answers found on the Internet (including those in TNW's comment) rely on /sys/bus/usb/devices/2-2/power/level or /sys/bus/usb/devices/2-2/power/control which are both deprecated since 2.6.something kernel. For newer kernels, the suggested procedure is to unbind and rebind its driver, which usually results in a po... | How to logically eject/disconnect & reattach a usb device (dongle)? |
1,631,465,526,000 |
I am handed a path of a directory or a file.
Which utility/shell script will reliably give me the UUID of the file system on which is this directory/file located?
By UUID of file system I mean the UUID=... entry as shown by e.g. blkid
I'm using Redhat Linux.
(someone suggested that I should ask this here at unix.stack... |
One option is stat + findmnt combo:
findmnt -n -o UUID $(stat -c '%m' "$path")
Here -n disables header, and -o UUID prints only UUID value. Option -c '%m' of stat is present to output only mountpoint of given path.
| How to get UUID of filesystem given a path? |
1,631,465,526,000 |
I'm having some doubts about how to install and allow Linux to correctly read/write to a NTFS formatted harddrive used as backup of various machines (windows included, that's how I need NTFS).
For now, I've read some pages and I have the feeling I need someone else's guidance from who already did this step-by-step, to... |
You can use ntfs-3g, but make sure you place the mappings file in the right place. Once you do that you should see file ownerships in ../User/name match the unix user.
However, if you just want to use it as backup you should probably just save a big tarball onto the ntfs location. If you also want random access you c... | Is NTFS under linux able to save a linux file, with its chown and chmod settings? |
1,631,465,526,000 |
Whenever there is high disk I/O, the system tends to be much slower and less responsive than usual. What's the progress on Linux kernel regarding this? Is this problem actively being worked on?
|
I think for the most part it has been solved. My performance under heavy IO has improved in 2.6.36 and I expect it to improve more in 2.6.37. See these phoronix Articles.
Wu Fengguang and KOSAKI Motohiro have published patches this week that they believe will address some of these responsiveness issues, for which the... | What's the progress regarding improving system performance/responsiveness during high disk I/O? |
1,631,465,526,000 |
Quoting from https://www.kernel.org/doc/Documentation/process/adding-syscalls.rst:
At least on 64-bit x86, it will be a hard requirement from v4.17
onwards to not call system call functions in the kernel. It uses a
different calling convention for system calls where struct pt_regs
is decoded on-the-fly in a syscall ... |
One of the concerns wasn’t so much with arbitrary register values, but that they get copied to the kernel stack. Unused registers can thus be used to write arbitrary caller-controlled values to the stack, with no checks.
These values on the stack could potentially be used in a more complex attack. That’s why removing ... | What is the rationale for the change of syscall calling convention in new Linuxes? |
1,631,465,526,000 |
When I do ls /dev/tty*, I see the following output:
/dev/tty /dev/tty12 /dev/tty17 /dev/tty21 /dev/tty26 /dev/tty30 /dev/tty35 /dev/tty4 /dev/tty44 /dev/tty49 /dev/tty53 /dev/tty58 /dev/tty62 /dev/ttyS0
/dev/tty0 /dev/tty13 /dev/tty18 /dev/tty22 /dev/tty27 /dev/tty31 /dev/tty36 /dev/tty40 /dev... |
What is the reason?
When watch executes commands they are not connected to the
terminal. In other words, isatty(3) returns 0. You can use the
following isatty.c to check if a command is connected to the terminal
when it's ran:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(void)
{
printf("%d\... | ls formatting inside watch command |
1,631,465,526,000 |
I just got a Kensigton Slimblade Trackball and I'm trying to configure it. I'm adapting it from my old Logitech Marble configuration.
I want the configuration to be:
Left-Bottom: Left click
Left-Top: Backward
Right-Top: Right click and ball scroll lock
Right-Bottom: Middle click
The configuration I could set unt... |
A few minutes after I post the question I found the answer. Here goes in case anyone needs it (configuration for Mint 18/Ubuntu 16.04):
xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Middle Button Emulation" 8 0
7 8 9
xinput set-button-map "Kensington Kensington Slimblade Trackball" 1 8 2 4 5 ... | Configuring Kensington Slimblade in Linux |
1,631,465,526,000 |
I recently installed Linux Ubuntu 14.04 to my computer. To enable internet connection I needed to change my IP and Gateway address.
I did the following as a root user
# ifconfig eth0 "my ip address here" netmask 255.255.255.0 up
# route add default gw " gw address here"
It works fine for a couple of minutes but then ... |
As stated by jpkotta, network-manager is likely the culprit.
You can see its status by running ps -aux | grep network-manager | grep <username>. If you get a result, it is running, otherwise it isn't.
It will keep overwriting any changes you make with ifconfig as long as it is running.
Kill network-manager by running... | How can I change the IP and gateway addresses permanently? |
1,631,465,526,000 |
I am trying to force the capslock led on. xset does not work for me, so I am trying to use setleds.
In a graphical console, this command returns:
> LANG=C setleds -L +caps
KDGKBLED: Inappropriate ioctl for device
Error reading current flags setting. Maybe you are not on the console?
In a virtual terminal, it works, h... |
In principle, you should be able to do it with the venerable xset command.
xset led named 'Caps Lock'
or xset led 4 to set LED number 4, if your system doesn't recognize the LEDs by name.
However, this doesn't seem to work reliably. On my machine, I can only set Scroll Lock this way, and I'm not the only one. This se... | Change the status of the keyboard leds, from within an X session, without root access |
1,631,465,526,000 |
When I try to find a file using find -name "filename" I get an error that says:
./var/named/chroot/var/named' is part of the same file system loop as `./var/named'
I ran the ls -ldi /var/named/chroot/var/named/ /var/named command and the inode numbers are the same. Research indicates the fix is to delete the hard lin... |
named, that is the DNS server, runs in a chroot. To access the configuration file, the startup script uses mount --bind to make the configuration dir visible inside the chroot. This means that /var/named/ is the same as /var/named/chroot/var/named, and /var/named/chroot/var/named/chroot/var/named and so on. This is a ... | find: File system loop detected |
1,631,465,526,000 |
In the following video: Linux HOWTO: Secure Your Data with PGP, Part 2, you are shown how to create a key pair with gpg. At about 1:50, the instructor says the following:
While the key is being generated, it is a good idea to move your mouse around a little bit to give it a bit more random number entropy for the crea... |
There is a grain of truth to this, in fact more truth than myth, but nonetheless the statement reflects a fundamental misunderstanding of what's going on. Yes, moving the mouse while generating a key with GPG can be a good idea. Yes, moving the mouse contributes some entropy that makes random numbers random. No, movin... | Adding "random number entropy" for GPG keys? |
1,631,465,526,000 |
I would like to send an email when a file reach a certain size limit.
The only way I thought of doing this is by doing a cronjob which will check the file size and send the email if the file is bigger than the desired size.
However, it seems like a bad solution for me to add a cronjob which would check ,for example ev... |
I can conceive of 2 approaches to do this. You can either use a while loop which would run a "stat" command at some set frequency, performing a check to see if the file's size has exceeded your desired size. If it has, then send an email. This method is OK but can be a bit inefficient since it's going to run the "stat... | Automatically detect when a file has reached a size limit |
1,631,465,526,000 |
I am using sed. I was using a regex that was correct as far as I could see, but sed did not do anything. Turns out that I was using \s+ which sed can not understand, and when I switched to [ ]+ it worked.
So to sum up, I made a regex which for it to work I had to escape almost everything and remove the \s for whitespa... |
Re 1) The answer is the same as for any other tool that was improved over decades. :)
You don't want to break existing scripts by changing default behaviour.
Re 2) That has nothing to do with the matching engine; it's just a question of which set of regular expressions is supported. POSIX BRE means "basic regular expr... | Why isn't sed using the extended regex mode by default? |
1,631,465,526,000 |
I'm having problems getting sFTP working while there are no problems with ssh. I'm basically building zlib, openssl, and openssh for an ARM processor using an existing embedded Linux filesystem. After searching for ideas, this seemed liked a common problem, but I haven't made any progress. I only have one user defined... |
While this is more of an alternate solution than a direct answer to your issue, I would try using the internal sftp server instead of an external one. Since this is an embedded system, this probably makes more sense to do anyway.
In your sshd_config, just add:
Subsystem sftp internal-sftp
That way you can leave out t... | sFTP server fails to start |
1,631,465,526,000 |
kernel: EDAC MC0: UE page 0x0, offset 0x0, grain 0, row 7, labels ":": i3200 UE
All of a sudden today, our CentOS release 6.4 (Final) system started throwing EDAC errors. I rebooted, and the errors stopped.
I have been searching for answers, but they fall into two camps, memory or a chipset. I would like some advice o... |
What you're experiencing is an Error Detection and Correction event. Given the error includes this bit: MC0 you're experiencing a memory error. This message is telling you where specifically you're experiencing the error. MC0 means the RAM in the first socket (#0). The rest of that message is telling you specifically ... | Does kernel: EDAC MC0: UE page 0x0 point to bad memory, a driver, or something else? |
1,631,465,526,000 |
Is there a default program where I can check if my audio devices are in silent?
Edit: By silence, I mean that if there is something playing on that (not just activated or opened)
Something like this:
if [[ device0 is silent ]] ; then
radio $RANDOM
fi
Edit 2: What I'm trying to achieve is a script that plays radio... |
If you're using PulseAudio (Gnome-based Linux distributions tend to use PulseAudio, you can check if one is running with ps -C pulseaudio) and you want to know whether some applications are sending any data to any "sink", you could do:
pacmd list-sink-inputs | grep -c 'state: RUNNING'
Still with PulseAudio, if you wa... | Testing if audio devices / sound cards are currently playing? |
1,631,465,526,000 |
On a Linux machine that runs systemd, is there any way to see what or who issued a shutdown or reboot?
|
Examine the system logs of the previous boot with sudo journalctl -b -1 -e.
Examine /var/log/auth.log.
Are you sure it's not one of "power interruption/spike", "CPU overheat", ....
On MY system (Ubuntu 16.04,6),
sudo journalctl | grep shutdown
Jan 29 12:58:07 bat sudo[14365]: walt : TTY=pts/0 ; PWD=/home/walt ; USER=... | How to find out who/what caused a reboot/shutdown? |
1,631,465,526,000 |
I have a long-running process that is hitting a resource limit, such as the maximum number of open files.
I don't want to kill it.
Usually, you'd do:
(stop service)
ulimit -n <new limit>
(start service)
Is there a way to avoid having to stop and start the service and increase the limits?
|
I've figured it out.
On some kernels (e.g. 2.6.32+), at least on CentOS/RHEL, you can change the resource limits of a running process using /proc/<pid>/limits, e.g.:
$ grep "open files" /proc/23052/limits
Limit Soft Limit Hard Limit Units
Max open files 1024 ... | Change the resource limits (ulimit / rlimit) of a running process |
1,631,465,526,000 |
I have been attempting to install Arch Linux on my Macbook Pro but the wireless and ethernet drivers don't work. Because of this, I cannot access the internet on it. So whilst searching for a solution I downloaded these drivers: http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2 (I got the link for the... |
From the live CD
You seem to be able to get a working connection on the installation media, so here is one idea: Start the arch live CD and setup your network. Then mount your newly installed partition (for example on /mnt) and chroot into your system using
# arch-chroot /mnt
From there, you will be able to update pa... | Install Drivers Offline Arch Linux |
1,631,465,526,000 |
I went through this article, which explains various methods for checking your RAM usage. However, I can't reconcile the different methods and don't know which one is correct.
When I first login, I'm greeted with a screen like this:
System information as of Sun Apr 28 21:46:58 UTC 2013
System load: 0.0 ... |
You just need to understand Memory Concept
As per your Output Of /proc/meminfo , You just need to Notice below things :
Buffers :- A buffer is something that has yet to be "written" to disk. It represents how much RAM is dedicated to cache disk block. "Cached" is similar to "Buffers", only this time it caches pages... | After researching, still confused about monitoring RAM usage |
1,345,313,914,000 |
I have an windows application (Under Wine) that only works when I change timezone to NewYork's TimeZone.
with Any other zone it doesn't start!!
So, Is it possible in Linux to run an application with different TimeZone than system configured TimeZone?
I'm using Ubuntu 10.04
|
Generally, set the TZ environment variable:
TZ=America/New_York myapplication
I don't know if Wine has its own configuration in addition to or overriding the environment variable.
| Run an application with different TimeZone |
1,345,313,914,000 |
I have a server (SUSE 11.5) that has two disks. There is only one volume group (vg01). How do I determine the physical device on which that vg exists?
|
I think
# pvdisplay
shows you the physical device(s) corresponding to all your volume groups.
Inter alia, my system shows, for example
--- Physical volume ---
PV Name /dev/sdc6
VG Name olddebian
PV Size 186.26 GiB / not usable 638.00 KiB
Allocatable yes
P... | How do I determine LVM mapping on a physical device? |
1,345,313,914,000 |
If I disable memory overcommit by setting vm.overcommit_memory to 2, by default the system will allow to allocate the memory up to the dimension of swap + 50% of physical memory, as explained here.
I can change the ratio by modifying vm.overcommit_ratio parameter.
Let's say I set it to 80%, so 80% of physical memory m... |
What the system will do with the remaining 20%?
The kernel will use the remaining physical memory for its own purposes (internal structures, tables, buffers, caches, whatever). The memory overcommitment setting handle userland application virtual memory reservations, the kernel doesn't use virtual memory but physica... | Where the remaining memory of vm.overcommit_ratio goes? |
1,345,313,914,000 |
I am on Arch Linux where I am trying to create a systemd timer as a cron alternative for hibernating my laptop on low battery. So I wrote these three files:
/etc/systemd/system/battery.service
[Unit]
Description=Preko skripte preveri stanje baterije in hibernira v kolikor je stanje prenizko
[Service]
Type=oneshot
E... |
An answer to this question is to swap User=nobody not with User=ziga but with User=root in /etc/systemd/system/battery.service. Somehow even if user ziga has all the privileges of using sudo command it can't execute systemctl hibernate inside of the bash script. I really don't know why this happens. So the working fi... | using systemd timers instead of cron |
1,345,313,914,000 |
When I want Linux to consider newly created partitions without rebooting, I have several tools available to force a refresh of the kernel "partition cache":
partx -va /dev/sdX
kpartx -va /dev/sdX
hdparm -z /dev/sdX
blockdev --rereadpt /dev/sdX
sfdisk -R /dev/sdX (deprecated)
partprobe /dev/sdX
...
I'm not sure about... |
BLKRRPART tells the kernel to reread the partition table. man 4 sd
With BLKPG you can create, add, delete partitions as you please (from the kernel, not on disk of course). You have to tell the kernel the offset and size of individual partition, which implies that you must have parsed the partition table yourself bef... | Forced reread of partition table: difference between BLKRRPART and BLKPG ioctl? (Linux) |
1,345,313,914,000 |
I have a utility that has a nasty habit of going quiet and staying there, I already know how long into the process it does this so I am using timeout to fight this, but sometimes it does it before that time. Is there a tool similar to timeout that will kill the process if it stops directing output to stdout?
|
With zsh, you could do:
zmodload zsh/system
coproc your-command
while :; do
sysread -t 10 -o 1 <&p && continue
if (( $? == 4 )); then
echo "Timeout" >&2
kill $!
fi
break
done
The idea being to use the -t option of sysread to read from your-command output with a timeout.
Note that it makes your-command... | Kill a process if it goes quiet for a certain amount of time |
1,345,313,914,000 |
I have a USB key that contains my keepass2 password database and I'd like to perform some actions when it is plugged into my computer, namely:
Auto-mount it to some specific location
When the mounting is done properly, launching keepass2 on the password database file
Simple tasks I guess, but I can't find how to do ... |
When a new device appears, udev is notified. It normally creates a device file under /dev based on built-in rules¹. You can override these rules to change the device file location or run an arbitrary program. Here is a sample such udev rule:
KERNEL=="sd*", ATTRS{vendor}=="Yoyodine", ATTRS{serial}=="123456789", NAME="k... | Triggering an action when a specific volume is connected |
1,345,313,914,000 |
I have a home partition which is shared by mulitple distros on the same box. I'm using bind mounts from fstab. Each Linux install has something like this:
UUID=[...] /mnt/data ext4 nodev,nosuid 0 2
/mnt/data/arch /home none defaults,bind 0 0
/mnt/data/files /files none defaults,bind 0 0
The ... |
It's safe to unmount one of the bind-mounted copies. After you run mount --bind /foo /bar, the kernel doesn't keep track of which of /foo or /bar came first, they're two mount points for the same filesystem (or part of a filesystem).
Note that if /foo is a mount point but /foo/wibble isn't, mount --bind /foo/wibble /b... | Umount device after bind mounting directories: is it safe? |
1,345,313,914,000 |
I am trying to identify NICs on ~20 remote servers (2-6 NICs on every server). To begin with, I want to identify those ready for use and free ones. How can I check the state of the physical media? I know some ways, including ifconfig|grep RUNNING, ethtool, cat /sys/class/net/eth0/carrier, but all they require that the... |
ip link show , by default shows all the interfaces, use ip link show up to show only the running interfaces. You could use filters to get the difference.
| Check whether network cable is plugged in without bringing interface up |
1,345,313,914,000 |
Okay its easy to create a ssh pair with ssh-keygen, but how do I generate with ssh-keygen a ssh pair which allows me to use AES-256-CBC?
The default one is always AES-128-CBC, I tried already different parameters but they didn't function like:
ssh-keygen -b 4096 -t rsa -Z aes-256-cbc
But they didn't work, any idea ho... |
You do not generate the key used by aes when you use ssh-keygen. Since aes is a symmetric cipher, its keys do not come in pairs. Both ends of the communication use the same key.
The key generated by ssh-keygen uses public key cryptography for authentication. From the ssh-keygen manual:
ssh-keygen generates, manages ... | Generate a SSH pair with AES-256-CBC |
1,345,313,914,000 |
I'm building busy-box and iptables for an embedded device and one of the dependencies for them are the kernel headers.
I have searched the whole file system for *.ko files and found none. So i concluded the apps aren't creating any loadable drivers (kernel modules).
What are other cases for a user space application to... |
Because those programs are build to use things defined in the kernel headers:
busybox-1.22.1]$ egrep -RHn '^#include <linux'
modutils/modutils-24.c:194:#include <linux/elf-em.h>
include/fix_u32.h:17:#include <linux/types.h>
libbb/loop.c:11:#include <linux/version.h>
console-tools/openvt.c:23:#include <linux/vt.h>
cons... | Why do user space apps need kernel headers? |
1,345,313,914,000 |
I'm running Ubuntu 13.10 and since I upgraded to kernel 3.12.8 (build from source, including ubuntu patches) on a ivybridge video, the boot spash screen was flickering and messing up.
So I googled around and tried adding i915.modeset=1 paramenter to grub (without really knowing what I was doing) and magically the spas... |
You are using whats called Kernel Mode Setting (KMS) to make sure that your Intel graphic drivers are loaded early in the boot process, therefore making the "fancy" boot screen display correctly.
Kernel mode-setting (KMS) shifts responsibility for selecting and
setting up the graphics mode from X.org to the kernel.... | What is i915.modeset=1 for? |
1,345,313,914,000 |
I'm trying to implement a mechanism of automated backup using udev rules and systemd. The idea is to launch a backup routine upon hot-plugging a specific storage device, quite similar to this question, for which I provided an answer myself by the way, but here I'm interesteded in discussing some further tweaks. Namely... |
While I'm not sure whether the previous approach is guaranteed to work, there's an alternative which certainly looks preferable.
The magic property is called StopWhenUnneeded. This should be set to true under [Unit] in the mount file, so it becomes:
mnt-backup.mount
[Unit]
DefaultDependencies=no
Conflicts=umount.targe... | systemd - umount device after service which depends on it finishes |
1,345,313,914,000 |
I have a Macbook Pro and I am loving it, though I still miss my Linux box, there are many things I need which are not completely compatible with Mac OS X.
I heard many stories about installing Linux on a Mac OS, some say it's not a problem, but some others tend to say differently.
My question is, is it or is not fin... |
tl;dr: it's doable but you will have to work just a little bit. If you don't have the ability to use Ethernet, and are installing from netinst media, you're basically screwed (although if you're really determined you can make it work).
When I originally wrote this answer, I'd only done this once, but now I'm doing it ... | What should I be aware of when installing Linux on a Mac? |
1,345,313,914,000 |
I was about to diff a backup from it's source to manually verify that the data is correct. Some chars, like åäö, is not shown correctly on the original data but as the clients (over samba) interpret it correctly it's nothing to worry about. The data restored from backup shows the chars correctly, leading diff to not c... |
Unix filesystems tend to be locale-agnostic in the sense that file names consist of bytes and it's the application's business to decide what those bytes mean if they fall outside the ASCII range. The convention on unix today is to encode filenames and everything else in UTF-8, apart from some legacy environments (most... | Same file, different filename due to encoding problem? |
1,345,313,914,000 |
Does the latest version of the Linux kernel (3.x) still use the Completely Fair Scheduler (CFS) for process scheduling which was introduced in 2.6.x ?
If it doesn't, which one does it use, and how does it work? Please provide a source.
|
That's still the default, yes, though I would not call it the same, as it is constantly in development. You can read how it works with links to the code at http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=blob;f=Documentation/scheduler/sched-design-CFS.txt
| Does Linux kernel 3.x use the CFS process scheduler? |
1,345,313,914,000 |
I am on a CrunchBang machine and trying to write a script that needs to have the OS install date as a reference.
I searched and found this command:
ls -lct /etc | tail -1 | awk '{print $6, $7, $8}'
It prints
Mar 31 21:24
I did not understand the tail -1 part, but was able figure out that $6 $7 $8 are the 6th 7th 8th... |
If the assumption is that you have an ext{2,3,4} filesystem, and you formatted the root filesystem when you installed the OS (and didn't do upgrades from another OS without a wipe), you can use dumpe2fs:
% dumpe2fs -h /dev/mapper/vg_desktop-lv_root 2>&1 |grep 'Filesystem created'
Filesystem created: Sat Jul 23 0... | What is a distro-agnostic way determine the OS install date? |
1,345,313,914,000 |
I want to learn SELinux to a high level, being able to understand the intricacies of domains, types and switching.
What is the best way to go about this? I considered starting with Fedora and a good manual, although as Fedora ships with so many pre-written policies I found it somewhat overwhelming.
Is there a good tu... |
Fedora's SELinux documentation is a good place to start. While referring to Fedora 13, the SELinux User Guide has plenty of information about how SELinux works. I also recommend reading Dan Walsh's Blog, where he talks about SELinux and related issues. Lastly, drop into #fedora-selinux on the FreeNode IRC network, ... | What is the best way to learn SELinux? [closed] |
1,345,313,914,000 |
Predictable network interface names are not supposed to change when hardware is added or removed. Isn't that the whole point of the naming scheme???
My wireless interface was named wlp3s0.
I installed an ASUS Xonar DX 7.1 Channels PCI Express x1 Interface Sound Card in a free PCI slot and my wireless interface name ch... |
Predictable network interface names are not supposed to change when
hardware is added or removed. Isn't that the whole point of the naming
scheme???
Long story short, this is nothing new; it's expected/intended. Therefore, you don't need to file a bug, unless you want to ask your PC-maker to support Linux better (B... | Why did the interface name of my wireless card change when I added a sound card? |
1,345,313,914,000 |
I am experiencing quite heavy audio skipping when streaming audio to my bluetooth speaker (Sony SRS-X3) using pulseaudio and Arch Linux on a T430. I think it is related to a known bug [1]. The speaker works flawlessly with Android.
$ sudo lspci -nnk | grep -iA2 net
> Network controller [0280]: Intel Corporation Cent... |
It may help to disable the bluetooth coexistance parameter of the iwlwifi module to see if conditions improve. Open a terminal window and enter
echo "options iwlwifi bt_coex_active=0" | sudo tee -a /etc/modprobe.d/iwlwifi.conf
Reboot
| How to prevent bluetooth audio skipping with the A2DP profile on Arch Linux? |
1,345,313,914,000 |
I'm running a Laptop with Arch Linux, X.org and i3. Due to a broken LCD panel, I would like to disable/ignore the left ~228 Pixels of the screen until I have time to get it repaired.
So far, I've tried using a non-standard resolution and then adding an offset, but had no success. Is there any simple solution for this?... |
You can use xrandr.
I have tested this breathy on a single monitor.
First look at current resolution and subtract 228 from X. Replace X and Y below for new resolutions Y=y, X=x-228. (note in the text below lower case x is a literal x). Run xrandr to get output name.
Then xrandr --fb XxY --output OUTPUT_NAME --transfo... | How can I disable a part of the screen in X.Org |
1,345,313,914,000 |
I am reading the man page of mount and clone.
I understand that mount is used to add a directory hierarchy to a mount point (a directory).
In clone's man page, under the CLONE_NEWNS section, they refer to mounts as the file hierarchy as seen by a process.
My question is that, is the term 'mount' being used to refer to... |
Id express it like this:
"mount points": locations in the file hierarchy where file systems have been mounted to
"mounts": the set of mounted file systems / the set of locations in the file hierarchy where file systems have been mounted to
"to mount": the action of mounting a file system into the file hierarchy
The... | Confusion regarding the term 'mount' in Linux |
1,345,313,914,000 |
Are there any man pages on the /sys/ directory and how devices are setup? I'm hoping that there may be something similar to man proc, but can't really find anything to push me in the right direction.
|
How devices are "set up", in general, has nothing to do with /sys. Most likely you are looking for information about udev or another hotplugging daemon.
You can find authoritative information about /sys (for which, the underlying filesystem is called sysfs) in the kernel documentation.
| /sys/ documentation? |
1,345,313,914,000 |
If I do the following command on my standard Linux Mint installation:
comp ~ $ ps -eo rtprio,nice,cmd
RTPRIO NI CMD
...
99 - [migration/0]
99 - [watchdog/0]
99 - [migration/1]
- 0 [ksoftirqd/1]
99 - [watchdog/1]
I get some of the processes with realtime priority of 99.
What is the meaning of rtprio in a n... |
"Real time" means processes that must be finished by their deadlines, or Bad Things (TM) happen. A real-time kernel is one in which the latencies by the kernel are strictly bounded (subject to possiby misbehaving hardware which just doesn't answer on time), and in which most any activity can be interrupted to let high... | Real time priorities in non real time OS |
1,345,313,914,000 |
I have a linux DHCP server running on my network.
I recently found out that I can assign specific IP addresses to clients based
on their MAC address by modifying the dhcpd.conf file.
Now is there something I can do from the server side that would invalidate a
specific client's lease, forcing it to get a new one from ... |
The answer to this depends on how you previously configured the DHCP server.
Normal DHCP behaviour is this:
Lease is given a lease time perhaps 7days.
Client machine starts requesting a new lease half way through the current lease period.
Client machine only stops using the IP address when it either gets a new lease ... | Force dhcp client to get a new lease |
1,345,313,914,000 |
From the man page, I know you can use raw sockets, but I don’t understand what is meant by “bind to any address for transparent proxying”. I know there’s another capability required to bind to privileged ports, so I know you can’t bind to any port. Is there a way to tell Linux that you’re binding on an address for pro... |
Quoting from this Security SE Answer:
CAP_NET_RAW: Any kind of packet can be forged, which includes faking senders, sending malformed packets, etc., this also allows to bind to any address (associated to the ability to fake a sender this allows to impersonate a device, legitimately used for "transparent proxying" as ... | What does CAP_NET_RAW do? |
1,345,313,914,000 |
I have a chroot setup and I've been running graphical applications from it with no problem. The only setup I've done is set DISPLAY=:0 and it works. However I always thought Unix domain sockets were used for X11 so I couldn't figure out why this was working. I did a little digging and it turns out I was right. My X.or... |
The X server also supports abstract sockets, which work identically to UNIX sockets, and have pathnames similar to UNIX sockets, but the pathnames start with a NUL character. See the documentation for "abstract" in the unix(7) manpage. An abstract socket effectively exists in all filesystem namespaces and chroots; y... | X.org working with no socket in chroot? |
1,345,313,914,000 |
Is it possible to disable L1 and/or L2 cache on Ubuntu 14.04 (preferably in a higher level language like Python)? If so, how?
In addition, will disabling the cache differ significantly between different architectures? If so, I'm more interested in an ARM Cortex-A15.
EDIT
While researching how to disable the cache, I d... |
You can not do it directly in Python, as you need a kernel module to do that (and root rights to load that module).
See http://lxr.free-electrons.com/source/arch/arm/mm/cache-v7.S#L21 for what it takes to invalidate the L1 cache (invalidate, not disable).
Different CPU architectures (e.g x86 vs ARM) require different ... | How to disable processor's L1 and L2 caches? |
1,345,313,914,000 |
I have an 8G usb stick (I'm on linux Mint), and I'm trying to copy a 5.4G file into it, but getting
No space left on device
The filesize of the copied file before failing is always 3.6G
An output of the mounted stick shows..
df -T
/dev/sdc1 ext2 7708584 622604 6694404 9% /media/moo/ba20d7ab-2c46-4... |
Your 8GB stick has approximately 7.5 GiB and even with some file system overhead should be able to store the 5.4GiB file.
You use tune2fs to check the file sytem status and properties:
tune2fs -l /dev/<device>
By default 5% of the space is reserved for the root user. Your output lists 97894 blocks, which corresponds ... | Unable to copy large file onto ext2 usb stick [closed] |
1,345,313,914,000 |
Is there currently a generic command that will "pivot" input.
e.g.
#labeled.file
name: bob
title: code monkey
name: joe
title: pointy haired
is converted to:
name title
bob code monkey
joe pointy haired
and vice-versa
|
I'm not sure there's something in coreutils that can do this, but it seems your question has been asked before by people not necessarily interested in an existing tool like you seem to be. The following links may be interesting to you as a last resort in case you can't find a tool that already does this.
Transpose a ... | Command to transpose (swap rows and columns of) a text file [duplicate] |
1,345,313,914,000 |
I am experimenting mounting options for a program I am writing. I am running Linux Mageia 2.
I added the following line to /etc/fstab
/dev/sr0 /mem auto user,noauto, 0 0
and I removed all other entries regarding /dev/sr0 which is the device for my DVD drive.
Then, acting as normal user, I can successfully
$ mount /d... |
The problem is that your /etc/mtab is not a file but a symlink to /proc/mounts. This has advantages but also the disadvantage that user does not work. You already guessed right the reason for that: "the system is confused when remembering who mounted the file system". This information is written to mtab, cannot be wri... | Option "user" work for mount, not for umount |
1,345,313,914,000 |
I'm developing for a specific TI ARM processor with custom drivers that made it to the kernel. I'm trying to migrate from 2.6.32 to 2.6.37, but the structure changed so much I will have weeks of work to upgrade my code.
For example, my chip is the dm365, which comes with video processing drivers. Now most of the old d... |
If you select a kernel to track, be sure to select one that is tagged for long-term support. But sooner or later you will have to move on...
| How am I supposed to keep up with kernels as a developer? |
1,345,313,914,000 |
Is it OK for two or more processes concurrently read/write to the same unix socket?
I've done some testing.
Here's my sock_test.sh, which spawns 50 clients each of which concurrently write 5K messages:
#! /bin/bash --
SOC='/tmp/tst.socket'
test_fn() {
soc=$1
txt=$2
for x in {1..5000}; do
echo "${txt}" | so... |
That is a very short test line. Try something larger than the buffer size used by either netcat or socat, and sending that string in multiple times from the multiple test instances; here's a sender program that does that:
#!/usr/bin/env expect
package require Tcl 8.5
set socket [lindex $argv 0]
set character [str... | Concurrently reading/writing to the same unix socket? |
1,472,722,116,000 |
With stat 8.13 on a Debian based Linux - among many others - the following FORMAT directives (--format=) are offered:
In combination with --file-system (-f):
%s Block size (for faster transfers)
%S Fundamental block size (for block counts)
Question(s): What exactly is meant?
My best guess is that %s, %S equals %b ... |
%S fundamental block size (for block counts)
tells you how big each block is on the file system. On most file systems, this is the smallest amount of space any file can take up. Each file uses a multiple of this.
For example,
$ echo > a # create a file containing a single byte
$ du -h a ... | stat file system sizes |
1,472,722,116,000 |
We have a company RDS (Remote Desktop Server) TSG (Terminal Services Gateway) server, which allows employees to connect to an RDS session from home, so they can see a work RDS desktop from home.
This works fine on their home computers using windows 7 with the following settings:
... |
You need to make sure that the layout of the command you are typing is correct. If you have one thing messed up or in the wrong location then you will have an error no matter what you try.
the command you tried to run $ xfreerdp /f /rfx /cert-ignore /v:farm.company.com /d:company.com /g:rds.company.com /u:administrat... | Can't connect to an external RDS TSG server from home |
1,472,722,116,000 |
I want to create a fixed size Linux ramdisk which never swaps to disk. Note that my question is not "why" I want to do this (let say, for example, that it's for an educative purpose or for research): the question is how to do it.
As I understand ramfs cannot be limited in size, so it doesn't fit my requirement of havi... |
This is just a thought and has more than one downside, but it might be usable enough anyway.
How about creating an image file and a filesystem inside it on top of ramfs, then mount the image as a loop device? That way you could limit the size of ramdisk by simply limiting the image file size. For example:
$ mkdir -p /... | How to create a fixed size Linux ramdisk which does never swap to disk? |
1,472,722,116,000 |
I recently installed Fedora 14 on my home PC so I have a dual boot system running windows and linux. I probably would primarily use Linux on that machine as its older and Linux manages its resources MUCH better than Windows does, BUT I'm a bit of a Netflix junky and from what I've read there isn't currently a solutio... |
there is an easy way to install netflix now. How to install Netflix on Ubuntu, Linux Mint and Fedora
$ sudo apt-add-repository ppa:ehoover/compholio
$ sudo apt-get update && sudo apt-get install netflix-desktop
| How can I watch Netflix on Linux? |
1,472,722,116,000 |
Under Linux, is it possible to view error messages that show up on the text mode terminal while in GUI mode, instead of having to press Ctrl+Alt+F1 or Ctrl+Alt+F2 to view the messages every time and then switching back to GUI mode by pressing Ctrl+Alt+F7?
Thank you.
|
You can see the current contents of the text console /dev/tty1 in the file /dev/vcs1 (where 1 is the number in Ctrl+Alt+F1). (If you try to read from /dev/tty1, you'll compete with the program running there for keyboard input.) The vcs devices are normally only readable by root. You get a snapshot; there's no convenie... | Viewing system console messages in GUI |
1,472,722,116,000 |
I am trying to figure out why the following device is not setup to its driver on my Creator CI20. For reference I am using a Linux kernel v4.13.0 and doing the compilation locally:
make ARCH=mips ci20_defconfig
make -j8 ARCH=mips CROSS_COMPILE=mipsel-linux-gnu- uImage
From the running system I can see:
ci20@ci20:~# f... |
A working solution to get the driver to bind to the device is:
cgublock: jz4780-cgublock@10000000 {
compatible = "simple-bus", "syscon";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x10000000 0x100>;
ranges;
cgu: jz4780-cgu@10000000 {
compatible = "ingenic,jz4780-cgu";
re... | How to debug a driver failing to bind to a device on Linux? |
1,472,722,116,000 |
I'd like to set up my laptop so that if a wrong password is entered when the screen is locked, a picture is taken using the laptop's webcam. I examined xlock (from xlockmore package), but there is no option to run a customized action when a wrong password is entered.
There is a similar question on SuperUser, but only ... |
Copied this post on ask Ubuntu by gertvdijk, pointed out by mazs in the comments. In the effort of closing this question.
Based on this post on the Ubuntuforums by BkkBonanza.
This is an approach using PAM and will work for all failed login attempts. Using SSH, a virtual terminal or via the regular login screen, it d... | Taking a picture with a laptop webcam after entering an incorrect password |
1,472,722,116,000 |
After 30 minutes of uptime using Ubuntu 14.04 with a hybrid SSD I see many processes blocking IO using iotop. This is during disk writes, for example if I open and close an empty file in gedit it can take 2 seconds to close down due to dconf writing settings, this effects other apps in a similar way; slowing the whole... |
The symptoms are very consistent with a mostly saturated IO system, however having for the most part ruled out IO load from the OS/userspace side, another possibility is the drive running self-tests on itself, which may include reading from all the sectors. This should be queryable/tunable from smartctl (At least one ... | Calls to sync/fsync slow down after 30 minutes uptime |
1,472,722,116,000 |
If I opened hexdump without any argument in the terminal:
hexdump
When I type something in the terminal and press Enter, hexdump will display the hex values for whatever characters I type.
But hexdump will only display the hex values if I type 16 characters, for example:
Here, I typed the character a 15 times and I ... |
Try hexdump -v -e '/1 "%02X\n"'. That displays one hex byte per line, so the line output buffering won't stop the line from being displayed.
Then you only have to type A and return to know the hex value for A. You still have to type return, because the shell buffers also does line buffering on the input.
man ascii als... | How to make hexdump not wait for 16 characters from stdin to display their hex values? |
1,472,722,116,000 |
My computer runs Windows Server 2008 R2. It hosts a Hyper-V virtual machine running Ubuntu 12.04 as the guest OS.
I want to copy text from Ubuntu and paste this text in Windows (and copy text in Windows and paste it in Ubuntu). How can I do this?
|
You can use ncat - which also has a windows port - to transfer data over network. On one system you run it in "listen" mode, where it binds to some port, on the other system you connect to that port on the other machine. This creates a bi-directional pipe. On Linux you can choose from more variants (GNU netcat, BSD ne... | Copy-paste between Hyper-V guest and host |
1,472,722,116,000 |
I am interested in setting environmental variables of one shell instance from another.
So I decided to do some research.
After reading a number of questions about this I decided to test it out.
I spawned two shells A and B (PID 420), both running zsh.
From shell A I ran the following.
sudo gdb -p 420
(gdb) call setenv... |
Most shells don't use the getenv()/setenv()/putenv() API.
Upon start-up, they create shell variables for each environment variable they received. Those will be stored in internal structures that need to carry other information like whether the variable is exported, read-only... They can't use the libc's environ for th... | Why can't I print a variable I can see in the output of env? |
1,472,722,116,000 |
A month or two ago, I installed the latest version of Puppy Linux to an old Eee PC which I hardly use any more. Well I'm on it now! But I can't figure out how to update it.
It uses a weird Puppy package manager which only seems to have options for installing and uninstalling things. I found an option to update the dat... |
Please go through this blog as i think it exactly describes what you need : how-to-update/upgrade-kernel-for-puppy-linux
I think this site could also help you.. flash-puppy
Another link which might help you is : Update from 4.1.2 to 4.2
Note : Take a look at this site also : installing-puppy-linux-to-your-hard-drive
... | How to update Puppy Linux? |
1,472,722,116,000 |
I'm trying to understand the Completely Fair Scheduler (CFS). According to Robert Love in Linux Kernel Development, 3rd edition(italics his, bold mine):
Rather than assign each process a timeslice, CFS calculates how long a
process should run as a function of the total number of runnable
processes. Instead of us... |
The 2 sentences are just explaining 2 instances of how CFS could work - the former is when 2 tasks have the same nice value and the latter when the 2 tasks have different nice values. In general, the time slice calculated for each task boils down to this formula:
timeslice = (weight/total_weight)*target_latency
weigh... | Does the timeslice depend on process priority or not under Completely Fair Scheduling? |
1,472,722,116,000 |
I'm aware that this article exists:
Why are hard links only valid within the same filesystem?
But it unfortunately didn't click with me.
https://www.kernel.org/doc/html/latest/filesystems/ext4/directory.html
I'm reading operating system concepts by Galvin and found some great beneficial resources like linux kernel doc... |
A "hard link" just is the circumstance that two (or more) entries in the hierarchy of your file system refer to the same underlying data structure. Your figure illustrates that quite nicely!
That's it; that's all there is to it. It's like if you have a cooking book with an index at the end, and the index says "Bread:... | Why can't hard links reference files on other filesystems? |
1,472,722,116,000 |
I have a Dell Inspiron 15R N5110 Laptop (Core i5 2nd Gen/4 GB/500 GB/Windows 7).
I previously installed Windows 10 on my system, but my computer was very slow, so I decided to install Linux on it.
It is currently running Windows 7.
My problem is: the only drivers I have for my laptop are Windows 7's and I can't find ... |
It is very unlikely that you will need any additional device drivers other than those that already come with most popular Linux distributions, specially on non brand new laptops. The only exception regards GPU devices used for games, such as NVidia and AMD Radeon GPUs. In such cases, some manufacturers sometimes provi... | Do I need drivers to install Linux on my old laptop? Am I likely to face any problems if I install it? [closed] |
1,472,722,116,000 |
I have a plain text file (not containing source code). I often modify it (adding lines, editing existing lines, or any other possible modification). For any modification, I would like to automatically record:
what has been modified (the diff information);
the date and time of the modification.
(Ideally, I would also... |
You could try the venerable RCS (package "rcs") as @steeldriver mentioned, a non-modern version control system that works on a per-file basis with virtually no overhead or complication. There are multiple ways to use it, but one possibility:
Create an RCS subdirectory, where the version history will be stored.
Edit ... | Keep a history of all the modifications to a text file |
1,472,722,116,000 |
I am trying to setup OpenVPN but I am getting this error:
#./build-ca
grep: /etc/openvpn/easy-rsa/2.0/openssl.cnf: No such file or directory
pkitool: KEY_CONFIG (set by the ./vars script) is pointing to the wrong
version of openssl.cnf: /etc/openvpn/easy-rsa/2.0/openssl.cnf
The correct version should have a comment th... |
it's hard to tell without more information...
anyhow, you have either
not properly configured your installation via the vars file
or you haven't activated the vars file by running source vars prior to running ./build-ca
the vars file contains (among other things) the definition of the KEY_CONFIG variable. the defau... | KEY_CONFIG pointing to the wrong version of openssl.cnf |
1,472,722,116,000 |
On Linux, is there a way for a shell script to check if its standard input is redirected from the null device (1, 3) *, ideally without reading anything?
The expected behavior would be:
./checkstdinnull
-> no
./checkstdinnull < /dev/null
-> yes
echo -n | ./checkstdinnull
-> no
EDIT
mknod secretunknownname c 1 3
exec... |
On linux, you can do it with:
stdin_is_dev_null(){ test "`stat -Lc %t:%T /dev/stdin`" = "`stat -Lc %t:%T /dev/null`"; }
On a linux without stat(1) (eg. the busybox on your router):
stdin_is_dev_null(){ ls -Ll /proc/self/fd/0 | grep -q ' 1, *3 '; }
On *bsd:
stdin_is_dev_null(){ test "`stat -f %Z`" = "`stat -Lf %Z /d... | How to check if stdin is /dev/null from the shell? |
1,472,722,116,000 |
I started using sed recently. One handy way I use it is to ignore unimportant lines of a log file:
tail -f example.com-access.log | sed '/127.0.0.1/d;/ELB-/d;/408 0 "-" "-"/d;'
But when I try to use it similarly with find, the results aren't as expected. I am trying to ignore any line that contains "Permission denie... |
The problem is error ouput printed to stderr, so the sed command can't catch the input. The simple solution is: redirecting stderr to stdout.
find . -name "openssl" 2>&1 | sed '/Permission denied/d;'
| How can I filter those "Permission denied" from find output? [duplicate] |
1,472,722,116,000 |
May i know the max partition size supported by an Linux system. And how much logical and primary Partition as we can create in an disk installed by linux system?
|
How Many Partitions
I believe other, faster and better people have already answered this perfectly. :)
There Is Always One More Limit
For the following discussion, always remember that limits are theoretical. Actual limitations are often less than the theoretical limits because either
other theoretical limits constra... | What is the max partition supported in linux? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.