Hot answers tagged

6

In gcc –Werror this character: – is not a dash (-), but an en-dash. Replace that and/or use a different editor.


6

resize2fs probably didn't finish the job, but you can't tell because you missed the end of its output. You should not have gone ahead and executed lvreduce at that point. There is a very good chance that this corrupted part of your filesystem. Note that you cannot undo this operation by running lvextend and hoping that the lost bytes come back and that the ...


4

What's probably happening is that the CPU goes into a more aggressive power-save mode. This causes the internal switch-mode voltage regulators to go into a pulse-skipping mode, moving the switching frequency down to the audible range. The noise comes from the inductors and capacitors, both being slightly microphonic (which also works in reverse; the emit ...


4

Because any directory is valid mountpoint The content of the latest mounted share will be listed AFAIK you cannot. The latest mount will be unmounted firstly # mkdir testmount # mount --bind /bin/ testmount/ # mount --bind /usr/bin/ testmount/ # mount |grep testmount /bin on /testmount type none (rw,bind) /usr/bin on /testmount type none ...


3

On Debian or Ubuntu install stress-ng with apt-get install stress-ng. Then run: stress-ng -c 1 -l 50 playing with -c (number of CPUs) and -l (percentage load) parameters. For Fedora/RedHat/CentOS it seems you have to compile it (source repository is here) with the following procedure: wget ...


3

As for firewalls, I would be worried where they are placed, your Internet speeds, and how much rules you need on them. They can pretty much dictate the kind of hardware you will need. Be aware for more performance/higher speeds you may need better NIC cards. In the past I used top tier Intel Pro cards. About router/firewalls in ISP settings, I used to have ...


3

For python at least I recomend "Learn Python The Hard way", by Zed Shaw. Freely available online. Good stuff. Not sure if posting a link here is technically advertising... Here goes. Free Book


3

That is expected behaviour; if you do not allow recursion, BIND wont iterate through the possibilities/servers to eventually got your answer, and thus wont be able to answer. The important part is creating ACLs limiting the networks who can do recursive requests, and avoid an open DNS server that can be and will be abused remotely. I would also advise to ...


3

Yes, unless you have a very recent kernel there is significant overhead when using loop devices on linux: data accessed through the loop device has to go through two filesystem layers, each doing its own caching so data ends up cached twice, wasting much memory (the infamous "double cache" issue) Aside from casual use better alternatives would be to use a ...


2

By following the strace of the first command (date): open("/etc/localtime", O_RDONLY) It access the timezone file pointed by /etc/localtime which is /usr/share/zoneinfo/europe/Zurich in my case. So everything fine so far. The strace of the second command (date -u) gave me hints why it wasn't working properly: open("/usr/share/zoneinfo/UTC0", ...


2

There are lots of ways, e.g., awk '/^..00/{ next; }{ print; }' < mydata sed '/^..00/d' < mydata


2

grep can do that: grep -v '^..00' inputfile


2

Blocking USB devices based on various attributes (including the class and/or protocol) or even conditions (e.g. "if this device is connected, then" or "if the local time is in this range, then") is possible using USBGuard. Here's an example rule that blocks a specific class of USB devices: block with-interface one-of { 02:*:* e0:*:* } The rule will block ...


2

Came looking for a one-liner on MacOS. Settled on the following. Compiled and added this tool to my path. This took less then 30 seconds. $ git clone git@github.com:sschober/kqwait.git $ cd kqwait $ make $ mv kqwait ~/bin $ chmod +x ~/bin/kqwait Next, I went to the directory in which I wished to do the watching. In this case, I wished to watch a markdown ...


2

It is expected behaviour. I believe what you mean is: zdump -v /etc/localtime localhost and localtime are two complete different things, although both start with local... =)


2

If you know the package name you could do something like dpkg -l vsftpd to see what the package is about. If you don't have any idea about package name On debian or debian based systems you may do dpkg -l | grep ftp # grab everthing that contain ftp And with the results, you may do dpkg -p result On Redhat or Redhat based systems like Fedora , ...


2

The problem was a missing module XT_TCPUDP There is the full list of dynamic loaded module for my command : xt_nat 1527 1 - Live 0xbf12f000 xt_tcpudp 1961 1 - Live 0xbf12b000 iptable_nat 2396 1 - Live 0xbf127000 nf_conntrack_ipv4 11354 1 - Live 0xbf120000 nf_defrag_ipv4 1331 1 nf_conntrack_ipv4, Live 0xbf11c000 nf_nat_ipv4 3401 1 iptable_nat, Live ...


2

/dev/shm : It is nothing but implementation of traditional shared memory concept. It is an efficient means of passing data between programs. One program will create a memory portion, which other processes (if permitted) can access. This will result into speeding up things. /run/lock (formerly /var/lock) contains lock files, i.e. files indicating that a ...


2

Where is "n"? You write: sd = sqrt(ss/n) but where in your code did you assign the variable "n"? The way awk sees it, "n" is zero. Also, where is column 5 in a=$5 (and, third issue, why is this assignment in the END section)? Your example contains only 4 columns.


2

Don't run it as root, that's a serious security risk. Setup a new user for each if needed and make sure that they only have access to what they strictly need. If your application doesn't run without root privileges it might be a good idea to think about rewriting the parts needing it


2

On CentOS 6: service xinetd start chkconfig telnet on chkconfig xinetd on On CentOS 7: systemctl start telnet.socket systemctl enable telnet.socket


2

You should be able to use auditd (although it depends on your Linux distribution having it available). The auditctl command is used to configure auditing, and the man page should describe how to achieve what you need. Something like, auditctl -w /home/foo -p war -k foo-watch You can then search the audit log later using, ausearch -k foo-watch An ...


2

Your format string to date is wrong. %I gives the hour in 12 hour format (01..12), you probably want %M, and then your command seems to work (on this linux box - I don't have a synology to try on).


2

You would only use -dm if you want to run a command in a screen session and not enter it interactively -S is just to give the session a usable name so you can reconnect to it again easily later If you want to use it interactively and don't want to give it a human readable name, you can omit all of those arguments safely. For example, if you just want to ...


2

nftables are currently under development to replace iptables, and while they don't say as much, I would consider it "beta" for now. I don't have any insight into their timeline, but you can read more here: http://netfilter.org/projects/nftables/ Many linux distributions already have iptables enabled by default. Either it's compiled in, or they load the ...


2

There are many. I can suggest two for python: codecademy: to learn syntax and get a basic understanding of the langauge newcoder.io: some projects to go further


1

The problem is here: '-15 minutes "$n"' Single quotes stop variable substitution, so you're literally passing "$n" in rather than the contents of the variable. Write: /opt/bin/date --date "-15 minutes $n" '+%Y-%m-%dT%H:%I:%S' instead.


1

This is down to a Linux: When a program starts another, it should use the name of the executable file as command line parameter $0, but it may choose to do otherwise. The Name field of /proc/PID/status is always set to the name of the executable by the kernel (but truncated to 15 characters). The application itself can change a name. You can get the longer ...


1

If you will set /usr/bin/dumpcap setuid without others but members of wireshark group being able to run it, then this setuid setting is safe. Then you just add yourself to wireshark group with usermod -aG wireshark $(whoami) and you're done. To setuid it in this way, do chgrp wireshark /usr/bin/dumpcap; chmod 4710 /usr/bin/dumpcap Btw sudo is not suitable ...


1

What does id say? If you've just now added yourself to the wireshark group, I think you will need to log out and back in again. (Point found by googling the error message).



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