Home

Gallery

Archives

Blog

About

Contact Me

"Personal thoughts, ramblings, and nonsense from Drew, himself."

Splunk Free: .htaccess Protection using Apache

You ever hear of Splunk? Splunk enables you to search and navigate all your logs and IT data in real time; logs, configurations, messages, traps and alerts, scripts and metrics. It’s an awesome tool to make it easier to monitor and watch your log files. Unfortunately, Splunk is expensive. How expensive? Try $5000 a year, for the cheapest license. Here’s the main problem; the free version of Splunk does not come with any user authentication, not even Admin authentication. This means that anyone can access your Admin area of Splunk, and can see any log files you have and can even set up new Splunks (log file watches). Let’s fix this!

I would have thought that a standard feature of Splunk would be at least Admin user authentication, but you can only get that with the professional version of Splunk. You have 30 days of the Professional version of Splunk, and then you must purchase the license after that. So, most individuals that just want to manage their log files remotely via the web, cannot afford and should not even purchase a Professional license, so the Free version is perfect. The lack of authentication kind of makes you turn your nose to Splunk, as this posses a security issue. Note one thing, when I say authentication, I mean username and password. You literally can access all admin features, including license information, just by going to the web address (which is usually a domain name on the default port 8000, e.g. http://domain.com:8000). This is totally rediculous. We can get around this by running a proxy within Apache and secure the subdomain (http://splunk.example.com/) with a .htaccess file. Continue reading Splunk Free: .htaccess Protection using Apache

Clearing (but not deleting) log files

Sometimes, as a Systems Administrator, or SysAdmin, there are times we need to clear out the log files, without actually deleting them. As a smart Sys Admin, you normally wouldn’t need to do this, but as I am currently involved in supporting customers and their Linux machines, I run into some pretty neat stuff (neat as in special). I’ve had a few issues where someone actually runs out of disk space on / (root filesystem) due to the /var/log directory being full.

First off, you might run the df command only to realize that, maybe, you have used 97% of the partition up, in this case / (root filesystem). More times than not, this is usually due to your /var/log directory. Make sure though, I’m presuming that you already know that your /var/log directory is full. To find out what is taking up the most space (you should already know why, and thus you are viewing this possibly because you are having issues with a full filesystem), you would need to run the df command. Continue reading Clearing (but not deleting) log files

Curing ‘Symbolic link not allowed’ (Apache 2.0)

Awhile back when trying to add a directory to Apache on my Ubuntu 6.06 LTS server, I ran into some issues. These issues, of course were the infamous 403 “Forbidden” error that your web barfs up when you try to access a server that is not publicly viewable, because of permission issues. I’m going to give you my scenario and explain how you can fix this issue, so that you don’t have to go through an hour of throwing your hands up in disgust. Continue reading Curing ‘Symbolic link not allowed’ (Apache 2.0)

VMWare: “Failed to create named-pipe directory” error

Have you ever received the Failed to create named-pipe directory error message via the vmware-mui error log files, and not able to access the VMWare Management Interface? If so, here’s the fix. Continue reading VMWare: “Failed to create named-pipe directory” error

Stepping Into Samba

A few friends of mine stare at me blankly when I mention Samba and SMB. In fact, sometimes they think it’s the same thing, when in fact, it’s not. I’ll talk about the differences between the two and walk you through setting up Samba networked shares. This will give you a nice introduction to Samba and also Linux, if you are not familiar with that, also.

The real question here isn’t why SMB, or why Samba for that matter? Well, first off, after I explain to you what SMB is and then explain what Samba is, you’ll see that this question I just asked was mildly stupid. The actual question here is “Why create network shares in the first place?”. This is a very basic, honest question, but it tends to turn a few heads. I’ll give you a scenario. You have 5 computers in the house; your laptop, your desktop, the kids have two computers, and your wife has her school laptop. So, your wife has school work and her latest favorite songs on her laptop, the kids have theirs, and you have all your applications and whatnot all on your laptop and desktop. What might seem like not that much data, turns into gigs of data. You have tons of music, school reports and research, ISOs and applications, Development related stuff, pictures from the past four years. You notice you are running out of space on your kid’s computers and you wife’s laptop is running a little sluggish. Now, this is probably highly due to the games and occasional pop ups that are clicked, but hey, why take up space on the systems, when everything can be centralized? Yes, that’s the word - Centralized. Continue reading Stepping Into Samba

/bin/rm: Argument list too long

Currently, I work as a Datacenter Technician at The Planet. I had a customer ask me how to, one time, delete all the mail in his /home/[account-name]/mail/cur directory.

So, first off, I wanted him to just take a look at that directory, get to know it (figuratively speaking). So I had him run the du command on it; wow, you wouldn’t imaging how much mail was in there!

The actual command I had him run was:

BASH

cd /home/[account-name]/mail/cur
du -h ./

The output was 1.3GB. Yes, that’s right, he had 1.3GB of mail files. Some people are unaware of what exactly the difference is between the /new directory and the /cur. The difference is simply that the /cur directory is full of email messages that the user has already viewed somehow, whether by webmail, Outlook, Thunderbird, etc, they have viewed it, and the mail is now officially not exactly new. The /new directory is a directory that has mail that has not yet been opened by the user yet.

So, the customer asked me a simple question, “How do I go about just deleting this data?”. From a user’s point of view, the command would be:

BASH

cd /home/[account-name]/mail/cur
rm -r ./*

Then the customer would have received the error: /bin/rm: Argument list too long. I have found a workaround though. I have asked a few people around what they use the find command for. All of there answers where pretty much the same, “They help you find files”. That’s all they could really tell me what find does. This isn’t all true. find can help us defeat the /bin/rm: Argument list too long error. So, I had the customer run the following:

BASH

cd /home/[account-name]/mail/cur
find . -name '11*' -exec rm "{}" \;

It worked for him, and it can work for you. Let me dissect this command real quick for you, so that you aren’t completely lost. find is the actual command, followed by a period; this means you are going to be searching the current directory (at this time /home/[account-name]/mail/cur). Next you supply the -name switch to tell the find command that you want the pattern (coming next) to match the name of the file. You then give it a search pattern, and in this case all his files started with eleven (11) and everything after that was different, so the pattern would be 11*; make sure the search pattern is in single quotes. Next you supply the -exec command, which will execute any Linux command you want (as long as it is installed on your system). In this case we used the rm command. The quoted curly braces tell it to run rm on each file that matches the pattern supplied. That’s it. Simple command turns to be a very helpful utility.

Hope this helps someone in the future, as I had to figure it out on my own.

How-To: Password Protect Apache Directories with .htaccess

Have you ever wanted to let someone download a file or image from your website, but didn’t want to have the whole world know about, such as Google’s great search engine spiders? The robot.txt file only goes so far, personally I’d rather password protect my directories if I don’t want them crawled. It’s a great way to set up realms that only the privileged few know about. I’ll walk you through the very simple steps of doing so, and showing you what gets added on the server side. Continue reading How-To: Password Protect Apache Directories with .htaccess

Finally, a job.

IBMWell last week, I finally got the call that IBM was looking for someone that could do Advanced Support in their AIX department, and they had accepted me as an employee. Great! Finally, a job. It’s not just a job, though, this could be my steping-stop; something to really get me in the door and make something of my life. I have plans for many things in life, but they all lead to one thing, success. Success is the key that unlocks every door to whom I become. So, where am I getting with this? Continue reading Finally, a job.

Understanding CHMOD and Creating permissions without a calculator

chmod
CHMOD (chmod) is a UNIX oriented command that means “Changing Mode”, that let’s you change the mode (hence the name) of the file, or directory(s) depending on how the chmod command is used. When I say “changing mode”, I mean giving the file a different permission scheme, respectively read, write, and execute. This command, by the way, is one of the most useful and most used commands in Linux (among many others). Continue reading Understanding CHMOD and Creating permissions without a calculator

The Notebook

Windows Fix: "Insufficient system resources exist to complete the API"
Ugh. Another Windows error. Another Windows error that really doesn’t tell you what is really wrong; some (most) people aren’t nerds. Don’t worry, I’ve got your fix right here. This has to do with memory on your Windows XP system. Have you tried Hibernating or putting your system into standby after upgrading your RAM? If you have, keep on reading. More...

Curing 'Symbolic link not allowed' (Apache 2.0)
Awhile back when trying to add a directory to Apache on my Ubuntu 6.06 LTS server, I ran into some issues. These issues, of course were the infamous 403 “Forbidden” error that your web barfs up when you try to access a server that is not publicly viewable, because of permission issues. I’m going to give you my scenario and explain how you can fix this issue, so that you don’t have to go through an hour of throwing your hands up in disgust. More...

VMWare: "Failed to create named-pipe directory" error
Have you ever received the Failed to create named-pipe directory error message via the vmware-mui error log files, and not able to access the VMWare Management Interface? If so, here’s the fix. More...

/bin/rm: Argument list too long
Removing gigs and gigs, or just alot, of unwanted “opened” email that often clutters the system. More...