Programming :: How To Optimize The Shell Script
Jan 30, 2011
Go through the following script
Code:
#!/bin/bash
ascii=
index=0
for(( i=65; i<=90; i++ ))
[code]....
This code creates a file in which it writes a huge amount or records. But it takes a huge amount of time. Is there anyway of optimizing it?
View 5 Replies
ADVERTISEMENT
Sep 4, 2010
I have to compute prime numbers with threads in C. So I choose the algorithm "Sieve of Eratosthenes" and I tried to create 2 threads, but I don't know how to optimize my computing function with threads I beg for help. This is my function:
[Code]...
but it seems like the both of the threads are calculating the same function twice? Is it possible to be optimized or not?
View 7 Replies
View Related
Jun 5, 2011
I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.
Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....
View 10 Replies
View Related
Jun 25, 2010
Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?
Example:
Code:
>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...
I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.
View 4 Replies
View Related
Dec 15, 2009
I've created a simple script based menu. This menu will be accessed by only a certain users via ssh.When user logs in, the menu will automatically run. (configured at user's .bash_profile).How do I force the session to close when user hits Ctrl-C or Ctrl-Break ?In a nutshell, I don't want user to have access to shell.
View 11 Replies
View Related
Jan 21, 2011
I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.
Do i have to use sed command?
View 4 Replies
View Related
May 17, 2010
Is it possible to assist in the programming Shell Scripts
Job:
To send a message to the email,All orders written in Terminal or ssh
example : ls , pwd , cat , and other
View 1 Replies
View Related
Jun 25, 2011
i didn't know where to post this so i decided on "General" section. I'm working with kind of an "old" computer, low HDD and graphics, but decent amount of RAM and good processor ( for an old computer, and it was bough for company use ) So i want to speed things up a bit, i don't mind waiting a bit longer when GIMP is loading, but FireFox is giving me issues, loads slower, and internet isn't as fast as its suppose to be, i started playing a game on facebook recently and it was fine, but lately it takes for ever to load and do things in it, i tweaked some options in it, and its better, but now when i click response time is slower ( altogether is quicker but still not enough )
Is there anything i can do?
View 4 Replies
View Related
Jun 14, 2010
I have the most recent version of Ubuntu, and I'd like to optimize it. I have 888MB RAM and an older celeron processor. Here are the only things I use on a daily basis:
Firefox
Rdesktop
Apache2 / PHP5 / Mysql
OpenOffice
Pidgin (IRC chat client)
I feel like there is a lot of extra stuff I could remove, but I don't want to just start removing random things that may break dependencies, etc. I want to do this b/c it seems like my desktop is sluggish most of the time.
View 7 Replies
View Related
Oct 19, 2010
I snagged the 10.10 alternate install ISO for PPC and got it up and running on a 1ghz G4 eMac with 1gb of RAM and a 60gb HDD. It runs... OK. It could be a lot better. I'm planning to shut off the bluetooth and CUPS services since neither apply to this system; are there any other services I can shut down, or any other tricks I could do to make it run a bit more smoothly?
What about alternate window managers? I realise that the PPC platform kinda limits me, but what about TWM or FVWM?
View 8 Replies
View Related
May 3, 2011
Unfortunately my ubuntu installation wakes 31 seconds to get to the boot screen, almost identical to my windows 7 partition. I've already configured grub to my needs, so reducing the counter has already been done, but I have no idea what else to do for my boot speeds when it comes to ubuntu. If anything I can live with these times, but it would be very nice to have it boot at lightning speeds I may even buy a SSD when I get the money.
View 2 Replies
View Related
Sep 12, 2010
Howto optimize RAM and CPU usage under Lenny?
View 11 Replies
View Related
Jan 4, 2011
I have installed a linux server, centos gui server with Raid1, his role will be only a file server. I installed samba and configured it. The file system is EXT3. the server got 4 gigs of memory.There is a program in windows that writes files to the share.I searched and i found that there is some commands that you add and they boost the performance.
I got complains that the writes are not fast enough. Before me another IT guy configured the file server and it was faster, what he told my customer that he changed some command of cache but i dont know exactly what he did. I have been asked to find how to boost the performance.Please give me more commands to try to boost the performance of Samba or tell me if i need to change anything..
View 2 Replies
View Related
Mar 28, 2010
I saw many people were talking about how to optimize apache and mysql here and also in other forums and blogs. I am currently hosting some sites and some IRCD processes (a tiny network)in a dedicated server with spec:
Quote:
Intel Dual Core 1.6GHz E1200
1GB RAM
160 HDD
10Mbits port
We got about 30,000 to 40,000 page views per day. I would like to ask people here about the opinion of apache and mysql optimization based on this server spec and current number of page view.
View 4 Replies
View Related
Feb 4, 2011
I have a situation where I am in a non-interactive shell. I have tried from within my non-interative shell to spawn an interactive shell but my output still does not goto me. Isn't there a way I can somehow go into /proc or somwhere and make the output my /dev/tty1? Or some way else to remedy this?The situation arises because I drop from my restricted shell environment (a sort of CLI interface), into the actual Linux shell. I cannot change the code of the CLI environment I am just faced with being in the linux shell environment and its non-interactive. Its very annoying to have to put > /dev/tty1 after every command I type.
Not to mention it seems damn near impossible to get pagers like more and less to work properly when your in a non-interactive shell.
View 2 Replies
View Related
Jan 30, 2011
I am using ubuntu desktop edition to run My drupal website on Intranet. I know for running web servers best thing to install is ubuntu server editions, but due to some problem i am using Desktop edition.I installed XAMPP on my machine an my website is up and running. I want to know how can i optimize my machine?? Since I will not use very less features of desktop editions are there any things which I can remove or stop which will free memory and cpu consumption, are there any packages which i should install to increase the performance of my ubuntu??
View 3 Replies
View Related
Jan 12, 2010
i'm stuck with software rasterizing atm on 9.10, on 8.04 i had indirect rendering which was faster. how i can speed things up? :)
this is my current xorg.conf.
Code:
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
[Code]....
View 9 Replies
View Related
Jul 6, 2010
I am finally coming around to selling my iMac G3s and eMac. I will reformat the drives in them and put on Puppy Linux for the iMacs and Xubuntu on the eMac. If I can, I will repair OS X on them all and will dual boot if possible. All of this will be done using the Intel iMac via Firewire. I would like to know if there is a way to make these machines any faster (without money) and "safer" so the next owner feels sure they won't be failing on them soon.
View 1 Replies
View Related
Aug 27, 2010
I run Ubuntu 10.04 in 64 bit. My current hardware specs are:
(2) Nvidia 8800 GTS
Asus Crosshair 1
AMD Athlon X2 5200+
2GB DDR 3 Corshair ram
How can I utilize my hardware to it's full potential using Ubuntu?
View 2 Replies
View Related
Sep 3, 2010
My DSL is working and my computer is on line but I would like to optimize my connection for better speed. I found a utility for this at speedguide.net but it was written for Windows.
View 3 Replies
View Related
Feb 3, 2011
The PC is AMD Duron, 370 Mb memory, Hd Maxtor 80 Gb, S.O. 10:10 maverick Ubuntu, Linux Kernel 2.6.35-24-generic.
Gnome 2.32.0
Who can I analyze this screen:
Code:
In particular, what are all the mistakes, how much ram maximum support, what kind and where can I find the physical space for the three DIMMs that are missing in the list.
View 3 Replies
View Related
Feb 25, 2010
I need to optimize the implementation of DSR algo using NS-2. Now i need to identify the first of all "the parameters which i can change and which are effective in optimization point of view." I want to get into the c++ code as well as header files which are used to implement DSR algo.
View 4 Replies
View Related
Feb 7, 2010
Recently I was trying to use Gentoo, and I was really impressed of how it is faster than Ubuntu in running applications, specially when I build wine and was able to run Oblivion at a reasonable speed. I would like to know if there is a way to compile Ubuntu from source code, to optimize it to my hardware.
View 2 Replies
View Related
Mar 4, 2010
I'm looking for a newbie friendly guide on tuning stuff like TCP and whatnot. I installed a program on my sister's Windows computer called Internet Cyclone and it did all the settings itself, but I can't seem to find such a program for Linux. I kinda want to learn to do it myself too, so can you point me to a newbie friendly guide on how to optimize my Internet connection settings?
View 1 Replies
View Related
Mar 16, 2011
My machine is:
Intel Celeron, 2000 MHz (20 x 100), 400MHz FSB, s478 Northwood core with 128 KB L2 Cache
768 MB RAM: 3 * 256 MB PC133 SDRAM (3.0-3-3-6 @ 133 MHz), DRAM:FSB running as 4:3
Intel Havre D845HV (3 PCI, 1 AGP, 3 SDR DIMM, Audio) (latest BIOS, HV84510A.86A.0050.P15.0305252001)
Western Digital 60GB hard disc, WDC WD600BB-75CAA0
SONY DVD-ROM DDU1612, and some generic floppy
[code]....
all in all this was a pretty good machine to run Windows XP SP3, MS office 2000 (or 2003), and some mozilla-based browser (Firefox can work OK, but with "K-Meleon 1.5.4" it's fast as lighting). It has enough horsepower to run CounterStrike at 1024*768 and play MiHD movies with just a few ocasional glitches. Plays DVDs or XVID and MP3s without any problems, and they don't seem to use much resources in Task Manager. Sound, graphics and network subsystem work very good, but this will always be a PC133 SDRAM system hence memory bandwidth problems, and not much can be done about that. Machine was used as office + internet box, with some Winamp music playing in the background and as such it was great.
Now I turned it into (dual boot) CentOS 5.4 development server for developing a nonprofit PHP site.Joomla-based contents load slower from this machine on the intranet then on the regular server online. It's not crazy slow (like pentium 1 @ 166 mhz) but it's definitelly not good either. I think it should be able to run much much better, especially when I remember the Athlon T-bird at 1 GhZ with 512 MB PC100 RAM used to be much more responsive while running web apps on Mandrake 9 (when it came out) with KDE WM, while this cellery runs just server in init 3 (no Xorg or Gnome, just command prompt).
Please advise me how could I enhance the speed of the system. CentOS 5.4 was installed with all settings on default. Everything worked plug'n'play, didn't need to install anything extra. Machine primarily runs Apache2 with PHP and MySQL, SSH and SFTP daemons, not much else I guess. No GUI, mostly it runs headless anyway. I'm mostly annoyed by the way it serves pages, it's like it takes up to 6 seconds to precache some complex PHP page and then poof! whole page appears at once. I'd much rather if it served the contents of the page part by part, gradually filling in the details. I'm not sure if (and how) that can be achieved though. I'd like to optimize servers (mostly Apache) and maybe net config to run smoother and faster.
View 4 Replies
View Related
Nov 21, 2010
After having tried to fix the plymouth without any successfully result (i am meanning the thread i began few weeks ago and sited here: [URL]. I decided to keep nvidia's privates drives on giving up any hope to fix the plymouth bug and, right now, i would like to optimize or configurate the drivers properly like it is on Mandriva One 2010.
Perhaps someone is not exactly understand what i want to say. Well, i was using Mandriva One 2010 before installing Ubuntu Maverick and i have noticed there was no a low latency, lag effect, low performance or a lack of initial smooth and clean windows moves in Mandriva One 2010 but on Ubuntu there is.
This is very hard to explain for me, for example, If i use the "flip windows selector" (i mean, pressing "<Super>+Tab" keys) show me this effect too slow initially but if i forced the GPU for a while (repeating and pressing the keys), the lag effects vanished and then, the flip windows selector works nicely fast, clean and smooth. Now if i stop to use that effects, let the Nvidia GPU repose a while and use again the flip windows selector again, the lag effects come up again.
This fact does not just happen using the "flip windows selectos", any effects which minimize, resize or maxime the windows generate that annoying initial lag effects, for example, a simple minimize windows:
I am in despair with this, i do not if i have to do some change in the /etc/X11/xorg.conf file, what i have to configurate in the "Nvidia X server Settings" or in the "compiz manager settings" application.
Anyone knows a tutorial about how to optimize the Nvidia drivers on Ubuntu? or the Compiz effects to reduce the lag effets?
View 1 Replies
View Related
Sep 15, 2010
My server... its CentOS (redhat alike). I need to make the server disable apache server then run mysql command to optimize the databases then re-enable apache server in a specific time daily. Is it possible?
View 4 Replies
View Related
Dec 10, 2008
I have a shell script that I would like to log to stdout and also to a file.....much like using tee. I would like to, instead of calling the script and piping to tee...i would like for the script to tee itself.
View 4 Replies
View Related
Jul 11, 2010
i got to build my own linux shell for my project
View 5 Replies
View Related
Jul 23, 2010
I have been searching most of today and am stuck on getting a variable into an awk portion of my bash script. I have this working:
Code:
#!/bin/sh
SRC=/var/log/mail.log
DEST=/var/www/output/myFile.txt
VAR=userName@myDomain.tld
[code]....
Can awk take a shell variable? Or do I have to do something completely different?
View 11 Replies
View Related