Tag Info

New answers tagged

1

Do they maybe just mean that if you use -i any that tcpdump won't put the interfaces into PROMISC mode? Yes, that's what I meant by that. The "any" device doesn't work by opening all devices independently and capturing on them, it works by opening a "packet socket" and, instead of binding it to a particular device (which is how you capture on that ...


0

I have a variable to which a path of a file is assigned by a command, for example VAR=grep /adr filename - assume my filename has a line like /adr/samp.txt So when I echo $VAR, it gives me the /adr/samp.txt, but gives an error for cat $VAR or with grep I resolved this by making VAR=$(grep /adr filename). Then I can do cat $VAR. I dont know whats ...


0

ls -Al | tr -s ' ' | cut -f9- -d' ' compress multiple spaces into single spaces with tr then you can use cut to split on the fields


0

Try this way: sed -i -r 's/(.*HostName.*)/\1\n<attribute name="Port">1414<\/attribute>/g' filename Result in: $ cat filename <server> <mbean code="WSMQConnectionFactory" name="service=MQQueueConnectionFactory"> <attribute name="JndiName">WSMQQueueConnectionFactory</attribute> <attribute ...


0

I know you asked for grep, but if I understand correctly you want to search the path string for a substring. You can just use == or =~ for that, as in [[ "$VAR" == *"HI"* ]] # Does "$VAR" match <stuff>HI<stuff>? or [[ "$VAR" =~ "HI" ]] # Does "$VAR" contain HI?


0

Try: find . -type f -print0 | while IFS= read -r -d '' filename; do ... done This goes recursive and lists only on normal files (i.e. no dirs or symlinks). See: Why you shouldn't parse the output of ls(1) at wooledge wiki Why not parse ls? at unix SE


0

Known vulnerabilities are not the biggest indication about how secure a system is. Due to the open source nature of the Linux Kernel, most vulnerabilities are actually discovered when developers or testers are reviewing the source code. Also, most patches are released quite fast in my experience, whilst most Windows updates are released on Patch Tuesday. ...


0

FreeRDP (xfreerdp, whose Debian package name is freerdp-x11) is considerably less used than rdesktop according to the Debian Popularity Contest stats, in part because it is so much newer: #rank name inst vote old recent no-files (maintainer) 1429 rdesktop 56497 4281 41399 10775 42 (Laszlo Boszormenyi) 3056 freerdp-x11 14232 ...


1

Try this: # Set mount directory for partition-less sticks SUBSYSTEM=="block", ACTION=="add", ENV{myBusID}!="", ENV{myDevID}!="", ENV{myPartition}=="", ENV{ID_PART_TABLE_TYPE}=="", ENV{dir_name}="usb-%k-%E{myBusID}-%E{myDevID}--%E{myPartition}"


-1

Try this sequence mkdir ./backup mv ./show_user_groups.sh ./backup/ As mentioned above, you did simply just renamed and moved the file to root directory. To recover: mv /backup /path/to/backup_dir/myfile.tar.gz


2

You created a directory called backupunder the directory where you were at that moment. However you moved the file myfile.tar.gz to /backup. The / means that you moved the file to a new file called backup under directory /. The only thing you did was rename myfile.tar.gz to backup and put it under /.


1

While the Stack Overflow question seemed to be enough at first, I understand, from your comments, why you may still have a doubt about this. To me, this is exactly the kind of critical situation involved when the two UNIX subsystems (processes and files) communicate. As you may know, UNIX systems are usually divided into two subsystems: the file subsystem, ...


1

The command line tool top will show you a list of processes and their cumulative cpu consumption. You can change the sort column with < and >. read man top for more options. Some things that run intermittently from cron (like apt-get update) won't show in top while they are not running.


2

Before there was such a thing as an initrd, you had to pass the device name of the partition you wanted to use as your root fs on the kernel command line. The kernel had special one off code to parse this name and recognize a handful of common strings, and translate them to their well known dev_t number. That is to say, that internally the kernel knows ...


1

This is not always the case when replacing a .jar file. Jar resources and some runtime reflection class loaders are not read from disk until the program explicitly requests the information. This is only an issue because a jar is simply an archive rather than a single executable that gets mapped into memory. This is slightly off-stopic but is still an ...


2

Your permissions are too lax. chmod u=rwx,go= .ssh # 0700 chmod u=rw,go= .ssh/* # 0600 I'm going to assume that the user/group you have specified are the correct values for whatever uses /home/web as its home directory. To diagnose this kind of error it's best to look at the daemon/auth logs on the server. See the tag ssh here for more details.


2

My understanding is that due to memory mapping of a running process, the kernel would not allow updating a reserved portion of the mapped file. I guess in case a process is running then all of its file is reserved hence updating it because you compiled a new version of your source actually results in creating a new set of inodes. In short, the older ...


3

Why not only use what's on the disk ? You can. You do not have to use an initrd (or an initramfs, the newer and more widespread version since kernel 2.6.13). The reason that they are used is that distro kernels are generic and must support a wide range of hardware out of the box. Some of the drivers for different hardware, crucial to mounting a root ...


1

chaos perfectly summarized it. I'd just add that an initial ramdisk (or initrd) is optional. There are certain circumstances it is required, for instance when /usr lies on a separate filesystem, which used to be advertised as a good practice. Also, systemd, which is found on many Linux distributions, requires /usr to be available at boot. Otherwise you have ...


10

You could also handle this with bash parameter expansion: s=swp-RedHat-Linux-OS-5.5.0.0-03 echo ${s%-*} ${s##*-} Output: swp-RedHat-Linux-OS-5.5.0.0 03


1

The task of the initrd is to make the real root device available and switch into it. The real root device can be (for example) a partition on a hard drive, a nfs share in the network, a filesystem at an USB-stick, a pseudo-filesystem or something else. Nearly every initrd has a routine called mountroot. That's the function that searches for the correct root ...


0

It seems there is another distribution based on RHEL called Springdale and it has both 64-bit and 32-bit versions: http://springdale.math.ias.edu/ Take it with a grain of salt though, I haven't tried it and I don't know what are the differences between this and CentOS (if there are any).


17

You can do it with single command with sed 's/\(.*\)-/\1 /' The point is that sed is very greedy, so matches as many characters before - as possible, including other -. $ echo 'swp-RedHat-Linux-OS-5.5.0.0-03' | sed 's/\(.*\)-/\1 /' swp-RedHat-Linux-OS-5.5.0.0 03


8

Something like this worked for me, although I'm sure there are better ways echo "swp-RedHat-Linux-OS-5.5.0.0-03" | rev | sed 's/-/ /' | rev swp-RedHat-Linux-OS-5.5.0.0 03


2

Any application can be allowed a set of root capabilities using setcap. Opening port below 1024 if one of them. You can run the application as a non-root user, and if the capabilities you need are set, there will no problem. Read about the possible capabilities: http://linux.die.net/man/7/capabilities. For example, running apache-tomcat as non-root: ...


0

I can think of two truly keyless and passwordless ways you can do this, though both are suboptimal. After the section break, I'll show you just how easy this is to do with SSH keys. Method 1: NFS or something like it. A common filesystem would let you dump files in dedicated areas and then pick them up in cron jobs from the relevant systems. This is, ...


2

Setting the hostname in linux is done via the sethostname(2) syscall. And /bin/hostname is a bare wrapper around this syscall (and a few related syscalls). /etc/hostname is supposed to be read during the boot process by some script, who subsequently runs /bin/hostname to complish its job. CAP_SYS_ADMIN is one of linux capabilities(7), allows a thread to ...


0

This one liner seems to do the trick for me (requires root privileges): dmidecode -t processor | grep -E '(Core Count|Thread Count)' The output is: Core Count: 2 Thread Count: 4 Thread count is double the core count, therefore I have hyperthreading enabled. Or if you really want your perl script, as requested... perl -e 'print grep(/Core Count/ || ...


1

Typically, for finding the processes sharing the library, you can use the command lsof shared_library_path. It will list out all the processes. Source : Here A Similar question was asked before here.


1

I've finally found a way to fix the issue I had. I found this article about iptables. It helped me a lot to fix the issue. The only thing I did is run the command sudo iptables -F Doing that has allowed me to push again on remote repositories and thus using ssh. But I had to save that. For this I run this other command to make all the changements due ...


0

There is a possibility that there was an error setting up the OS (especially if you did not use an ISO file provided by the official Linux Mint website). You could try using the startx command if you installed a minimalistic version of the Linux Mint kernel environment. Your best bet is to run which startx to see if there is a startx command, and if there ...


2

Apache is an example of a daemon that supports dropping privileges. Apache is started as root, and it binds to the ports as root. After it has binded, it uses the setuid and setgid system call to drop to lesser privileges. The user that it changes to is determined by it's "User" and "Group" configuration options.


0

It's as dangerous as @wraeth points out in his answer and his proposal would be the best approach, but you can also use expect. It allows you to script answers to interactive scripts and is quite useful for this kind of situation if you account for the security concerns. Also, if you have superuser password you could add yourself to the sudoers file and ...


0

If you know root password ssh-keygen ssh-copy-id root@localhost accept default for ssh-keygen, do not enter passwd. replace root with proper user if need be. then replace su with ssh root@localhost in your script.


2

Firstly, I will point out that having a superuser password into a file (especially a user-owned script) is a very bad idea, as it allows anyone who gains access to that user the ability to easily gain root privileges. That being said, you could instead use sudo within the script, which provides an option to read the password from a pipe. pass='1234abc' for ...


1

First restart the pc, press SHIFT key while Ubuntu is booting. This will bring you up the boot menu. Go to Advanced Options. Select your OS version in (recovery mode), and press Enter Key. example : Ubuntu 14.04 (recovery mode) It will bring you up another screen. Now select “Drop to root shell prompt” and press Enter. It will load a command line at ...


2

As I remember, in VirtualBox you have at least two options for the virtual network interface: NAT Bridged If the subnet of the host is 192.168.0.XXX, and the virtual is 192.168.1.XXX ( or simply, different subnet) then the virtual card must be using NAT. If you want to use Bridge then the subnet of the host must be the same of the virtual. When do ...


0

I've a weird bug like that is quite specific to WD caviar blacks: see here for Kernel bug report: https://bugzilla.kernel.org/show_bug.cgi?id=91921 I need to git bisect it when I have the time as it seems to be caused by some commit in kernel 3.13. It worked in Kernel 3.12 and below. Try this: echo 0 > /sys/power/pm_async Then try s2ram


2

Install jmtpfs (aptitude install jmtpfs) which allows to mount MTP devices. Create the directory if it doesn't exist already (mkdir /tmp/myphone). Then, the following will mount your phone: jmtpfs /tmp/myphone jmtpfs will use the first available device. If you've got more than one connected at a time, you can do jmtpfs -l to find out which one is your ...


0

AFAIK, this looks good. The default one I use is a little different. It comes from the Linux Device Drivers book # To build modules outside of the kernel tree, we run "make" # in the kernel source tree; the Makefile these then includes this # Makefile once again. # This conditional selects whether we are being included from the # kernel Makefile or not. ...


1

Your cron seems not to know or use the &> shortings from bash. When you write the redirection like this /home/archiver/archiver.sh >/home/archiver/output 2>&1 it should work.I would prefer >>/home/archiver/output 2>&1 to always append to the logfile, too.


4

You CPU is slow. A score of 760 for a dual core CPU is bad. If you take a look at the single-core performance for that CPU on the site it's on par with a good Pentium III. The GPU should be good enough for YouTube but together with the CPU it could be not enough. I can watch 760p YouTube in HTML5 on a Pentium M with a much slower AMD GPU. Be sure to have ...


0

Solution found,TTYS0 is a driver/module wich point to an existing physical serial(enable on my motherboard). To use a setup like this,must use the pty driver(pts/0,1,2,etc) but is not supported by virtualbox,qemu support it,if intersted here is the procedure. On Qemu host #run qemu,256m ram disk not over 512M,pc-bios important otherwise give error #control ...


2

There is an answer in Kernel documentation: 3.1.2 usbmouse ~~~~~~~~~~~~~~ For embedded systems, for mice with broken HID descriptors and just any other use when the big usbhid wouldn't be a good choice, there is the usbmouse driver. It handles USB mice only. It uses a simpler HIDBP protocol. This also means the mice must support this simpler protocol. Not ...


0

It depends from how you are managing your services. With a daemontools-family service manager, just that. Your current run program will in essence boil down to#!/bin/nosh chdir / setuidgid mongodb mongod This is in fact the very basic MongoDB run program that comes in the regular services bundle of my nosh suite, which doesn't use a shell as a script ...


0

Finally I made it work using this line: xrandr --output HDMI1 --off xrandr --output HDMI1 --auto --scale-from 1366x768 Note that --auto is needed, though I don't know why.


0

A reliable way to test if postfix is running: if /var/packages/MailServer/target/sbin/postfix status; then echo "postfix is running!" else echo "postfix is not running!" fi An alternative that essentially does the same: if /var/packages/MailServer/target/libexec/master -t 2>/dev/null; then echo "postfix is not running!" else echo "postfix is ...


0

I have figured out how to speed up Samba. Alone Samba is actually more tuned then I have realized. I stopped trying to tune the software itself and stepped backed and looked at my hardware. I noticed my Samba server was only running a 10/100 Ethernet port. I bought and installed a 10/100/1000 along with the 10/100/1000 router and all Cat 6 cables. Now my ...


1

There seems to be a custom installer created for Debian by someone else which will do everything for you automatically? https://github.com/rickard2/grsecurity-Debian-Installer Else isn't it just a case of doing things the old way? Namely, patching things from source? You seem to be asking for instructions on how to patch your kernel for which there are ...


0

You want to use zypper addlock <packagename> Add a package lock. Specify packages to lock by exact name or by a glob pattern using '*' and '?' wildcard characters.



Top 50 recent answers are included