At the office, we’re in the process of doing some work where we need a tomcat server. Without having to get into things to much, I found this simple method for getting tomcat5 up and running pretty quickly. I’m sure I’ve left out some important things, and I’m doubtful as to how production ready this is, but for our testing, it’s working out fine.
I’m using CentOS 5.3 for all of this, but I’m sure it will work with CentOS 5.4
yum install tomcat5 tomcat5-admin-webapps tomcat5-webapps
After this, you need to edit the tomcat-users.xml file to create a new user.Using the above, this file ends up in /etc/tomcat5/tomcat5-users.xml and all that needs to be added is a line similar to the following..
user username="admin" password="p@ssw0rd" roles="admin,manager"
I can’t get wordpress to work with me on this, so you’ll need to wrap the above in angle brackets, the same as all the other lines in that file.
You can set username and password to whatever you’d like. After this, restart tomcat (not sure if this is needed) with service tomcat5 restart and off you go.
Quick and simple way of burning an ISO image from the command line in Linux. First, find your devices with wodim, the use the cdrecord command to burn the ISO image.
$ wodim --devices wodim: Overview of accessible drives (1 found) : ------------------------------------------------------------------------- 0 dev='/dev/scd0' rwrw-- : 'LITE-ON' 'DVDRW LH-20A1P' ------------------------------------------------------------------------- $ cdrecord -v dev='/dev/scd0' Download/archlinux-2009.08-netinstall-i686.iso
Then, you’re done.
The instructions floating around are to place the --incognito switch (single – works fine for me) in your desktop shortcut. But sometimes you may be in an application like Tweek Deck, etc that links to webpages. These pages don’t launch in incognito if you only fix your desktop shortcut. Here is how to do both. Google Chrome is set as the default browser in this case.
(These instructions are based off of Windows XP)
Right-click on your Chrome shortcut. Choose Properties. Add -incognito to the end:
chrome.exe" --incognito
To launch all web shortcuts and links from your system:
Control Panel > Folder Options > File Types
Select the File Type URL:HyperText Transfer Protocol and choose Advanced
Select action open and edit.
Just like before add the switch to the end like this:
chrome.exe" --incognito -- "%1"
Edit: After more digging in Google I found this tip mentioned in Google Code Chromium issues (Comment 3).
I decided to try and use NIC bonding in OpenFiler and while things seemed to go well at first, I did run into some issues over time. I’m still in the process of testing, and I think most of the issues are “user error” and not so much problems with NIC bonding or OpenFiler itself. More on that later.
I was able to configure a bonded interface, and add both interfaces to it. However, after the issues started, I wanted to remove the bond. There is no way of doing this from within the Web UI it seems. Easiest solution, login to the console, and delete /etc/sysconfig/network-scripts/ifcfg-bond0 if you’re using the first bond interface.
After this file is deleted, service network restart should get you going again.
How to search all files for a text string:
grep -lr string ./ > results.txt
-l will print only the path and file names of the matches.
Search all files of a certain name for a certain string:
grep -lr string ./ | grep filename
Yes, do specify ./ if you are doing all directories within current.
Find an replace a string in files:
Searching for a way to do this usually leads me to finding fancy scripts that don’t work right, are scary (create temp files, etc) or aren’t recursive. Just have backups at hand and test the following combination of find and sed before unleashing it, because it works great! You can test it by replacing sed with grep
find ./ -type f -exec sed -i ’s/string1/string2/’ {} \;
Within specific file names/extentions…
find ./ -iname \*.htm\* -exec sed -i 's/\-2005/\-2007/g' {} \;
Don’t forget to use escape \ as seen above. And if your strings contain forward slash / just use a different delimiter such as pipe | or escape it.
You can also install rpl, as shown in the source pdf, for even cleaner line of code for executing your find and replace.
(source and more info) A nice pdf to keep by your side.
This is not going to be a full review, but more a general take on things.
Since moving from VMware Server to ESXi to host my virtual machines, I’ve been very interested in looking into some more of the advanced features of ESX and ESXi yet most of these require iSCSI. I remember from a few years back using Openfiler to do some simple samba file sharing, and remembered it supported iSCSI as one method of giving out storage.
Now, I’ve yet to use any of the features of ESX that require iSCSI, or even setup Openfiler to export storage via iSCSI, but I have been using it for simple file sharing and must say I’m quite impressed.
Setup is a breeze, taking about 20 minutes on an older PC. Management is done almost entirely through a web interface, that is very easy to use. Unlink many of the other appliance packages out there, the web interface is very simple and straight forward. Very much impressed with that.
Over the next few months I’ll be exploring Openfiler much more, and hopefully getting into some of it’s more advanced features including interface bonding, md devices and clustering. I plan to keep updating as things more along.
I’ve been using dropbox to sync and share files between my various computers for quite some time, and overall have been very pleased. However, one area things are not so great… documentation for installation on Linux. After having to reinstall on my notebook, I decided to somewhat document the hidden part of the process.
After downloading the .deb (or other package) and installing, dropbox instructions leave you hanging. There is no dropbox folder, there is no daemon running, nothing. The next step is simply to run dropbox start -i to install the daemon and launch the process to move forward. It’s simple, easy and poorly documented. Maybe dropbox should add this to the end of their install instructions?
This years OhioLinux Fest starts tomorrow and runs until Sunday. I’ll be there. You should to. More info at the OhioLinux website
During some network changes I’ve found the need to modify the routing table.
To change the default route on Windows XP (and possibly Windows Vista, 2000, etc) you use the route command. The syntax is pretty simple, here is a quick example….
route change 0.0.0.0 mask 0.0.0.0 172.18.12.120
To delete or add routes, simply change the keyword change to either add or delete.
route add 192.168.0.0 mask 255.255.255.0 10.10.0.50
If you’ve ever wanted to check on the status of your Ethernet links, you’ve probably used the ip commands (or ifconfig) to view some basic information. However, you might have noticed these commands do not tell you what the current link speed is, or other possibly important details. That’s where ethtool comes in.
[jonmoore@megaton ~]$ sudo ethtool eth0 Settings for eth0: Supported ports: [ MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: MII PHYAD: 1 Transceiver: external Auto-negotiation: on Supports Wake-on: g Wake-on: d Link detected: yes
As you can see, ethtool will show you the support modes, as well as the current mode. From the above example, I’m currently connected at 1000Mb/s at Full Duplex. Very nice.
Check out the ethtool man page for more useful commands.
