sysadmin

Edit crontab programmatically and force the daemon to refresh

隐身守侯 提交于 2019-12-07 20:33:25
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 see if its spool directory’s modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified. Note that the

Force a Samba process to close a file

断了今生、忘了曾经 提交于 2019-12-07 10:26:25
问题 Is there a way to force a Samba process to close a given file without killing it? Samba opens a process for each client connection, and sometimes I see it holds open files far longer than needed. Usually i just kill the process, and the (windows) client will reopen it the next time it access the share; but sometimes it's actively reading other file for a long time, and i'd like to just 'kill' one file, and not the whole connection. edit: I've tried the 'net rpc file close ', but doesn't seem

Host Primary Domain from a subfolder

岁酱吖の 提交于 2019-12-07 09:18:13
问题 I am having a problem making a sub directory act as the public_html for my main domain, and getting a solution that works with that domains sub directories too. Background My hosting allows me to host multiple sites, which are all working great. I have set up a subfolder under my ~/public_html/ directory called /domains/ , where I create a folder for each separate website. The folder structure on my server looks something like this: public_html domains websiteone websitetwo websitethree ...

Cannot connect to PgSQL via Laravel SQLSTATE[08006] [7] FATAL

末鹿安然 提交于 2019-12-06 08:05:01
问题 I'm trying to connect to pgsql via laravel and finally got everything setup (pgsql server running, pdo installed, all libs installed). I'm running on a VPS (CentOS) managed via CPanel/WHM. Here's what I'm doing: I'm trying to create a user database via artisan (Laravel's command line) using migrate:install. For those that don't use Laravel, artisan uses php's PDO for pgsql to connect. Here are my settings: 'pgsql' => array( 'driver' => 'pgsql', 'host' => 'localhost', 'database' => 'dbname',

How to handle new files to process in cron job

左心房为你撑大大i 提交于 2019-12-06 07:30:24
问题 How can I check files that I already processed in a script so I don't process those again? and/or What is wrong with the way I am doing this now? Hello, I am running tshark with the ring buffer option to dump to files after 5MB or 1 hour. I wrote a python script to read these files in XML and dump into a database, this works fine. My issue is that this is really process intensive, one of those 5MB can turn into a 200MB file when converted to XML, so I do not want to do any unnecessary

Should we really use chef to manage the sudoers file?

蹲街弑〆低调 提交于 2019-12-06 02:32:50
This is my question. I am worried that if Chef breaks something in the sudoers file, probably by a Chef user using the cookbook incorrectly, then the server will be entirely inaccessible. I would hate for us to completely lose a production server for a customer because we messed up the sudoers file and can no longer ssh into the box. Chef has a feature to help with this, verifiers. You can set up the verifies on your sudoer template like this: template '/etc/sudoers' do source 'whatever.erb verify 'visudo -c -f %{path}' end If visudo rejects the syntax, the tempfile will never get put in place

Host Primary Domain from a subfolder

无人久伴 提交于 2019-12-05 16:43:05
I am having a problem making a sub directory act as the public_html for my main domain, and getting a solution that works with that domains sub directories too. Background My hosting allows me to host multiple sites, which are all working great. I have set up a subfolder under my ~/public_html/ directory called /domains/ , where I create a folder for each separate website. The folder structure on my server looks something like this: public_html domains websiteone websitetwo websitethree ... This keeps my sites nice and tidy. The only issue was getting my "main domain" to fit into this system.

Force a Samba process to close a file

柔情痞子 提交于 2019-12-05 16:40:41
Is there a way to force a Samba process to close a given file without killing it? Samba opens a process for each client connection, and sometimes I see it holds open files far longer than needed. Usually i just kill the process, and the (windows) client will reopen it the next time it access the share; but sometimes it's actively reading other file for a long time, and i'd like to just 'kill' one file, and not the whole connection. edit: I've tried the 'net rpc file close ', but doesn't seem to work. Anybody knows why? edit: this is the best mention i've found of something similar. It seems to

How to safetly export all IIS settings from one server to another?

前提是你 提交于 2019-12-05 00:39:45
问题 I am trying to build a virtual machine that clones one of the servers used in production instances of our webapp so that we can do deployment testing on it. I have gotten all the necessary files over, IIS installed, the database up and running. To my eye all that remains is to copy all the IIS settings from a production environment to the virtual machine. In the past I have in similar situations simply backed up the metabase, found the file, moved it to the new machine, and restored. This is

How do you maximize server performance?

佐手、 提交于 2019-12-05 00:05:29
问题 I have been trying to get my head around to understanding performance and scalability and would like to know what developers/sysadmins are doing to juice their systems. To standardize the answers, it would help if you could take your best shot at responding to any of the following: Profile - Magazine publication on Joomla; Jobs board on CodeIgniter + OpenId + AJAX Performance - Maximum requests per second per server ? Hardware - Server, router, disk, LAN? Software - Lighttpd, Memcache,