Server :: Inserting Into The Actual File With Sed?
Mar 1, 2010
this is my sed script
#
# insert the line '-A INPUT -i eth0 -j ACCEPT'
# in iptables
#
/-A INPUT -i eth0 -j ACCEPT/a
-A INPUT -i edge0 -j ACCEPT
but when i run sed -f script iptables. it just echo's it to the the screen with my line added and not into the actual file. anyone know what i am doing wrong?
View 4 Replies
ADVERTISEMENT
Jun 15, 2011
I am browsing our repository and I want to get this folder but all of the files there have ",v" in the end of their filenames and if you open each file, they have some written data which are headers for version control before the actual content of the file. I want to extract the actual content to make the file my_file.c,v --> my_file.c. Is there a command to do this?
I am having lock error and permission errors so I cannot checkout manually using CVS.
View 2 Replies
View Related
Jan 27, 2010
I have a large number of folders that each contain quite a few files of varying sizes (from a few bytes to 400kb or so), mostly smaller ones. I need to get the actual (not the disk usage) size of these folders. Is there any way to do this with a command like 'du'?
View 4 Replies
View Related
Apr 11, 2011
I multi-boot several Linux distributions with an assortment of additional data partitions. I get frustrated whenever fsck is forced during boot. (It ONLY happens when I'm in a hurry don't you know...) So I wrote a script to automate forced fscking when I do have the time. (And/or while I'm doing something else in another workspace.
Because I multi-boot, I've learned that udev doesn't always assign the same device name to each drive for all distributions. I've had the same partition identified as hda5, sda5, & sdb5 by different distributions (without doing anything to affect the boot order) So my solution is to keep a list of partitions in a specific file on each distro with valid device names according to that distribution's udev process. Actually I'd use LABEL= instead but the labels don't show up in /etc/mtab, and I like to make sure a partition isn't mounted before I try to fsck it.
I can make this work in a for loop using cat. But I've seen so many things about NOT using cat that I wanted to rebuild my script. I can make this work with a redirect instead of cat via a while loop, But I "LIKE" old style for loops. But I can't seem to find a way to make a redirect work with one. I thought this might make a good first �LinuxQuestions.org� question. I'm also open to any other suggestions on better/alternative methods... Is it possible to redirect from a file into an actual for loop?
My script is as follows:
Code:
#!/bin/bash
# FsckEm I script to force file system checking on unmounted ext2/ext3/ext4
# partitions in preselected list. FsckEm accepts no options. Partition
[code]....
View 5 Replies
View Related
May 12, 2011
I'm confused about "hard link" feature. I've been learning from my UNIX Academy DVDs training that hard links to a file can be many and each of them is an effective filename for the associated data. So let assume that we have some very sensitive data in a file and we want it to be deleted and file has 20 links. I "delete" a file, but in fact I deleted only one "name" of it. My understanding from the training that data is still there until we delete the last associated hard link. But how can I find the names of all of them? If we have the names, they can be removed one by one. Or may be there's command that can trace all the "names" and remove them at once?
View 14 Replies
View Related
Oct 20, 2010
I'm gonna replace my machine's ip address and hostname using awk command. the pattern of the file is like the following...ip address="192.168.1.100"the script must ask the ip address from the user and replace it with the ip address in the quotation.
View 14 Replies
View Related
Jan 9, 2010
I use amarok 2 and I have a lot of files that are titled "Track #.mp3", in Amarok I have changed them to see as the real songs but the actual files are still the same. Is there a way to change the actual file names using amarok to match the tags I have inside of amarok? The reason why I'd want to do this:
1. If my home folder becomes corrupt I don't have to redo 100's of songs (I have a backup but none the less
2. If I ever decide to use another program or if I'm in W7 using Windows Media Player classic it'd be nice to have it recognize the correct files without having to double up on the tag editing
If this isn't possible I'm going to wishlist it because I think it's functional and having a bunch of Track# files is a pain but impossible to get around when you have a lot of mix cd's.
View 2 Replies
View Related
May 22, 2009
I've upgraded my raid array, and to make it boot I had to regenerate the initrd image (the root was on the raid drive)using
mkinitrd <img file> <kernel version>
after that at boot i always receive this error:
error inserting /lib/raid456.ko: -1 file exists
View 1 Replies
View Related
Jun 5, 2011
1)NOT USING MMCONFIG
2)insmod Error inserting `/lib/raid456.ko` -1 File Exist
Dell PowerEdge T110 with 4sata Controllers with Centos2.6.18-238.9.1.el5xen installed .
Code:
/boot on /dev/md0
/ on /dev/md1 Regards
View 7 Replies
View Related
Mar 9, 2011
I am trying to figure out the "actual" disk size used by my system. When I run the "df -h" command,I am not taking here into consideration the shared memory of 2Gb as it is a sort of virtual shared memory and is not allocated physically. Is that correct ?
View 8 Replies
View Related
Apr 18, 2011
Just using shell scripting, how can I insert text into the middle of a file name. The file has a predictable pattern, let's say 3 letters and 3 numbers and I want to insert text in the middle of those 2 patterns. Say ABC123 is the file name. As a result, the file name should be ABC.blah.123
View 2 Replies
View Related
Oct 11, 2010
I recently setup a new Linux server running Fedora 10. For some reason all ping response times are rounded to the nearest 10ms. For example, running the simple command "ping yahoo.com" give the following sample results:
64 bytes from ir1.fp.vip.re1.yahoo.com (69.147.125.65): icmp_seq=12 ttl=57 time=60.0 ms
64 bytes from ir1.fp.vip.re1.yahoo.com (69.147.125.65): icmp_seq=13 ttl=56 time=50.0 ms
64 bytes from ir1.fp.vip.re1.yahoo.com (69.147.125.65): icmp_seq=14 ttl=56 time=40.0 ms
64 bytes from ir1.fp.vip.re1.yahoo.com (69.147.125.65): icmp_seq=15 ttl=56 time=50.0 ms
I could post a larger result set but its all the same... every response is rounded to a multiple of 10ms. This wouldn't be a big deal except that the server is running Nagios for monitoring so accurate stats are important. The Nagios check_ping and check_icmp commands are also returning rounded off results. How can I get ping to simply respond with the actual response times rather than a rounded off number?
View 1 Replies
View Related
Oct 12, 2010
I have to administer a few mail servers, a mail log server, 4 nameservers and a web server -all running on Centos 5 server distributions. Now I have a task: to avoid accidental crashes on the production servers while installing updates, my boss asked me to do clones (these clones will all be VMware virtual machines) of the servers (EXCLUDING the actual e-mails and mail log contents) and then to run those clones on VMWare Server. This way, first I will install and test updates on the clones and - if they will be running without crashes - I will apply the updates on the real production servers themselves. I have already installed VMWare Server 2.0 I have a few questions:
- How do I build the virtual machines to exclude the actual mail files and mail logs? Can I use VMware Converter for this purpose, or do I have to use another program?
- How do I actually do this cloning? Is there a tutorial on how to do this?
View 3 Replies
View Related
Mar 15, 2011
i am pretty much brand new to ubuntu i have messed around with it a little and have gotten my apache2 server up and running what i have some questions on is
1. How can i give my server a actual address and not my ip address?
2. Is there any way i can put like forum software on part of it? if so how?
3. What is the best way to write web pages i know some html so thats how i was able to write what i have now just wondering what best way is
View 1 Replies
View Related
May 4, 2010
I have a query regarding top & virtual memory. When we run top it show VIRT (Virtual Mem), RES (Resident Mem) & SHR (Shared Memory). The total virtual memory of my machine is 4 GBs (2 GB RAM + 2 GB Swap), but still I am able to see a process showing 4000m virtual memory column. what it means, as its show VIRT Mem more than actual available VIRT memory
View 1 Replies
View Related
Jun 10, 2011
I'm running mythdora based on FC12. There is available at the reposities version 1.0.6 of vlc. How can I update vlc to the actual 1.1.10?
Code:
# yum --releasever=14 distro-sync
Could not retrieve mirrorlist http://mythdora.com/mirrorlist/14/release-i386 error was 14
That's okay - mythdora has not the FC14. Where can I change it and point the mirrorlist from mythdora to fedora?
View 5 Replies
View Related
Jul 5, 2011
I have an ISO of a game I own that shows up as 5gb. When I mount the ISO like this:
mount -t iso9660 -loop game.iso /mnt/loop
and go to /mnt/loop and execute
du -hs
it returns 2.5gb. Examination of all the files and directories in /mnt/loop does indeed add up to 2.5gb. So my question is what happened to the rest of it? Does the 5gb ISO contain a bunch of empty space? Should I try to burn it to a DVD and see what happens or should I burn it to a dual layer disc? I don't want to waste a dual layer disc if I don't have to.
View 13 Replies
View Related
May 26, 2011
Is there a git client that doesn't require git to be installed? Every client I've found so far requires the binary "git" to be installed on your system and is simply a wrapper to that. Does anyone know of an actual standalone git client?
View 2 Replies
View Related
Sep 1, 2011
I've been having some problems with my desktop. My windows and my sidebar work fine, it's just nothing updates on my actual desktop(like the wallpaper, files, etc.). For example, if I mouseover one of my files on my desktop, nothing happens. I can right click on it and it comes up with the right menu, but it doesn't select the file or anything. I just changed my wallpaper and nothing happened.
View 2 Replies
View Related
Apr 1, 2010
I'm well aware this is a common issue among Linux users, but have exausted every method I've researched.
On Xubuntu, I have a small set of USB speakers. Now, the system does detect the output. The mute and volume controls on the speakers work properly (I can see the sound bar move on the screen when doing so).
I've tried various applications such as pavucontrol, to try and fix the problem.
When I try playing audio, sound bars are moving in pavucontrol, but alas, no actual audio from the speakers.
View 3 Replies
View Related
Jul 4, 2011
Im trying to find a way in redhat to see if there is a command that could tell me the actual used memory by the system. For example when i do the free command, i want to see the Used minus cached value. Is there a way linux can report the true used memory and not the cached/buffer etc? if there is not specific command for that, can someone tell me a bash script that could calculate used-cached ?
View 5 Replies
View Related
May 17, 2011
Title is self explanatory.
Is there any way i can accomplish this?
View 1 Replies
View Related
Nov 4, 2010
If I try and paste text from the clipboard when using vim, it automatically inserts hash at the start of every line. This is driving me mad! How to I get rid of it? Ive deleted all my .vim files/directories in my home directory.
View 3 Replies
View Related
Mar 21, 2011
Code:
Fedora 14 xfce
I am looking for the log messages where I can find out what time my netbook hibernated?
I have checked in the /var/log. And all I could see was pm-suspend.log and pm-powersave.log.
Is there one which would tell me what time my computer hibernated?
The reason for this is when I go out I leave my netbook running on the battery. When the battery get to about 5% it will hibernate. I just what to see what time it did hibernate?
View 1 Replies
View Related
May 27, 2010
I have the latest RPM's but bank is saying the User Name and Password they issued me is hitting their server, but I get a screen coming back saying it can't find any suitable accounts at my bank to map to. Is 3.98.1-1 just a release candidate or is there an actual bug in the OFX package?
View 1 Replies
View Related
Dec 25, 2010
I am looking for an application that I can select different types of instruments and select notes to play, and then make different instruments play at the same time or specified time in the track, thus composing a complete music. I am not looking for connecting instruments to computer and recording them, but I am looking for something that can compose music without using actual instruments.
View 9 Replies
View Related
Feb 11, 2011
Let's say I have a bash script called log.sh. In this script, I want to read in input from a pipe, but I also want to know the command used to pipe input into me. Example:
tail -f /var/log/httpd/error | log.sh
In the shell script, I want to know the command tail -f /var/log/httpd/error.
View 2 Replies
View Related
Jul 15, 2010
Having just spent many hours going through my entire photo collection tagging, rotating and editing (red eye, cleaning up etc), I am now sat with the window open deciding whether or not it's safe to close it.
I cannot find a save or apply button so I'm not sure if these changes are only made in F-spot itself or if I have to do anything else to make sure it saves to the files.
I DID check the option about storing data in the files where possible but I don't want to just assume it and have to do all this again.
View 5 Replies
View Related
Jul 22, 2010
I recently bought a new pc and installed Ubuntu on it. It came with a 500gb hard drive and during installation I manually partitioned it as follows:
10 gb (ntfs) for a windows partition
15 gb (ext4) mounted on /
4 gb for swap
the rest (470gb - ext4) mounted on /home
I've just installed a few apps from the repository, nothing big (about 500 mb in all), but in the 'file system' tab in 'system monitor' it says that for /home I have a total of only 432 gb, of which just 408 gb are available, with 500mb used. According to this, around 60gb of space have just vanished into thin air. Where did all this missing disk space go? The disk is brand new and there are no bad sectors in it.
View 6 Replies
View Related
Aug 12, 2010
I want to do is change the icon that the deskbar applet shows in the panel. I've read that you can change the icon that is in the text input box (url), but I've had no luck finding any thing to change the actual panel icon.
tl;dr version:
I want to change this icon: url
The icons in /usr/share/deskbar-applet/art/ don't manipulate this icon.
View 9 Replies
View Related