I have a polipo proxy running on Ubuntu. It's set to start automatically on boot, but occasionally it just dies. What's the simplest way to have it automatically restarted whenever it exits unexpectedly?
EMP's questions
Slipstreaming Windows service packs used to be a simple process with earlier versions - just run the EXE with a special command-line switch. I can't seem to find such a switch with Windows Server 2008 R2 service pack 1. How do I slipstream it? TechNet mentions "integrated installation", so it's possible, but it doesn't seem to have any details on how to actually do it!
I created a "system" user in Ubuntu 11.04 (adduser --system
) for running certain cron jobs, but sometimes I want to test things out by manually running commands as that user. What's the easiest way to do this?
su
doesn't work, because the user has /bin/false
as its shell (which is fine for cron). I've been manually changing the shell to /bin/bash
to do my testing and then changing it back again, but I wonder is there an easier way?
I have a Postfix server that receives mail for virtual aliases and forwards them to the real destination addresses. When the final mail server returns an error the bounce message returned to the sender reveals the final destination email address. Eg. if my server receives mail for [email protected] and tries unsuccessfully to send it to [email protected] the bounce message looks something like this:
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<[email protected]> (expanded from <[email protected]>): host
final.mail.host.com said: 553 5.1.8
<[email protected]>... <some error> (in reply to RCPT TO command)
How do I stop it from revealing the final address?
I have a Windows Server 2008 R2 machine connected to an IPv4 Windows network that cannot resolve the simple name of another server when trying to access a file share. If I try to browse to \\SERVERNAME
in Explorer I get
The network name cannot be found
However, other server names (from the same domain) work fine. I can also connect to the same server if I specify the FQDN, ie. \\SERVERNAME.my.domain.com
Pinging the simple name (ping SERVERNAME
) also works. Does anyone know what's wrong here?
I'm investigating an issue with DB connections being left open indefinitely, causing problems on the DB server. How do I see currently open connections to a PostgreSQL server, particularly those using a specific database? Ideally I'd like to see what command is executing there as well. Basically, I'm looking for something equivalent to the "Current Activity" view in MSSQL.
I have a process that listens on a TCP port (?0003). From time to time it crashes - badly. It stops working, but continues hogging the port for some time, so I can't even restart it. I'm looking to automate this.
What I do right now is:
netstat -ntlp |grep -P "\*\:\d0003"
To see what the PID is and then:
kill -9 <pid>
Does anyone have a script (or EXE for that matter) that would link the two steps together, ie. parse the PID from the first command and pass it to the second?
I've configured basic Apache authentication for certain areas of a website that only administrators should have access to. Most web applications make this convenient by putting their admin pages in a subdirectory, so I configure authentication for the directory, such "/goodapp/admin". The problem is that some applications instead rely on the query string, eg.
/badapp/index.php?page=admin
Is there any way I can configure Apache to require authentication for a URL like this, based on the query string?
Does SuSEfirewall in OpenSuSE 11 provide an easy way to block all traffic from a list of IP addresses? Ideally just a textfile into which I can put all IP addresses I want blocked, otherwise some configuration option. I've looked through /etc/sysconfig/SuSEfirewall2, but haven't been able to find anything like that.
I have an Apache server with password-protected web directory. That directory has a sub-directory, which requires another password, but anyone who can access the sub-directory should have access to the parent directory as well. That is:
- /stuff - users "stuff" and "admin" allowed
- /stuff/admin - only user "admin" allowed
So I've set it up that way in the Apache config:
<Directory "/stuff">
[AuthType Basic, AuthName, etc.]
Require user stuff
Require user admin
</Directory>
<Directory "/stuff/admin">
[AuthType Basic, AuthName, etc.]
Require user admin
</Directory>
This works in the sense that I can browse to /stuff and log in as either "admin" or "stuff". However, the pages in /stuff/admin references some images from the parent directory. I find that when I browse directly to /stuff/admin and log in as "admin" the browser still prompts me for another password to load those images. (I know it's the prompt for /stuff, because the AuthName value is different.)
How do I avoid this and allow a user who has access to /stuff/admin to just log in once (as "admin"), not twice?
I have a database in PostgreSQL 8.3.1 that I'd like to migrate to MS SQL Server 2005 (or maybe 2008), including both the table schema and the data. The database is about 50GB in size with about 400,000,000 rows, so I think simple INSERT statements are out of the question. Could anyone recommend the best tool for performing this migration? Obviously it needs to be reliable, so the data is exactly the same in the target DB as in the source one and it needs to be able to copy this volume of data within a reasonable time.
I have an openSUSE server with lots of unnecessary packages installed, which I'd like to remove. However, I find that when I try to do that zypper often wants to install other packages in their place? Why on Earth do I need to install stuff to remove stuff? How do I just remove it?
For example, I want to uninstall all x11 packages so I run:
zypper rm xorg-x11*
I get this:
...
Resolving package dependencies...
The following packages are going to be upgraded:
python-qt python-qt4 splashy suspend t1lib
The following packages are going to be downgraded:
libx86 qt3
The following NEW packages are going to be installed:
dbus-1-32bit file-32bit fontconfig-32bit freetype2-32bit libdrm-32bit
libexpat1-32bit libgcc43-32bit libgcrypt11-32bit libglib-2_0-0-32bit
libgpg-error0-32bit libgthread-2_0-0-32bit libjpeg-32bit liblcms1-32bit
liblzo2-2-32bit libmng-32bit libpng12-0-32bit libqt4-32bit libqt4-sql-32bit
libstdc++43-32bit libtiff3-32bit libuuid1-32bit pciutils-32bit pcre-32bit
sysfsutils-32bit xorg-x11-libICE-32bit xorg-x11-libSM-32bit xorg-x11-libX11-32bit
xorg-x11-libXau-32bit xorg-x11-libXext-32bit xorg-x11-libXfixes-32bit
xorg-x11-libXmu-32bit xorg-x11-libXp-32bit xorg-x11-libXpm-32bit
xorg-x11-libXprintUtil-32bit xorg-x11-libXrender-32bit xorg-x11-libXt-32bit
xorg-x11-libXv-32bit xorg-x11-libfontenc-32bit xorg-x11-libs-32bit
xorg-x11-libxcb-32bit xorg-x11-libxkbfile-32bit zlib-32bit
The following packages are going to be reinstalled:
DirectFB Mesa libQtWebKit4 libqt4-qt3support libqt4-x11 php5-gd
The following packages are going to be REMOVED:
xorg-x11-libICE xorg-x11-libSM xorg-x11-libX11 xorg-x11-libXau xorg-x11-libXext
xorg-x11-libXfixes xorg-x11-libXmu xorg-x11-libXp xorg-x11-libXpm
xorg-x11-libXprintUtil xorg-x11-libXrender xorg-x11-libXt xorg-x11-libXv
xorg-x11-libfontenc xorg-x11-libs xorg-x11-libxcb xorg-x11-libxkbfile
The following packages are going to change architecture:
DirectFB Mesa libQtWebKit4 libqt4-qt3support libqt4-x11 libx86 php5-gd python-qt
python-qt4 qt3 splashy suspend t1lib
Overall download size: 34.9 M. After the operation, additional 1.9 M will be used.
Continue? [Y/n/p/?]: n
I know that Linux may, depending on configuration, allow the interactive user to reboot the server by pressing Ctrl-Alt-Del even without logging in. I have a remote console session over SSH to a remote server that I cannot log into, but I want to reboot it. Is it possible to somehow send the key combination Control-Alt-Delete over SSH (or telnet
)? If so, how?
Edit: to clarify, I am not just connected to the server's sshd
over ssh
- I am connected via a KVM over IP switch, so it's a serial console. But this connection itself is over SSH and my question is how to send the Ctrl-Alt-Del key combination over it.
We've got an instance of SQL Server 2008 running in production and I had no idea it was a trial version - until it expired! Now I can no longer run SQL Management Studio and SQL Reporting Services will not start, but SQL Server itself (ie. the database engine) continues running and users can still access data as normal (apart from reports). My question is: how long will it continue to work? Is there a time when it will just shut down and refuse to start again?
I want to execute some commands with SYSTEM privileges on Windows Server 2008. I have Administrator privileges, of course. On the good old version of Windows without all the UAC BS this was as simple as:
at 15:48 /interactive cmd
And after a minute a command prompt would pop up, running as NT AUTHORITY\SYSTEM. But if I do this on Windows 2008 it tells me:
Warning: Due to security enhancements, this task will run at the time expected but not interactively. Use schtasks.exe utility if interactive task is required ('schtasks /?' for details).
I checked schtasks and it looks like that only gives you the ability to run a task interactively as the logged on user, which is not what I want. Of course, I could code and install a service that runs as SYSTEM, but what a hassle! Could anyone suggest an easier way?
I'm so sick of these hoops Microsoft is making me jump through just to do what I want to do on my system.
I have a Windows XP x64 SP2 machine that used to boot up really quickly, but now takes a very long time. If I enable the /sos boot switch it gets to the bit where it says:
2 system processors [8191MB memory]
and it sits there for literally about 3-4 minutes before going into GUI mode. Another machine running Windows XP x86 SP3 has a similar issue.
How do I troubleshoot this?
Update:
It boots really quickly in Safe Mode, but not in "Safe Mode with Networking support". I tried the Process Monitor log, but unfortunately it doesn't help. The bulk of the time is between the very first two entries - system starting and smss.exe starting.
Is it possible for the root user in Linux to have a real-time (or close to real-time) view of the shell commands being run by another user logged in via a terminal or SSH? Obviously they're stored in .bash_history, but that's only saved when the user logs off and can be disabled, too.
Edit: ideally something that can easily be switched on and off.
We have Exchange 2007 set up with Outlook Web Access. ASP.NET forms authentication is enabled for the OWA directory and all other authentication methods are disabled. When browsing to the OWA site I get the login form, as expected, however when trying to log in I always get "The username or password that you entered is not valid. Try entering it again." I'm sure that the username and password are correct. I've already tried it both with and without the domain name, ie. "DOMAIN\username" and just "username". How do I troubleshoot this?