Say fileA is a sym link to fileB. I have only fileB at hand and want to find all files that are sym links to fileB. Is there a command to show this in *nix?
I use the following commands to sync folders. Each command requires me to type in the password. How can I group these commands to only enter the password once? Thanks.
rsync -ave ssh /opt/lampp/htdocs/new/folder1/ [email protected]:/home/folder1/
rsync -ave ssh /opt/lampp/htdocs/new/folder2/ [email protected]:/home/folder2/
rsync -ave ssh /opt/lampp/htdocs/new/folder3/ [email protected]:/home/folder3/
Hi,
I'm looking for a command line tool for windows that will go over a directory tree (recursively) and output a list of all the files in there, and a checksum for each file (can be CRC, MD5, whatever).
Esentially, what I want is to compare 2 big directory trees in 2 machines. I'm planning to take the outputs of running this tool in both, and diffing them to make sure they're identical.
I appreciate any ideas.
I've been happily using grep for many years without any issues, but since today it quit working. During the past hour I tried this and that, but enough is enough, I'm posting the bastard here:
On the simplest command like
grep 'aaa' file.txt
I'm getting this: grep: aaa: No such file or directory
So grep does not interpret the first argument as the pattern as it should, but treats it as a path.
Please help me, I'm going crazy '-(
I have a few hundred family images and they were all sent to us with borders that I would like to remove. Thankfully the borders are all the same size of 20 pixels and they are all .jpg so this will probably make things easier but im looking for a way to "batch process" all of them quickly so I dont need to open photoshop for each image and do it individually. Command line is preferred, the only big problem is they are mostly different sizes.
Here is an example
I'm a Windows user and am just getting my feet wet with Python and some other languages. I keep having to deal with the Command Prompt, and it doesn't bother me, but I'm sure there are some free alternatives out there that look a lot nicer and probably pack a bigger punch.
Any suggestions would be nice. Thanks!
I downloaded a perl file from some webpage by opening it in my browser and saving it. But the saved file has a file name xxx.pl.txt. How can I save it into a file with pl as its ext?
Also how to change a file's ext?
Can I do these in command line?
Thanks and regards!
Is there a way to use the built-in windows file compression tool in command line? Instead of RightClick/Send To/Compress (Zipped) Folder.
Windows Server 2003 Enterprise Edition
Thanks!
So I want to run apache benchmark but while it's running, I need to run htop to see the memory and cpu usage. How can I do that? Putty (My ssh client) won't let me type in a command until ab is done running.
Ideas?
In Linux, I'd like to know how to find the file(s) if any which as using a particular sector on the hard drive. There is a similar question here regarding Windows, however I need a Linux command line solution (this is a headless system).
What command line switches exist for Notepad?
I found a few:
/A <filename> opens file as ansi
/W <filename> opens file as unicode
/P <filename> prints filename
Are there others?
I'd like to ask how is it possible to add quotes in VB.
I'm trying to run command which contains quotes..
example:
Shell("cmd.exe")
SendKeys.Send("cd "c:\users\abc def" ") <<<<--- this line
SendKeys.Send("{ENTER}")
there is an syntax error.
the problem is that I need to add quotes to some commands as there is a space in folderpath.
As a beginner in VB I'm not really sure how to describe the poblem correctly so I hope you can see the it in my example :/
Thank you all in advance
i have a list of files in a folder. the list of files is displayed using:
ls | cat
now, i want to pipe that to uniq so it'll ignore the first 6 charactes before comparing.
is it possible? or perhaps i need to use another command?
thank you
Hello, everyone!
I can't find good information about which characters are allowed and which of them must be unescaped on command line in different operating systems.
Please help! ;)
I can do mkdir messages
and then
touch messages/hello.txt
Is there a command that will do both - create the directory if it doesn't exist, and then the empty file?
something like: touch -p messages/hello.txt
Thanks in advance
-- Deb
How can I delete Directories which are smaller than, say, 1000 KB?
I already have a file list from the command:
du -sk * | sort -n > sort.txt
but I don't know how to proceed.
Hi,
I have an application that when run as a windows application takes around 4 secs to compute, but when run as a webservice, it takes a long time to compute (until a timeout).
Do you have any idea what the problem might be?
I am assuming that since the code is exactly the same, there are no problems such as infinite loops ..... it seems that it just takes longer.
Do you have an idea what might the problem be?
thanks
I am trying to save audio using mplayer from a live http stream. saving audio is successful. If there is no live stream playing it does not exit automatically. Is there any way to set timeout if there is no live stream?
code : mplayer -i url -t 00:00:10 -acodec libmp3lame -ab 24 -ar 8000 audio.mp3
Thanks in advance.
I am building a system using NServiceBus and my DataLayer is using Linq 2 SQL.
The system is made up of 2 services.
Service1 receives messages from NSB.
It will query Table1 in my database
and inserts a record into Table1
If a certain condition is met a new NSB message is sent to the 2nd service
Service2 will update records also in Table1 when it receives messages from Service1 and it does some other non database related work.
Service2 is a long running process.
The problem I am having is the moment Service2 updates a record in Table1, the table is locked. The lock seems to be in place until Service2 has completed all it is processing.
i.e. The lock is not released after my datacontext is disposed.
This causes the query in Service1 to timeout.
Once Service2 completes processing, Service1 resumes processing again without problem.
So for example Service1 code may look like:
int x =0;
using (DataContext db = new DataContext())
{
x = (from dp in db.Table1 select dp).Count(); // this line will timeout while service2 is processing
Table1 t = new Table1();
t.Data = "test";
db.Table1.InsertOnSubmit(t);
db.SubmitChanges();
}
if(x % 50 == 0)
CallService2();
The code in service2 may look like:
using (DataContext db = new DataContext())
{
Table1 t = db.Table1.Where(t => t.id == myId);
t.Data = "updated";
db.SubmitChanges();
}
// I would have expected the lock to have been released at this point, but this is not the case.
DoSomeLongRunningTasks();
// lock will be released once service2 exits
I don't understand why the lock is not released when the datacontext is disposed in Service2.
To get around the problem I have been calling:
db.ExecuteCommand("SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED");
and this works, but I am not happy using it.
I want to solve this problem properly.
Has any one experienced this sort of problem before and does any one know how to solve it?
Why is the lock not released after the datacontext has been disposed?
Thanks in advance.
p.s. sorry for the extremely long post.
I have a download worker that uses ThreadPool-threads to download files. After enhancing these to apply some Selenium tests to the downloaded files, I am constantly experiencing TimeOut-exceptions with the file downloaders and delays running the Selenium tests. More precisely:
When the program starts, the download threads start downloading and a couple of pages are seamlessly processed via Selenium
Shortly after, the first download threads start throwing TimeOut exceptions from HttpWebRequest.
At the same time, commands stop flowing to Selenium (as observed in the SeleniumRC log), but the thread running Selenium is not getting any exception
This situation holds as long as there are entries in the download list: new download threads are being started and terminate after receiving TimeOuts (without trying to lock Selenium)
As soon as no more download threads are being started, Selenium starts receiving commands again and the threads waiting for the lock are processed sequentially as designed
Now here's the download code:
HttpWebRequest request = null;
WebResponse response = null;
Stream stream = null;
StreamReader sr = null;
try
{
request = (HttpWebRequest) WebRequest.Create(uri);
request.ServicePoint.ConnectionLimit = MAX_CONNECTIONS_PER_HOST;
response = request.GetResponse();
stream = response.GetResponseStream();
// Read the stream...
}
finally
{
if (request != null) request.Abort();
if (response != null) response.Close();
if (stream != null)
{
stream.Close();
stream.Dispose();
}
if (sr != null)
{
sr.Close();
sr.Dispose();
}
}
And this is how Selenium is used afterwards in the same thread:
lock(SeleniumLock)
{
selenium.Open(url);
// Run some Selenium commands, but no selenium.stop()
}
Where selenium is a static variable that is initialized in the static constructor of the class (via selenium.start()).
I assume I am running into the CLR connection limit, so I added these lines during initalization:
ThreadPool.GetMaxThreads (out maxWorkerThreads, out maxCompletionPortThreads);
HttpUtility.MAX_CONNECTIONS_PER_HOST = maxWorkerThreads;
System.Net.ServicePointManager.DefaultConnectionLimit = maxWorkerThreads + 1;
The + 1 is for the connection to the SeleniumRC, due to my guess that the Selenium client code also uses HttpWebRequest. It seems like I'm still running into some kind of deadlock - although the threads waiting for the Selenium lock do not hold any resources.
Any ideas on how to get this working?
I have a site that has a mix of http and https pages. Under the root of the site, one folder has all the http pages and another has all the https pages. Login is over https and sends the user to the other pages. When a session expires the forms authentication redirects to the Login page but the browser uses http and the user gets a 403 error.
Is there any way to override the session timeout to send it to https?
Our performance testing team is running test on our WPF-WCF-Sql Server application and they are facing connection timeout after the load goes above 75 users
Error -27796: Failed to connect to server "81.171.180.119:4567": [10060] Connection timed out
I would like to know what can be steps to look at bottlenecks which may be causing issues like maybe some setting in Load Runner or identify the code bottlenecks.
Thanks
I'm making a speed game in VB.Net (Console Application) and users have a certain time to press a certain key. So how can I give the Console.ReadKey function a timeout without just waiting until a key was pressed?