New answers tagged

0

The process is blocking on a mutex (or futex in linux speak). So the backlog is legit, we're literally stuck behind a system call and though the connections are going away, nothing else is updating. For future reference to others finding this question, this was the break-through command: # strace -p 5340 Process 5340 attached futex(0x223cee0, ...


0

In general, availability monitoring must be done externally, and in most situations you'd do it in regular intervals whose length depends on your needs. Do you know the cause of the outage in question? Was it a server reboot or network interruption? If you have unexpected reboots, you could let the server send you mail with relevant logging data right after ...


1

If you want a complicated distro, Arch is the best. Reasons No graphical installation. You'll have to run commands to install it. That includes- Setting up the partitions, Installing the system, Configuring locales, time etc. , Setting up internet. During installation, you will be able to "handpick" ackages that you want. This will increase your knowledge ...


0

Looks like your sshd is configured to accept ecdsa key. You can either track down on the server-side why it's only looking for ecdsa keys instead of rsa, or you can resolve this from client side by providing an ecdsa key. The steps to create and use an ecdsa key from the client are as follows: ssh-keygen -t ecdsa -b 256 -N '' -f ~/.ssh/id_ecdsa ssh-copy-...


0

If your command works, simply put it in $HOME/.bashrc if you are using a bash shell. $HOME will be /root for root, /home/XYZ for user XYZ, etc. For ls command, you can create an alias like so (again, in bashrc): alias ls='ls --color=auto' You can always source the .bashrc file too in your current shell if you, for some reason, do not want to spawn a ...


0

PostgreSQL 9.5 isn't available in the AWS repos yet, but for 9.4: sudo yum update sudo yum install postgresql94 Source


0

List files by size ascending would be: ls -lSr


4

Use the metric directive in the interfaces. The higher the value, the lower the priority. allow-hotplug eth0 iface eth0 inet static address 192.168.20.2 netmask 255.255.255.0 gateway 192.168.20.1 metric 30 allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf metric 10 Then restart networking ...


0

You can also search for files on your system with the 'locate' command. Before using the command (for the first time) you will have to populate the updatedb database that keeps track of where everything is on your machine (and is what the updatedb command queries). That must be done as a root user. So, first populate your updatedb database: sudo updatedb ...


0

This usually means that the system will run out of process slots before the user's limit is reached. The man page of setrlimit says: RLIMIT_NPROC The maximum number of processes (or, more precisely on Linux, threads) that can be created for the real user ID of the calling process. Upon encountering this limit, fork(2) fails with ...


2

PIDs do wrap around in normal usage. That's not a problem at all; the kernel ensures that new PIDs don't collide with existing PIDs. Nothing says that PIDs have to be monotomically increasing; process 12345 could easily fork() and have a child process of 5001. In this scenario, yes, a user could potentially use up all process slots and prevent further ...


0

I don't see a need for a function here. If you do need a function, it might be best to pass the variable as a parameter, rather than attempting to use it as a global variable. However, it seems pretty straight forward to just nest the loops: for mac in $(awk -F";" '{print $2}' macs.txt); do iptables -t nat -A PREROUTING -i eth1 -m mac --mac-source $mac -...


3

fallocate -l 50G big_file truncate -s 50G big_file dd of=bigfile bs=1 seek=50G count=0 As those three ways can all fill up a partition quickly. If you like use dd, usually you can try it with seek. Just set seek=file_size_what_you_need and set count=0. That will tell the system there is a file, and its size is what you set, but the system will not create ...


10

Other alternatives include: to change the alarm thresholds to something near or below the current usage, or to create a very small test partition with limited inodes, size, or other attributes. Being able to test things such as running into the root reserved percentage, if any, may also be handy.


2

It depends on the application, and thus may vary from "ha ha ha, no." to possibly "yes" though given the infinite variety of errors that can be introduced, and the specific needs of the thing being configured, it is more likely that buggy undesirable input will be generated than the error caught by a validator (and then there's syntactically correct but ...


1

Found the answer here: https://wiki.debian.org/DebianSqueeze My apt sources needed to be pointed at archive.debian.org rather than http.debian.net


24

The fastest way to create a file in a Linux system is fallocate: sudo fallocate -l 50G file Re @gerrit's question about why I'm using sudo to run it, fallocate needs root privileges because it does not actually "create" the file per se, it manipulates the file allocation system directly, thus being almost instant as the question asks, as it doesn't have ...


0

This is an old post but I wanted to share another way to do this which I found out by accident: sg_vpd --page=bdc /dev/sda This commands fetches the Vital Product Data for the block device characteristics. For a rotating head disk, the output will include: Nominal rotation rate: 7200 rpm For an SSD, it will include: Non-rotating medium (e.g. solid ...


0

fork: Resource temporarily unavailable The error means that the current shell resource is limited (check the limits by ulimit -a). So you can either try in another shell, or increase the resources by using ulimit command which controls over the resources available to the shell and processes it creates on operating system. To increase the limits, try ...


1

You need to (at least) remove apache2.2-bin: apt-get remove apache2.2-bin Alternatively, you can force the installation of apache2-bin: dpkg -i --force-overwrite /var/cache/apt/archives/apache2-bin_2.4.20-2_amd64.deb and then try apt-get -f install again.


7

They are not the same. The -g option specifies the "primary" group that a user should belong to, while the -G option specifies one or many supplementary ("secondary") groups. On a work machine I have access to I have $ id uid=1001(me) gid=1001(me) groups=1001(me),27(sudo),110(lxd),1005(theproject) This shows that my "primary" group is me (same as my ...


1

The group applied via -g is the primary group, so for example when you create a file it will default to making it with your primary group as the group associated with that file. You can however temporarily change which group it uses as default with the sg or newgrp commands. All groups in the -G are secondary groups. More about this here


11

-g sets the initial, or primary, group. This is what appears in the group field in /etc/passwd. On many distributions the primary group name is the same as the user name. -G sets the supplementary, or additional, groups. These are the groups in /etc/group that list your user account. This might include groups such as sudo, staff, etc.


1

You wrote: result of execution of ls -l $(type -p su) -rwxr-xr-x root root 157400 2016-04-21 19:11 su There's your problem. su is missing the setuid root bit. The permissions should look like this: -rwsr-xr-x 1 root root 40040 Nov 12 2015 /bin/su There are three possibilities for this situation. The su executable on the server is not setuid (...


0

This will (pretend to) delete any differences between the folders: diff -awr folderA folderB | sed 's/Only in //;s/: /\//' | while read f; do echo "removing ${f}"; done; If you want to remove differences in A but not B, you can add in a grep like so: diff -awr folderA folderB | sed 's/Only in //;s/: /\//' | grep "^folderA/" | while read f; do echo "...


0

A logical partition is different from LVM which stands for logical volume manager. First clarifying what logical partition is, they are simply partitions within an Extended partition, which is just like a Primary partition except you can sub-partition it and fill it with infinite logical partitions. As you may have noticed, PC hard disks only allowed 4 (...


0

Make each script listen on a UNIX domain socket and answer with status when queried. Writing the PID to a file as suggested in another answer works, but it creates a race condition. The PID file is not automatically removed when the script dies, so the PID you read from the file can be stale. On systems with random PIDs the former PID of your script can ...


0

You can refer this link this link. rsync is having the feature of deleting the folder which doesn't exits on the live ENV. rsync -av --delete


0

xmonad is non-reparenting and this causes issues with some applications. Moreover, the problem happens because the applications do not know that xmonad is a non-reparenting window manager. A common solution to this is to set xmonad's window manager name to LG3D. lg3d is an ancient window manager written in java, but, since it has been a huge hype when its ...


3

The manual page for userdel describes the -r option, which would remove the home-directory at the time you removed the user. If you did not do it then, you could find files with no known user with the find option -nouser, e.g., find /home -nouser -delete though you might want to verify the list before actually deleting the files: find /home -nouser -ls ...


0

nobootwait worked very well for me in Linux Mint until version 18. I miss it. Using nobootwait could result in writing to your OS drive rather than a mounted drive, but only if you are careless. If you always write to a folder on your mount, then if the mount fails the folder will not exist and the write fails.


2

You have a couple of options here: Check the modification date of the file to see if it's being updated: ls -l /var/backups/your-file.sql If you haven't quite migrated over to systemd yet, cron should be logging to /var/log/syslog, in which case you can do something like this and check the timestamps: cat /var/log/syslog | grep -i cron If you are ...


2

Save each command's PID number using bash's special shell var '$!' which is the process pid of the last command, then just check '/proc/PID' existence before trying to run the command again. #!/bin/bash do_cuckoo() { python /opt/cuckoo/cuckoo-2/cuckoo.py 1>cuckoo_script/cuckoo_start.txt 2>&1 & echo $! >/tmp/cuckoo.pid } do_web() { ...


2

See this similar stackoverflow question. The pgrep command can check the existance of a running process. The comman pgrep -f <file> will return the number of current instances of the specified file. For example: [user@localhost ~]$ pgrep -f /sbin/init 1 [user@localhost ~]$ It will return nothing if the file is not associated with a process. This ...


0

First check that the camera supports this distro, and that you have the correct architecture. Then check that you have a bootable image, you would probably use the same image as would be on a harddisk, but check the boot requirements of the camera. Now copy the image: use a command such as dd e.g. dd if=the-poky-image-to-copy of=/dev/disk/by-id/usb-...


2

I'm sure someone is still doing this, but back in the days before stuff like ILO/DRAC/etc. became cheap and ubiquitios the best way to get "out of band" access to the console in case of emergencies or an oops was over the serial port. You would mount a Terminal Server in the rack, then run cables to the serial port of your servers. Some BIOSs supported ...


1

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 files are as follows: /etc/systemd/system/...


3

Proper way of doing this is to put those commands in a simple shell script and executing this script, after transferring it to the remote machine, by a single remote ssh command rather than two commands on one line, separated by a semicolon. Normally, as Julie said, it is not something to worry about but it is not bullet-proof either. Also, consider, some ...


4

When you press Enter, the full command is already on the remote machine. There is no guarantee that this will not cause a disconnect but the reason it hasn't impacted your session so far is that the system didn't have time to notice the disconnection which actually happened. Processes which are receiving data while it gets disconnected will probably ...


0

Thanks Giles, I now realize I miss-understood the terminology of 'focus'. I want to focus the terminal but only have the web browser viable. A basic method (Openbox 3.5.2, Raspbian, Pi3). Edit rc.xml to include a window focus key-binding, e.g. keybind key="W-x" <action name="PreviousWindow"> <finalactions> <action name="Lower"/&...


0

first, sudo apt-get install libudev1 && cd /lib/i386-linux-gnu/ && sudo ln -s libudev.so.1 libudev.so.0 then $ cd ~/Popcorn-Time $ ./Popcorn-Time


0

For dd, setting the block size simply tells dd how many bytes to read in each read-store-output cycle. bs=nnn has no impact on filesystem block size, as dd operates on raw devices or binary files, treating input simply as a stream of bytes, and does not know about filesystems.


1

On Debian, the recommended approach if you want to install the proprietary NVIDIA drivers is to enable the contrib and non-free repositories and install the packaged driver. Adapting the instructions for Debian 8 (do everything as root or via sudo): add contrib non-free to the appropriate line in /etc/apt/sources.list, so you end up with something like ...


2

To have the usage per IP address, You can create an iptable rule for each IP address in the FORWARD chain and track iptables statistics counters. Taking it from Network Statistics with iptables and rrdtool iptables -N stats iptables -A stats -s 192.168.0.3 -o $WAN -j RETURN iptables -A stats -d 192.168.0.3 -i $WAN -j RETURN iptables -A stats-s 192.168....


1

As I knew, Linux can only create three kinds of partitions. they are primary, extended, and logical No, that's wrong. What you're describing here is PC old-style “MBR” partitions. This was the standard partition type on PC-type computers (and some others) since the 1980s but these days it's being replaced by GUID partitions. Logical vs primary partition is ...


1

The Linux kernel strives to have stable interfaces for everything that applications use. This includes not only system calls but also files under /proc and under select parts of /sys (some parts of /sys are officially unstable and do change, refer to the documentation for details). /proc/net/dev is documented so it's a stable interface. You can count on it ...


2

GTK 3.20 made some significant changes to the way that themes are handled. Unfortunately, the Delorean theme has not been updated to support GTK 3.20. You need to use a theme that is GTK 3.20 compliant like the Vertex or Arc themes (or petition the Delorean theme author to make the theme GTK 3.20 compliant).


2

Unfortunately, that's just not going to work well—not because of the IP being on both interfaces, but because the subnet is. If your device needs to talk to 192.168.1.2, which interface should it send that traffic on? Maybe that's the customer's device trying to talk to your device, maybe it's your device trying to talk to one of your other devices. The ...


2

May be you shoul try to add first start after boot, like this: [Timer] OnBootSec=15min OnUnitActiveSec=2m



Top 50 recent answers are included