sysadmin

Randomly long DB queries/Memcache fetches in production env

I'm having trouble diagnosing a problem I'm having on my ubuntu scalr/ec2 production environment. The trouble is apparently randomly, database queries and/or memcache queries will take MUCH longer than they should. I've seen a simple select statement take 130ms or a Memcache fetch take 65ms! It can happen a handful of times per request,...

How to shorten an inittab process entry, a.k.a., where to put environment variables that will be seen by init?

I am setting up a Debian Etch server to host ruby and php applications with nginx. I have successfully configured inittab to start the php-cgi process on boot with the respawn action. After serving 1000 requests, the php-cgi worker processes die and are respawned by init. The inittab record looks like this: 50:23:respawn:/usr/local/b...

What programming things should every SysAdmin know?

This is a mirror-image of this question here: http://serverfault.com/questions/4176/what-sysadmin-things-should-every-programmer-know The original was posted by Nathan DeWitt. Credit should go to him. If you have a serverfault account, please visit his original question and bump it to show appreciation for this inquiry. To paraphrase...

Help me make an argument for why system build tools shouldn't automatically do SVN checkin

I'm trying to make a case against automated checkins to version control. My group at work has written some system build tools around CFEngine, and now they think these tools should automatically do checkins of things like SSH host keys. Now, as a programmer, my initial gut reaction is that nothing should be calling "svn up" and "svn ci"...

Update website with a single command (git push) instead of FTP drag and dropping

Situation: I have a local copy of a website I have a server that I have SSH access to What do I want to do? Commit locally until I'm happy with my code Make branches locally Have one master branch that is the one that should be pushed to the server Update the website using a single command (git push origin master) If I set up a g...

Make index.php behave as a directory...

Some sites (for example, certain implementations of mediawiki,) have a uri format of http://example.com/index.php/SOME_PAGE. How is this done? Is index.php just a directory on the server that happens to be named like a php file and that actually contains a file named SOME_PAGE? If so, why name it like that? If not (i.e. it actually...

Stress testing a server and VPS's vs. Dedicated servers

We used to have a dedicated server (1&1) and very infrequently ran into problems with the server having issues. Recently, we migrated to a VPS (Wiredtree.com) with similar specs to our old dedicated server, but notice frequent problems running out of memory, mysql having to restart, etc... both when knowingly running intensive scrips an...

Combining DNS wildcards and search domain

I have a setup where one webserver (bar.com) is serving lots of subdomains, so it would be convenient to use a wildcard DNS entry. At the same time I'd like to use bar.com as search domain, so that foo resolves to foo.bar.com. The problem now is that if I set it up like this, foo.com resolves to the webservers IP if there is no foo.com...

What visual programming language works well for scripting admin tasks?

Would like a visual environment for creating admin scripts to manage tasks. ...

Query for computers on a domain that are online

Where I work we use a piece of software called Dameware to remotely manage computers on our domain. Through Dameware we are able to get a list of all of the computers that are online and currently connected to the domain. We are in the process of rolling out new desktop management software that does not provide this feature to us. We ne...

Change Mysql, php and apache2 log file formats

I am sending php errors, all mysql queries, apache2 errors and mod_rewrite debugging to one file, needless to say it's busy in there. Can the format be changed from: [22-Jul-2009 23:00:58] Parameters: GET Array ( ) POST Array ( ) [22-Jul-2009 23:00:58] Finding Associations 237 Query SELECT `table`.* FROM `table...

How to setup cookieless domain in Lighttpd?

I want to setup domain with disabled cookies, to serve static content. ...

php chown file in remote server ssh2

Hi, I'm uploading one file from one server to other using ssh2_scp_send(). Everything works fine, the only problem is that I don't know how to change the owner and the group of the file after finishig the upload. How can I preform some kind of chown in the ssh2 ...

Tar error: Unexpected EOF in archive

I tar a directory full of JPEG images: tar cvfz myarchive.tar.gz mydirectory When I untar the archive: tar xvfz myarchive.tar.gz I get an error tar: Unexpected EOF in archive Looking at the output, it fails in the middle of one particular JPEG image. What am I doing wrong? ...

Is there a PHP/MySQL database admin that doesn't use sessions?

I am doing development work on a site with a strange server set up where sessions basically don't work. It's kind of a long story, but the main crux is it's a cluster of servers that are syncronized from an FTP server every few minutes. And for example, anything written to the filesystem in PHP gets deleted within 5 minutes. So this mea...

Multiple-domains on WAMP localhost

If you're reading my question, thanks, I appreciate your help I'm using Wamp on Windows Vista. I've created 2 project folders: www/project1/ www/project2/ My virtual hosts file looks like this: NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot "C:/wamp/www/project1/" ServerName project1.com </VirtualHost> <VirtualHo...

linux based submission script for CS student source code

I'm in the late stages of developing a Linux based computing lab for CS students at my university. In my undergraduate days I remember being able to submit my homework assignments with a command like: submit [classname] [projectname] [source files] which would then copy all my files to a directory students couldn't access but the inst...

How do I unlock an Oracle user's account from Java?

I'm trying to figure out why my application is unable to unlock a user's Oracle account successfully. Here's a snippet from my code: OracleDataSource ods = new oracle.jdbc.pool.OracleDataSource(); Properties props = new Properties(); props.put("user", "sys"); props.put("password", "sys"); props.put("internal_logon", "sysdba"); ods.set...

Benefits of JVM atop an OS VM?

I see many deployments where IT groups run effectively nothing but a JVM application stack inside a VM (vmware, &c) instance. I guess I consider the JVM to be a formal VM: what real benefit is it to run your Java application stack inside another VM? ...

Edit crontab programmatically and force the daemon to refresh

Hi, I'm trying to write a web frontend for Crontab in Ruby using the excellent CronEdit gem. I went through Dillon Cron's crontab source code and found that it updates a particular file so that the daemon will refresh the cron list during the next sweep. In man crontab for VixieCron, it says: Additionally, cron checks each minute to ...