sysadmin

Tar error: Unexpected EOF in archive

强颜欢笑 提交于 2019-12-04 17:13:54
问题 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? 回答1: Interesting. I have a few questions which may point out the problem. 1/ Are you untarring on the same platform as you're tarring on? They may be different versions of tar (e.g., GNU and old-unix)? If they're different

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

我与影子孤独终老i 提交于 2019-12-04 14:09:19
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', 'username' => 'username', 'password' => 'password', 'charset' => 'utf8', 'prefix' => '', ), I've also

How to handle new files to process in cron job

岁酱吖の 提交于 2019-12-04 13:40: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 processing. The script is running every 10 minutes and processes ~5 files per run, since is scanning the

Which Linux distribution should I use as a Xen host? [closed]

雨燕双飞 提交于 2019-12-04 09:13:18
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I ordered a server for the home office and I would like to partition it with Xen. I think this will keep things clean and easier to maintain. I will be running things like MySQL, PostgreSQL, Tomcat, and my own code. What freely available Linux distribution has the best Xen

Best way to sandbox Apache on Linux

安稳与你 提交于 2019-12-04 07:51:48
问题 I have Apache running on a public-facing Debian server, and am a bit worried about the security of the installation. This is a machine that hosts several free-time hobby projects, so none of us who use the machine really have the time to constantly watch for upstream patches, stay aware of security issues, etc. But I would like to keep the bad guys out, or if they get in, keep them in a sandbox. So what's the best, easy to set up, easy to maintain solution here? Is it easy to set up a user

Locate the nginx.conf file my nginx is actually using

旧城冷巷雨未停 提交于 2019-12-04 07:46:09
问题 Working on a client's server where there are two different versions of nginx installed. I think one of them was installed with the brew package manager (its an osx box) and the other seems to have been compiled and installed with the nginx packaged Makefile. I searched for all of the nginx.conf files on the server, but none of these files define the parameters that nginx is actually using when I start it on the server. Where is the nginx.conf file that I'm unaware of? 回答1: Running nginx -t

Linux-based solution for domain management?

喜欢而已 提交于 2019-12-03 17:16:34
Using any member of the Windows Server family, I can set up an active directory, and have a single pool of users for a large scale of computers; access can be given / removed for any shared resources in the given domain (including access to client computers, etc). What similar (and widespread) solutions exist for managing a multi-user, multi-computer environment using Linux? What are their advantages/disadvantages? And how can they interoperate with Windows? Not sure if this is what you had in mind, but Linux w/Samba can act as a domain controller for Windows desktops. For example, see SAMBA

PowerShell Script to Get a Directory Total Size

不问归期 提交于 2019-12-03 16:36:50
问题 I need to get the size of a directory, recursively. I have to do this every month so I want to make a PowerShell script to do it. How can I do it? 回答1: Try the following function Get-DirectorySize() { param ([string]$root = $(resolve-path .)) gci -re $root | ?{ -not $_.PSIsContainer } | measure-object -sum -property Length } This actually produces a bit of a summary object which will include the Count of items. You can just grab the Sum property though and that will be the sum of the lengths

How do you maximize server performance?

≡放荡痞女 提交于 2019-12-03 15:21:30
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, Varnish, Nginx, Squid, Pound, LVS, eAccelerator, etc. Services - Amazon S3, Akamai, Google compute, etc.

Windows Mobile - What scripting platforms are available?

一曲冷凌霜 提交于 2019-12-03 13:34:18
问题 We have a number of users with Windows Mobile 6 and need to apply minor changes. eg. update a registry setting. One option is push and execute an executable file using our device management software. I'd like this to be a little more friendly for the admins who are familiar with scripting in VBScript/JScript etc. What are the options for scripting on Windows Mobile devices? 回答1: Once option that the devs over at xda-developers seem to enjoy is Mortscript I have never bothered to use it, but I