Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

1

The string -- is special for most utilities. It signals the end of options to the command line argument parser. It is used in situations where you may want to pass a filename that starts with a dash, as in rm -- -f (to delete a file called -f in the current directory). To use -- as a pattern with grep, tell the utility explicitly that it is a pattern: ...


0

The best way to learn Linux is to actually use it. Start with something simple (I'd recommend Ubuntu, or better yet Debian, over Fedora, but all three are good for beginners). Once you've got the hang of using it from a graphical interface, start trying to shift as much as you can to using it from the command line (that's going to be 95% of what you're ...


1

You haven't told us which OS you are using. But since you've already mentioned apt-get then I'll assume that you're using something similar to Ubuntu or Debian. These have a relatively similar configuration setup. Check 1 The package php-mysql should be dependent on php7.2-mysql or similar so firstly check that this is installed eg: dpkg --list | grep '...


0

Sure you can, boot from a live disk or USB drive and make sure to install you new system on the targeted disk. It's a good idea to make a backup of your important data just in case.


0

Since the system runs OK with a Live USB, please reinstall the OS on a replacement drive (SSD or HDD).


0

It is because Burp Suite is Http and Https proxy means it can only capture Http and https traffic but some apps use other protocols for data transfer as well. Therefore you will be able to see the only http and https traffic like Whatsapp do. For more info.


0

Seems like your php installation lacks mysql module. You can check if its installed with php -i in your shell. If you don't, try to install it. For Ubuntu: apt install php-mysql For CentOS: yum install php-mysql


0

From a Debian machine like CentoOS, if you check at cat /usr/include/bits/typesizes.h | grep U32 shows that the number is 2*32 which is around: 4294967296 users who can be added to the system cat /proc/sys/kernel/pty/max shows 4096 as the totals number of simultaneous number of logged in users


2

If you remote server has a DNS Server configured (check in /etc/resolv.conf) the SSH Server will try to do a reverse DNS lookup of the client's IP address. If it's not resolvable, it will wait for a 30s timeout to give you access. So it may be not hanging. Also check if you can ssh from within the server (through the 127.0.0.1 local IP) to check if it ...


0

i just had to deal with this. the problem was related to following an exim4 fail2ban tutorial. the jail.d/exim4.conf file had this: [exim-spam] port = smtp,ssmtp where what is actually needed, because exim4 is running on ports 25, 464 and 587, was this: [exim-spam] port = smtp,ssmtp,587 that's all it is. basically, all the filters are correctly set up,...


1

This question is already answered on superuser.com by sysadmin1138: The filesystem itself, represented by the physical order of information on a storage-representation, is independent of the OS. The OS contains a driver that allows it to work with the filesystem. Some filesystems may only have one OS that can talk to it, and that OS has that filesystem ...


0

The problem I was having was the format of the numbers in the files I.txt and J.txt. The needed to be integers (520 in stead of 5.2000000e+02) Once I changed that (by using dlmwrite('myFile.txt', myMatrix); in matlab) my code looks like this and works: outputNumber="$(wc -l Time122009.txt)" #"$(ls -lq *_??????.nc | wc -l)" echo "the number of lines in the ...


0

After reading the 1st half, I wondered were you connecting from outside. Is the server on a private network (e.g. 192.168.x.x), is there a NATing router involved. May be the router is changing the address. My router does not do this on ingress ports. It only re-writes the source address. So changing router may help.


3

If it was installed manually, there's no problem in removing it manually. For the future, it is a good idea to put manually-installed (i.e. not managed by the package manager) binaries in a subdir of /opt; for small programs you can even create a /opt/bin and put them there. This to avoid confusion.


0

Alternatively, I can command it to remove everything before uppercase for every second line. In this way, anything before the dashes and the dashes itself can be removed accordingly. sed -i '0~2s/[^A-Z]*//' file


2

There are various command-line tools to make dbus calls; systemd comes with one called busctl. So you can call StartTransientUnit from the command line. The command The syntax is positively annoying, but it looks like this (for one process id, 14460): busctl call --user org.freedesktop.systemd1 /org/freedesktop/systemd1 \ org.freedesktop.systemd1....


0

I wrote this code, it works for my purpose: find . -type f -exec grep -Iq . {} \; -exec sed -i 's|/foo|/bar|g' {} +


1

I believe their concern is the speed of accessing inter-socket memory. They recommended that if I insisted on keeping the DL560s, I should leave two of the sockets empty. this would have to do with the number of QPI or UPI links and the Intel Scalability (because you mentioned Xeon) between n CPU's whether it is 4S, S4S, S8S. But the fact that there is 4 ...


0

specify the telnet port with telnet 10.49.46.2 24. As per a Cognex camera manual, "supplying the port number disables the Unix username/password authentication and forces the Unix system to prompt you for a user name and password."


0

I do not think there is ever supposed to be a difference, between "low - min" and "high - low". Maybe this was a hardware fault? But I worked out why the distance between watermarks does not match the 0.1% number. On "small systems", the distance between the watermarks is one quarter of the (un-boosted) "min" watermark. I.e. that value is used if it is ...


3

You seem to be confusing the ideas or reading a file and executing a command. The difference between data and instruction. Googles front page is not an executable program. And if it was, it would not be safe to run it. The redirection characters (including < and >), are used to direct data into a command. We could do cat < /dev/tcp/towel....


0

When some one has physical access to your computer, they don't need a password. They can just read the disk. They can compromise the machine: e.g. copy encrypted disk, and install a bot to capture your password, and send it to them. They can use this to decrypt the disk. However it is best to disable recovery mode, and add a firmware-boot (BIOS) password. ...


0

You could use encrypted disks which would require entering a decryption password for any access. For example see https://www.maketecheasier.com/encrypt-hard-disk-in-ubuntu/ Apart from this you cannot prevent someone with physical access to your computer to read or modify data on your hard disk. If you disable the recovery mode, it is still possible to boot ...


27

Because that's a feature of the shell (of ksh, copied by bash), and the shell only. /dev/tcp/... are not real files, the shell intercepts the attempts to redirect to a /dev/tcp/... file and then does a socket(...);connect(...) (makes a TCP connection) instead of a open("/dev/tcp/..."...) (opening that file) in that case. Note that it has to be spelled like ...


0

xfstests appears to claim that fsync() on a directory should persist any symlinks it contains. I have not verified this. It is possible I have missed something. xfstests is used by many developers of Linux filesystems. This test is in the "generic" directory. It implies it should apply to all Linux filesystems. (Or at least, all block device ...


2

Try this, sed '4i\ <remote_connection_protocol>sftp</remote_connection_protocol>\n <ftp_destination_ip>0.0.0.0</ftp_destination_ip>' file.xml 4i to add the content at the 4th line of the file. \n for a newline. if it works, add -i option for inline edit.


2

As explained in the grep manual, -P enables the use of PCREs, i.e. Perl Compatible Regular Expressions. The PCRE expression G\t matches a G followed by a tab. The effect is that you only get a listing of directories whose size is listed in gigabytes (or whose name happens to match the pattern). An alternative pipeline that would more reliable match the G ...


1

-P enables Perl-compatible regex engine, which isn't the default one. In your example it is required to make \t treated as a tab symbol. Otherwise grep will consider it as a plain t (escaped with \). PS. You could easily figure this out based on man page: OPTIONS <..> Matcher Selection <..> -P, --perl-regexp Interpret the ...


0

Had this error message because of proxmox added a record on loopback ip for my container hostname in /etc/hosts like that: # --- BEGIN PVE --- 127.0.1.1 pgmaster # --- END PVE --- I have one more record in hosts for this name. Commented out loopback record and it is ok now.


1

I encountered exactly this problem. The solution I found (by reading the watchdog docs at http://www.sat.dundee.ac.uk/psc/watchdog/Linux-Watchdog.html) was to edit the name of the kernel module (iTCO_wdt) into /etc/default/watchdog. So change the line: watchdog_module="none" to watchdog_module="iTCO_wdt" Didn't need to change any of the blacklisting ...


1

The current directory is stored in the variable $PWD. You could store that value somewhere at the beginning of the script to e.g. output it or save it in a log.


2

I suggest to create a file, e.g. replace.txt that contains the replacements, old value in column 1, new value in column 2, like this 1 9 2 8 3 6 4 7 5 4 6 10 7 5 82 92 83 91 84 94 85 93 86 97 87 95 88 96 Assuming your data file is data.txt, you can use this AWK script: awk 'NR==FNR { t[$1]=$2; next;} # fill translation table from first file { for(i=1;i<...


0

Looks like the kernel has paniced (crashed), apparently when trying to get statistics from the tg3 Broadcom NIC driver. You'll need to reset the system to let it reboot again. You probably should update the system, or at least the kernel, to CentOS 6.[latest] and see if the crash happens again. If you have any third-party driver packages, you should update ...


1

Try with the USBDEVFS_RESET ioctl. If your system doesn't come with a usbreset utility as part of usbutils, you can compile the one from https://github.com/gregkh/usbutils/blob/master/usbreset.c with just cc usbreset.c -o usbreset. On some devices (like my router) you'll have to reset the hub it's connected to instead of the device for it to have effect. #...


4

This may be because your shell uses readline and in your ~/.inputrc (or global /etc/inputrc) you have set horizontal-scroll-mode On From man readline: horizontal-scroll-mode (Off) When set to On, makes readline use a single line for display, scrolling the input horizontally on a single screen line when it becomes longer than the screen width ...


0

You could easily bypass that by going to file manager and right clicking on your file and clicking compress and then make it whatever filetype you want.


0

Pack up a file by filename with the output as filename.tgz tar czf filename.tgz filename Pack up one or more from a list of file(s) tar czf files.tar.gz --files-from ./filelist Same thing but by different method ls -1b . >./filelist && tar czf ./files.tar.gz --files-from ./filelist Add (update tarball) with additional file(s) tar czuf ./...


0

Something like this: cat file | perl -ne '/(Transmit.\d+ Invite Members )(.*)/ and $a{$1}.=$2; END { print map { $_,$a{$_},"\n" } sort keys %a }'


0

On systems using huge pages, it is recommended that min_free_kbytes is higher and it is tuned with hugeadm --set-recommended-min_free_kbytes. With the introduction of transparent huge page support, this recommended value is also applied [...] On X86-64 with 4G of memory, min_free_kbytes becomes 67584. https://www.spinics.net/lists/linux-mm/...


0

The quick and dirty workaround is to comment out this line in /etc/rsyslog.conf: # Everybody gets emergency messages #*.emerg :omusrmsg:* At least it worked for my CentOS 7 box. To preserve these messages and make them easy to find, you could write them to a specific file. Something like this: *.emerg /var/log/EMERG ...


0

On Mac it's Ctrl+T. Ctrl+\ does the same as Ctrl+C, as it stops the ping after showing the stats.


0

My first thought was sed Given your file, fileA.txt above: abcd\ndfghc\n091873\nhhjj and running sed against newline.sed which contains: s/\\n/\ /g thusly sed -f ./newline.sed <./fileA.txt >./trans_fileA will return these results in trans_fileA: abcd dfghc 091873 hhjj This was the simplest way I could figure to accomplish your task. HTH


2

Using the bash shell: while IFS= read -r line; do name=${line%%::*} contents=${line#*::} echo -e "$contents" >"$name" done <fileA.txt This reads the input file line by line and extracts the output filename and the contents form the read line using standard parameter substitutions. ${variable%%pattern} removes the longest matching ...


0

pid_t child_pid; int i; if ((child_pid = fork()) == 0 ){ // in this block you have new process. for (i=0;i<=20;i+=2) printf("even number is: %d\n",i); } You can get a key at end of above program and use ps command to see two process.


0

create_ap use 192.168.12.1 as default gateway. check it: ip route or routel The -g option can be used to set a custom getaway: sudo create_ap -n WifiInterface factory-tester -g GATWAY_HERE create_ap IPv4 Gateway for the Access Point (default: 192.168.12.1)" To get the IPs of the connected devices: less /tmp/create_ap.WifiInterface.conf.*/dnsmasq....


0

AFAIK, if there's no error in the log, i'd check the iptables/firewall configuration for «I mean the browser starts "thinking" for about 30 seconds» seems to me standard timeout for "no answer".


0

backslash inside a double quoted string in perl is interpreted by the perl, so the command that is being run is sed -i 's/[-.*-]//g' error.txt and this will remove minus, dot and asterisk characters. The fact that you list minus a second time doesn't worry sed. perl has a number of quoting tools, in particular you can use the q operator so system(q(sed ...


0

Since you use double quotes for the string in perl, the \ in the string gets interpreted by perl. Use a double backslash, i.e. system("sed -i 's/\\[-.*-]//g' error.txt"); Or use [[] instead of \[, i.e. system("sed -i 's/[[]-.*-]//g' error.txt"); This variant will work in the shell as well.


0

As far as I can see, a single udhcpd will only serve one network interface at a time, so you'll need to run a second copy of it with a separate configuration file whenever you want it to serve DHCP on eth0 too. That might be called /etc/udhcpd-eth0.conf. You might also need two copies of /etc/network/interfaces at a separate location, one with the "DHCP ...


-1

Welcome to U&L. This might be of help: Why does my Python background process end when SSH session is terminated? BTW: starting a process in the shell and counting on it to stay available is not the recommended way to go. Have you considered writing a custom systemd service unit file to accomodate background service behaviour? A quick search gives for ...


Top 50 recent answers are included