mobile logo

Quick Tip There are 10 posts in this category

10

If you're receiving an error message such as: Safari can’t open the page “https://example.com”. The error was: “client certificate rejected” (NSURLErrorDomain:-1205) Please choose Report Bug to Apple from the Safari menu, note the error number, and describe what you did before you saw this message. It's likely because the web server you are connecting to has Apache configured for "SSLVerifyClient optional". It appears that with Safari 5 (or perhaps even earlier) the browser will negotiate client certificates improperly with the web server. While other browsers like Google Chrome and Firefox will not have an issue, Safari is rendered incapable …

Read More

Early in my career, I was writing a shell script and needed to print a line-number for each line in a text file. I ended up coming up with some function that did just what I needed. I don’t recall the exact method, but it was something like: [code]cat file | while read line do lno=$[${lno:=0}+1] echo $lno $line done [/code] I was quite happy with the solution, until I realized that I could have just run ‘cat -n file’. A few takeaways: - A better solution already exists, keep looking. - The more you learn, the more you realize how little …

Read More

A problem that Puppet administrators have likely noticed when deploying its built-in Nagios functionality (called Naginator) is that creating configuration is very easy but 'cleaning' old configuration isn't as straight-forward. If you are like me, you'd delete the affected file(s) that had cruft and let Puppet re-build the service configuration without the old services or hosts. This is both a tedious and terrible practice but out of the box it seems like "the way to do it". Having tired of the problem I was able to find out a proper way to handle the situation. If you add the following block …

Read More

When searching for information on creating an empty, or null rpm file, I was unable to locate the spec file details needed. In another post, I will describe my need for this empty rpm, but for now here is the minimal spec file needed to build an empty rpm: Place the following in a file called, php.spec Summary: Empty PHP Name: php Version: 0 Release: 0 License: Public Group: Applications/System %description Empty PHP RPM %files Now, build your new php rpm using the following command: # rpmbuild -bb php.spec Processing files: php-0-0 Checking for unpackaged file(s): /usr/lib/rpm/check-files %{buildroot} Wrote: /usr/src/redhat/RPMS/i386/php-0-0.i386.rpm And that's it, you now have an empty rpm!

Read More

Every week at MNX solutions we handle issues from server security and patch management to system recovery and performance tuning. In this blog series, we will review a number of firewall best practices that you can implement today on your server infrastructure. First things first, do you utilize a firewall on your server? If your answer is "no" or you are not sure, this should be one of your top priorities. You have two major choices for a firewall: hardware or software. A quick note on hardware vs. software firewalls Hardware firewalls can protect every machine on a local network (on the inside or DMZ …

Read More

bash_history date

0 Comments

Bash_history date Ever try to determine what caused the latest outage by trying to determined when a command was last executed? Look in your .bash_history (if you are running a bash shell), and you will see your recently executed commands. However, it is generally impossible to tell when the command was executed. Part of our job includes figuring out how a problem occurred, and then implementing solutions to prevent this problem from happening again. By using HISTTIMEFORMAT with bash, we can enable timestamps in the history command, allowing for much better auditing and correlation of problems. Below is example output of …

Read More

LOCK TABLES and SELECT are the minimal requirements to use 'mysqldump'. You can use the following grant statement to create a user with as little privileges as possible: GRANT LOCK TABLES, SELECT ON mydatabase.* TO 'backup'@'hostname' IDENTIFIED BY 'p4sswOrd';

Read More

When working with CUPS using remote print queues, you may find that the remote printer is not always available, has timed out, ran out of paper, has a paper jam, etc. Sometimes this causes a job to 'not-complete' and when running 'lpstat -o', you see old print jobs. We put together a quick script to auto-purge these jobs.  Hopefully this helps someone in the future. Please let us know if you found this useful, or if you have any suggested changes. #!/usr/bin/python # # Purge print jobs that are not-complete and older than 10 days. # from datetime import date, timedelta, datetime import time import os howmanydaysago=10 today=date.today() daysago=today-timedelta(days=howmanydaysago) epoch_today=time.mktime(today.timetuple()) epoch_daysago=time.mktime(daysago.timetuple()) date_difference=epoch_today-epoch_daysago for line in os.popen('/usr/bin/lpstat …

Read More

We ran into an issue where an init script was missing and we needed to restore the file.  The backup (of course) did not include the file we needed.  We had to download the package, extract the contents, and move the init script back into place.  Below are the commands used: DEB: $ dpkg-deb -x <package.deb> /restore/dir RPM: $ rpm2cpio <package.rpm> | cpio -idv

Read More

You can display the current root password for mysql (if the host is running ensim), by using the following command. # ensim-python -c "import sys;sys.path.append("/usr/lib/opcenter/mysql");import mysqlbe;print mysqlbe.read_mysqlpass()"

Read More
PAGE 1 OF 2