Tag Info

New answers tagged

0

In the vSphere client, hit "Edit Settings" on your virtual machine. Under the "Hardware" tab, select "Video card". You should see the video memory to the right. Mine default to 8MB.


0

You probably want: for i in n5 n25 do if [ ${#i} -eq 2 ]; then python two.py n5 elif [ ${#i} -eq 3 ]; then python three.py n25 fi done Note that: for goes with do ... done. if goes with then ... [elif; then] ... [else; then] ... fi. the integer comparisons need -eq (equal) instead of = (for strings) and are written within ...


0

This $() is used for executing a command mostly inside some other command. chmod 777 $(pwd) pwd command gives the current working directory. So, when the whole thing is executed output of pwd will replace its position and serve as the argument to chmod , and the result is that all your present working directory get the permission 777 which I guess should ...


1

It's very similar to the backticks ``. It's called command substitution (posix specification) and it invokes a subshell. The command in the braces of $() or beween the backticks (``) is executed in a subshell and the output is then placed in the original command. Unlike the backticks, the $(...) form can be nested. So you can use command substitution ...


2

In POSIX or POSIX-like shells (ksh, bash, ash, zsh, yash...), it is like ``: the command inside $() is executed and replaced by its standard output. Word-splitting and filename generation are done unless $() is inside double-quotes. Thus chmod 777 $(pwd) should be replaced with: chmod 777 "$(pwd)" to avoid word-splitting and filename generation on the ...


2

First of all, let me ident your code to make it look in a more structured way(and to be easy to read). adduser openerp DIR="/var/run/openerp /var/log/openerp" for NAME in $DIR do if [ ! -d $NAME ]; then mkdir $NAME chown openerp.openerp $NAME fi done rm -rf openerp* After creating the user, the for loop will expand each ...


0

For what it's worth, I needed to check the level of skew between two linux systems myself yesterday. Before going digging for tools, I used this unscientific method which gave me good enough results for my purposes (comparing timestamps of log outputs from the two systems). Launch a Putty session on each system and align them side-by-side Run the ...


1

You can do this via PAM configuration. For example, if you use XScreenSaver, you'd edit /etc/pam.d/xscreensaver and change the @include common-auth line. Rather than repeat all the details, I'll point you to my answer to Set sudo password differently from login one. The procedure is almost exactly the same, except that you'll be editing the PAM config for ...


2

Try while read column1 column2 do something with $column1 something more $column2 ... done < test.txt Using the read directly from a while & redirected file saves you the cat (completely unnecessary use of ;}) and changing IFS.


2

Can the disk (ATA) be setup so that a failing read doesn't take too long, so that it can be dropped, and the reading process and the disk wouldn't be blocked, and the next read could be attempted? No. My understanding of this is that it's a logical problem resulting from a design choice (not unique to linux) that favours performance and stability for ...


0

According to Henrik Stoerner at http://lists.xymon.com/oldarchive/2006/02/msg00115.html , real is the physical memory, actual is the amount of memory in use not including buffers and cache, all based on the output of the free command.


0

Use logrotate. Normally you rotate every night or every week, but you can change this to whatever you need. The only catch is that it might mean that iptables needs to restart after rotating, which is handled by logrotate. I don't know if that is needed, nor if that (or the frequency) is a problem for you or your application. Logrotate creates a new ...


1

I would suggest reading this article: http://delightlylinux.wordpress.com/2014/04/16/3492/ From what I understand, you may see some performance improvement, but overall the difference isn't hugely noticeable. I can't say I've every really noticed enough of a difference to justify migrating to SSDs, other than for the sake of not using mechanical drives.


0

Just remove them all and then put them back: sed 's/"//g;s/,/,"/3;s/,/",/4'


0

Indeed it looks like corruption. You should check that your drive is not failing. A failing drive could be causing your corruptions. Then fsck your drive and force a reinstall of new packages. If the drive is good, you may have to reinstall the OS if it is too corrupted where you can't install packages.


3

This can be a way: awk 'BEGIN{FS=OFS=","} # set input and output field separator as comma {for (i=5; i<=NF; i++) { # loop from 5th field gsub("\"","", $i); # remove " gsub(/^[ \t]+/,"", $i); # remove leading spaces gsub(/[ \t]+$/,"",$i)} # remove trailing spaces }1' file Removing ...


2

The [[:alnum:]] character class represents alphabetic and numeric characters, you can use [^[:alnum:]] for non alpha numeric so for your goal: my target is to work with all kind of characters non alpha numeric and alpha numeric you can use this expression [[:alnum:]] | [^[:alnum:]] so the awk command will be something like this: awk 'gsub(/("[ ...


0

The advanced bash scripting guide. Example 29.2 linked here: http://www.tldp.org/LDP/abs/html/devref1.html Has the calculations commented...


0

e2label didn't work for me with UDF filesystem labels. blkid did; blkid -s LABEL -o value /dev/sdg1


5

The information that df produces comes from the statvfs() system call. If your embedded system does not have the df command installed, perhaps it has one of the common scripting languages, using which you can write a one-liner to access the same system call? python -c 'import os; print os.statvfs("/")' If it doesn't have anything like that installed ...


2

The word “Linux” has two meanings. The most common meaning, by far, is the Linux operating system, also known as GNU/Linux or GNU/X11/Apache/Linux/TeX/Perl/Python/FreeCiv, which is an imitation of the Unix operating system. The word “Linux” can also mean the Linux kernel, which is the kernel of the Linux operating system. Android is a completely different ...


1

Since I don't rely on the connection or on the service, I use the following code, which tries to get the IP using different services (feel free to add more): # Get my ip address and put in a file declare -a arr=("ipecho.net/plain" "ident.me" "tnx.nl/ip" "ip.appspot.com" "https://shtuff.it/myip/short/") IP=$(curl -s --retry 3 --retry-delay 10 ...


1

Does root have SFTP access? Can you sftp root@remote? If so, you should be able to download the /etc/sshd/sshd_config from the remote to your local machine, fix it, and push the corrected version back.


0

Is this a server you setup, or is it something a hosting provider supplied? If the hosting provider supplied it, do they offer a method of installing Webmin? If not, what exactly did you change in your SSH configuration?


3

It's historical, sort of like the question, "Why is there more than one nation state?". Presumably, at some point a few hundred thousand years ago, there was only one, singular population of homo sapiens, and yet now there are many. The original UNIX was a singular entity that was written in non-portable assembly for the PDP-11 as a AT&T Bell Labs ...


2

This line: -su: 29: /usr/share/bash-completion/bash_completion: [[: not found tells me that /bin/sh isn't a bash shell (on modern Debian, it's almost certainly dash), but it's trying to source a bash script. So, the question you need to answer is why a non-bash shell is trying to source the bash_completion script. I'm guessing that the problem is one of ...


2

Could also ask, why can't there just be one type of car? Wouldn't we all be happy driving a Gremlin? Or maybe an El Camino? There are some historical reasons for some of the deviations between the proprietary flavors in Unix and Linux that would make for some interesting reading (finding all those resources would be out of scope for such an open-ended ...


0

Unfortunately, removing a vdev (which this drive is) from a pool is not supported by ZFS currently. The work around would be to dump your data out of the pool and recreate it, then put the data back.


1

Despite what file says, it turns out to be debugging symbols after all. A thread about this on the LKML led me to try: make INSTALL_MOD_STRIP=1 modules_install And low and behold, a comparison from within the /lib/modules/x.x.x directory; before: > ls -hs kernel/crypto/anubis.ko 112K kernel/crypto/anubis.ko And after: > ls -hs ...


0

After your make oldconfig, do a make vmlinuz. I think you'll find that the pre-compiled kernel is a "executable bzImage", which means it's compressed on-disk. If you watch boot messages closely, you'll see it uncompressing the kernel very early on in the process.


4

The LSB, POSIX, and the Single UNIX Specification all significantly involve userland. Simply using a kernel that is also used as the basis of a "unix-like", "mostly POSIX compliant" operating system -- GNU/Linux -- is not sufficient to make Android such as well. There are, however, some *nix-ish elements, such as the shell, which is a "largely compatible" ...


1

In order for two machines to communicate, they need to know each other's IP address. That's how they know where to send packets. You can't communicate with someone if you don't know where to send their messages. Tunneling allows machines to communicate without knowing each other's IP address by embedding packets inside another communication layer and using ...


1

The names actually match up, but sar and free don't show exactly the same fields. Your first ??? isn't kbcommit, it's shared memory, the same as Shmem from /proc/meminfo. The second row shows the memory usage if the memory used by buffers and cache was treated as free rather than used. $ free total used free shared buffers ...


0

Actually, as your output perhaps demonstrates, sar's kbmemused is probably not the same as the second "Mem:" field from free. From man sar: kbmemused Amount of used memory in kilobytes. This does not take into account memory used by the kernel itself. Presuming that part of what's not taken into account is: ...


0

If you need simple, easy to set up bootloader, then I recommend LILO. It is less capable than GRUB2, but on home desktop PC it doesn't really matter.


0

Is Grand Theft Auto 3: San Andreas's 800x600x32 resolution just for the menu to work? If not you can emulate such a window using Wine and then in the game's menu set your specific resolution. If yes, then you may also try using xrandr's scaling arguments: --scale xxy Changes the dimensions of the output picture. Values superior to 1 will ...


0

egrep -v ^'(#|$)' file.txt Strips all comments and empty lines from file.txt


2

The link /dev/$disk points to the whole of a block device, but, on a partitioned disk without unallocated space, the only part which isn't also represented in /dev/$disk[num] is the first 2kb or so - $disk's partition table. It's just some information written to the raw device in a format that the firmware and/or OS can read. Different systems interpret it ...


1

Since /tmp is a separate filesystem, you want to get an unblemished view of the contents of that filesystem (without the interference from the /dev/sda1 filesystem, which is mounted on the subordinate /tmp/FOO mount point), so you need to do a bind mount on /tmp: mount --bind /tmp /tmp/BAR Now /tmp/BAR should show you the contents of /tmp, and ...


0

dd's direct flag ought to bypass the (host) cache, and force I/O to be sent to the drive: dd if=/dev/sda bs=4096 count=1 of=/dev/null iflag=direct ^^^^^^^^^^^^ Testing on my machine, this definitely makes the disk activity light blink. It doesn't blink (at least the second time) without the iflag.


2

cgroup's are meant to control applications, not filesystems. What you're wanting would need to either be a sysctl or a mount option since it's for an entire filesystem. Unfortunately it doesn't look like either of those two features has been created for this problem. That's probably due to how unique an issue like this is. To work around this, you may try ...


0

Maybe your /etc/network/interfaces syntax is wrong. The parameter is vlan-raw-device(with minus) and not vlan_raw_device(with underscores); # INTERFACE LAN auto eth0 iface eth0 inet static pre-up modprobe 8021q pre-up ifconfig eth0 up post-down ifconfig eth0 down # Vlans auto vlan111 iface vlan111 inet static address 10.0.111.1 ...


1

First of all, is the host machine network interface is connected to the trunked port ? you can test this simple with the command vconfig to create the vlan interface on the fly, # vconfig add [interface-name] [vlan-id] # ( you will need 8021q module loaded ) # -e.g. vconfig add em1 100 ip addr show ... 12: em1.100@em1: ...


0

To formalise and expand on what someone said in a comment, when you put something in root's crontab it will run inside /root, not in the directory the script is in, because cron doesn't even know where that is. Because your backup files aren't in that directory tree, the find command never reaches them. So the job is running, it just never finds any files to ...


3

If all goes well, your kernel should decide to "do the right thing" all by itself. It uses a lot of fancy heuristics to decide what to swap out and what to keep when there is memory pressure. Those heuristics have been carefully built by really smart people with a lot of experience in memory management and are already good enough that they're pretty hard to ...


1

You can try this in terminal: sudo lscpu This will give you an overview of your cpu physical trait. As for turbo boost or not, this is purely hardware control than the OS itself, so unless Intel has a specific drivers for Linux that can tune your processor speed, there's no solid lead to check the turbo boost state (unless there's a command code for it. ...


1

As I understand it, you want to see the files, if any, hidden by the mount /dev/sda1 /tmp/somefolder command. Assuming that /tmp is part of the / filesystem, run: mount --bind / /tmp/anotherfolder ls /tmp/anotherfolder/tmp/somefolder If /tmp is not part of / but is a separate filesystem, run: mount --bind /tmp /tmp/anotherfolder ls ...


0

Although you don't have nosuid on your mount, it seems like your NFS client is defaulting to nosuid. You can change this by explicitly setting the suid flag. To do this live as root: mount -o remount,suid / If that works you can add it to your boot options. See also this Ask Ubuntu question which is pretty much the same problem you're having.


0

Too late to answer but I think these two points are very important Check the permission of your home directory in the server as well. I faced a similar problem and the problem was home directory permission. So two things Your authorized_keys should be 600 Your home directory should be 755 sshd by default logs some messages into /var/log/secure at least ...


0

Check the permissions of the sudo executable. If you copied the files to another location, it may be possible that you lost the SUID bit on the file. $ which sudo /usr/bin/sudo $ ls -la /usr/bin/sudo ---s--x--x 2 root root 208808 Jun 3 2011 /usr/bin/sudo



Top 50 recent answers are included