- Published:
- February 21, 2011 – 10:35 pm
- Author:
- By Dave
I’ve been busy lately on a number of projects, one of which is a programming class I am currently taking. The class itself is interesting, we are learning about the different types of programming languages. For our latest project, we were tasked with writing a simple program in Pascal. Pascal isn’t used too much any more since it lacks some of the features that most modern languages have, but it is good to know at least a little bit about it in case you ever run across some old Pascal programs in the wild. The syntax for pascal is a bit verbose, that is the main complaint about it. There are a number of others, but that is beyond the scope of this howto. Installing The Pascal Compiler on Ubuntu Installing Pascal in modern Ubuntu is a cinch. The Free Pascal Compiler, or fpc, is all that you need to….
Categories: Code Samples,Other Code,Ubuntu
Tagged: pascal, programming, Ubuntu
- Published:
- September 29, 2009 – 5:00 pm
- Author:
- By Dave
I was recently tasked with copying speaker’s presentations, files and handouts onto 100s of USB Drives (key drives) for a conference that work is hosting down in Washington, D.C. My first thought was that it was going to be a pain to have to copy/paste the files to each drive. I thought about creating a batch script to copy the files with a double click. But really, who wants to be doing all of that clicking and/or typing? Work smarter, not harder. Then I remembered a neat feature that SyncBackSE, a program I use at home for backups, has available. The backup program – which is basically a file copy process – can be triggered based on the insert of a drive, whether that be a USB Key Drive or an External Hard Drive. Using the program, the only action you need to do to trigger the copy process is….
Categories: Hardware,Other Code,Programs
Tagged: conference, key drive, tips, tricks, usb drive, usb key drive
- Published:
- August 5, 2009 – 9:16 pm
- Author:
- By Dave
You’ve flashed your old WRT54G or other vanilla router with the Tomato firmware. This itself turns your router into a lean, mean routing machine with QOS, SSH and more, but let’s say we want to take it a bit further. What it we want to get some more stats out of it? In order to do this, we first need to set up a way to pull this information from the router. The best way to do this is to install an SNMP (Simple Network Management Protocol) daemon on the system. The main roadblock we face here is that the system mainly runs in volatile system memory, meaning that every time the system is rebooted the filesystem is reset. Fortunately Tomato provides a way to get around this using CIFS shares. Follow the steps below (as modified from here) to install an SNMP server on a Tomato router. Create a….
Categories: Code Samples,Configurations,Hardware,Linux,Other Code,Other Technology,Programs,Shell,Software,System Administration
Tagged: cacti, firmware, network, router, SNMP, sysadmin
- Published:
- May 6, 2009 – 11:10 pm
- Author:
- By Dave
I recently came across a typo that existed in a bunch of html files on my web server. I thought it should be easy enough to change, but since it was in a number of files, editing it by hand would be time consuming. Fortunately, there is an easy, one liner command to replace the text in multiple files in a sub directory using recursion. grep -lr -e ‘<oldword>’ * | xargs sed -i ‘s/<oldword>/<newword>/g’ This command broken down: grep for the word in a files, use recursion (to find files in sub directories), and list only file matches | xargs passes the results from the grep command to sed sed -i uses a regular expression (regex) to evaluate the change: s (search) / search word / target word / g (global replace) For more information, see man pages for grep, sed, and xarg. Also it is very handy to….
Categories: CentOS,Other Code,Shell,System Administration,Ubuntu
Tagged: command line, Linux, tips
- Published:
- May 5, 2009 – 6:51 am
- Author:
- By Dave
Came across this little maddening issue again today after fixing it a few months back. I created a directory that is password protected using a .htaccess file. However, when trying to access this folder or anything under this directory, a File Not Found 404 error from WordPress is displayed before it even prompts you for the password. The problem here lays within the main WordPress .htaccess file The default .htaccess file for WordPress is: 123456789# BEGIN wordpress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END wordpress This means that if a file is requested from the server, if it is not a file that exists in the server’s folder directory (!-f) and if it is not a directory that exists in the server’s folder directories (!-d) then pass the request onto index.php. This way, WordPress will handle both customized….
Categories: Code Samples,Configurations,Other Code,Software,System Administration
Tagged: 404, apache, htaccess, password, wordpress
- Published:
- November 1, 2008 – 9:56 pm
- Author:
- By Dave
If you are running Apache for your web server, and mod_rewrite is installed (this is a pretty typicaly module on all installations) this is actually pretty easy. RewriteEngine on RewriteCond %{HTTP_HOST} ^subdomain\.yourdomain\.com RewriteRule ^(.*)$ http://www\.yourdomain\.com/subdomain/$1 [L] Add this code to your apache configuration file – the easiest location is in the .htaccess file in your root web directory. This should redirect the browser with a 302 Found message. You can do some pretty fancy things with mod_rewrite, but this is simple and gets the job done!
Categories: Code Samples,Linux,Other Code,Software
Tagged: apache, mod_rewrite, web server
- Published:
- September 2, 2008 – 9:04 am
- Author:
- By Dave
For many people using hosted Exchange services, password saving problems could plague you. That is mainly because Outlook doesn’t like it if the Exchange server’s domain doesn’t match your domain. Fortunately there is a way around this, because by the default way it is set up, you would have to enter your password every time you open up Outlook. First step is to change the registry key: 1HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa Change lmcompatibilitylevel to “2″ Here is the meanings of these numbers (source): 0 – Clients use LM and NTLM authentication, but they never use NTLMv2 session security. Domain controllers accept LM, NTLM, and NTLMv2 authentication. 1 – Clients use LM and NTLM authentication, and they use NTLMv2 session security if the server supports it. Domain controllers accept LM, NTLM, and NTLMv2 authentication. 2 – Clients use only NTLM authentication, and they use NTLMv2 session security if the server supports it. Domain controller….
Categories: Code Samples,Configurations,Email,Other Code,Software
Tagged: exchange, hosted exchange, outlook, passwords, Windows