Most Popular

1500 questions
45
votes
6 answers

Forwarding ports to guests in libvirt / KVM

How can I forward ports on a server running libvirt/KVM to specified ports on VM's, when using NAT? For example, the host has a public IP of 1.2.3.4. I want to forward port 80 to 10.0.0.1 and port 22 to 10.0.0.2. I assume I need to add iptables…
steveh7
  • 453
  • 1
  • 5
  • 4
45
votes
5 answers

How do I check a PTR record?

I need to check a PTR record to make sure that a script I have is sending emails which will actually be received by my users and not be incorrectly marked as spam. I understand that the ISP which owns the IP range has to set up the PTR record, but…
Daisetsu
  • 627
  • 1
  • 6
  • 8
45
votes
2 answers

how to update a symbolic link target (ln -f -s not working)

I'm using ln -f -s /var/www/html/releases/build1390 app-current to update symbolic link "app-current" with a new destination. However, this doesn't work, the link "app-current" keeps it original destination, however, I don't get any…
solsol
  • 1,121
  • 8
  • 21
  • 31
45
votes
5 answers

Nginx vs Apache as reverse proxy, which one to choose

this kind of question maybe has been asked here but I couldn't find any that really match my question. Heard that nginx performance is quite impressive, but Apache has more docs, community(read:expert) to get help Now what I want to know, how both…
mhd
  • 633
  • 1
  • 6
  • 9
45
votes
22 answers

PowerShell? Do you use it? Can you show me some cool system administration things I can do with it?

I keep reading everywhere that PowerShell is the way of the future. When it was first released I did a whole bunch of virtual labs, but since then I still haven't used it in a production environment. I know the day will come when I'm dealing with…
45
votes
8 answers

How do I ask screen to behave like a standard bash shell?

Just learned about the screen command on linux - it is genius. I love it. However, the actual terminal/prompt in screen looks and behaves differently than my standard bash prompt. That is, the colors aren't the same, tab completion doesn't seem…
thornomad
  • 551
  • 1
  • 4
  • 5
45
votes
7 answers

How to find memory usage of individual Windows services?

Task Manager shows the overall memory usage of svchost.exe. Is there a way to view the memory usage of individual services? Note this is similar to Finegrained performance reporting on svchost.exe
Aidan Ryan
  • 1,273
  • 2
  • 13
  • 16
45
votes
13 answers

How to change "From:" field for emails from Cron?

I use remote SMTP via nullmailer and it requires set From field to the specific name, but cron set it as root@my.sweet.server.com. How could I change it to something like me@ya.ru?
Alexander Artemenko
  • 1,393
  • 3
  • 13
  • 13
45
votes
6 answers

SSH session drops - Does the command continue executing?

If I was running a command before the SSH connection was dropped, will the command continue executing?
Miko
  • 1,759
  • 4
  • 22
  • 28
45
votes
3 answers

How can I get CPU count and total RAM from the OS X command line?

How can I get CPU count and total RAM from the OS X command line?
yazz.com
  • 7,193
  • 15
  • 38
  • 39
45
votes
10 answers

PostgreSQL Replication

We constantly bat this around the office, and the question continues to come up. How do you deal with PostgreSQL replication? I'm not even necessarily talking about advanced clusters, just keeping it simple with Master-Slave, Master-MultiSlave, and…
f4nt
  • 859
  • 10
  • 9
44
votes
3 answers

Change current directory to the batch file directory

I have a bat file on windows that execute a procdump operation. The issue with the batch file is that I need to cd to the batch file directory first before executing the job, or else the script won't work. How to change to the current batch file…
Graviton
  • 2,865
  • 12
  • 42
  • 64
44
votes
10 answers

Does CPU power management affect server performance?

I was doing some simple hand benchmarking on our (live) database server during non-peak hours, and I noticed that queries returned somewhat erratic benchmark results. I had enabled the "Balanced" power saving plan on all our servers a while ago,…
Jeff Atwood
  • 13,104
  • 20
  • 75
  • 92
44
votes
4 answers

How do I remove a specific bad plan from the SQL Server query cache?

We have one particular SQL Server 2008 query (not a stored proc, but the same SQL string -- executes every 5 minutes) that intermittently caches a very bad query plan. This query normally runs in a few milliseconds, but with this bad query plan, it…
Jeff Atwood
  • 13,104
  • 20
  • 75
  • 92
44
votes
23 answers

Finding the Public IP address in a shell script

I can find my IP address using ifconfig or hostname -i command. But how do I find my Public IP? (I have a static public IP but I want to find it out using unix command)
shantanuo
  • 3,579
  • 8
  • 49
  • 66