Thursday, February 14, 2013

Update to Apache proxy forwarding

Further notes for allowing proxy forwarding for virtual hosts using different IP aliases tied to the same address.

Install the following package on Ubuntu:
sudo apt-get install libapache2-mod-proxy-html
 In the /etc/apache2/mods-enabled, add the following symbolic links:
$ sudo ln -s ../mods-available/proxy.conf proxy.conf
$ sudo ln -s ../mods-available/proxy_http.load proxy_http.load
$ sudo ln -s ../mods-available/proxy.load proxy.load
In the /etc/apache2/mods-available, edit the mod_proxy:
  • Uncomment the <Proxy *>  and the </Proxy> tags and add "Allow from all" within the tags
 For situations where you need to proxy into an alternate port (e.g. 8080 for web), set up the /etc/apache2/sites-available/default file to handle it:
 <VirtualHost *:80>
            Servername guest.company.com
            ProxyPass / http://quest.company.com:8080/
            ProxyPassReverse / http://guest.company.com:8080/
 </VirtualHost>

Friday, March 04, 2011

Monitoring PF Firewall

Again, a note to self:

To follow a pf log similar to a 'tail -f', use "tcpdump -vv -i pflog0"

Tuesday, August 24, 2010

Flashing BIOS without a floppy

One of my pet peeves in computers is the continued reliance of hardware makers to create updates, like BIOS, that are designed to be used with floppy disk drives, despite the fact that a lot of the updates are now larger than the 1.44MB that a traditional floppy disk could hold. For almost ten years, USB ports have been standard on systems and it is as difficult to find a new system without USB ports as it is to find one with a floppy drive (although you can buy external floppy drives that plug in through USB).

To complicate things even more, there is not a standard for writing files to USB or CDs for use in flashing hardware devices. As a person who works on servers a lot, this is a real pain!

However, I finally found a link that is fairly easy to use to make a USB drive into a bootable DOS drive that files can be written and deleted from: http://www.sevenforums.com/tutorials/46707-ms-dos-bootable-flash-drive-create.html

So hopefully, I'll remember this the next time I have to do a flash! :)

Friday, May 14, 2010

Lemmings - to the sea!

I find it amusing the near hysteria being reported over the past couple of weeks over people quitting Facebook, invoking "mass Facebook 'suicide' pacts", the mirror of a couple of years ago when everyone was jumping on the Facebook bandwagon. The reality is that in any online social media site - including Twitter & Flickr - user information can be used, either directly or indirectly by the site owners or by people hacking the sites.

People, especially those who have grown up with the internet, forget that what goes on the internet can stay on the internet a long, long time. Furthermore, database mining tools are very powerful in the hands of people that know how to use them. However people, to wave your hands in panic is not only disingenuous, it shows the vast ignorance of what the computers do best - store and sort data.

While the actions of Facebook over the past few years are deplorable in the sense of sacrificing their customer's privacy and trust for a quick buck, most people should be smacked for not taking proper precautions in the first place. If you don't want people to know certain information, don't put it on the internet, or at least control what information is being released. An easy fix for email accounts is to create a junk email account on Hotmail, Yahoo, Google or whatever and use that as a way of screening who gets to email you.

People - take some personal responsibility here! Facebook is just a communication tool!

Monday, March 08, 2010

Moving from Ubuntu to openSUSE

Been several months since I've posted, but I've been distracted. Anyway, started using openSUSE-11.2 yesterday as I've been having problems with Ubuntu 9.04 and 9.10. I've been having issues with using wireless on 9.04 (I've got a wireless NIC that isn't supported on 9.04), but there are known problems with software RAIDs on 9.10, and from what I've been reading, will continue to be in the upcoming 10.4. Disappointing, as I've grown to love working on Ubuntu. But maybe time for something new....

So after downloading an ISO that requires a DVD (another thing to like about Ubuntu - you only need a CD to install), I was somewhat underwhelmed by the install experience. There were several bugs that occurred, including putting the GRUB boot loaded in the wrong portion of the hard-drive (you aren't given an option during the initial install). Also, you can only choose KDE or Gnome for the desktop and must install the other after logging into the new system. On the other hand, it installed itself on the RAID with no issue and connected to the wireless network easily once I entered the required info.

Despite some amazing upgrades to desktop environment in KDE 4, I still prefer Gnome. I find that KDE looks less polished and tries too much to be similar to the look and feel of Windows. Conversely, Gnome looks more unique and sophisticated. Also I generally like Gnome's applications better. The bad thing is in SUSE, the menu is too complex to easily open up and quickly find an application to launch - rather you must open a full page menu that takes up most of the screen and then search for it. Ubuntu's menu system is more simple and I find more functional.

First impressions are that openSUSE will be fine once I adjust to it. I must admit - I much prefer the green themes that openSUSE uses as compared to the nauseating oranges and browns that Ubuntu has traditionally gone for!

Monday, August 10, 2009

Apache2 configuration for VMWare Server 2

I've extracted this from my notes on setting up Apache2 to allow multiple IP aliases on a single IP address to point to multiple virtual machines. Mostly this post is to allow me fast access for setting up other machines.

Background info - this is setup on Ubuntu 9.04, using VMWare Server 2 and Apache2. For VMWare, I'm using bridged networking and ignoring VMWare's NAT networking capabilities (I found that it was very poorly documented to configure it easily). Basically, the host machine redirects all incoming port 80 traffic to the the Apache web server, which then gets split depending on the ip alias it is using. All modern web browsers (i.e. pretty much anything that came out in the past several years) will view the web sites correctly - old browsers do not send the alias, so will only see the first machine listed.

Make sure proxy packages are installed and enabled:
/etc/apache2/mods-available
/etc/apache2/mods-enabled (symbolic links to files in /etc/apache2/mods-available)

Packages Needed: proxy.conf, proxy_html.conf, proxy_html.load,proxy_http.load, proxy.load

Edit /etc/apache2/mods-available/proxy.conf from “Deny from all” to “Allow from all”

In /etc/apache2/sites-available/, copy “default” to “default.bak”, then edit “default” to be set up for the proxy:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName vbox1.hostname.com
ProxyPass / http://192.168.1.150/
ProxyPassReverse / http://192.168.1.150/
</virtualhost>

<VirtualHost *:80>
ServerName vbox2.
hostname.com
ProxyPass / http://192.168.1.151/
ProxyPassReverse / http://192.168.1.151/
</virtualhost>

<VirtualHost *:80>
ServerName vbox3.
hostname.com
ProxyPass / http://192.168.1.152/
ProxyPassReverse / http://192.168.1.152/
</virtualhost>
Note the slash after the virtual internal ip address – it is needed!

Restart Apache2 (/etc/init.d/apache2 restart)

Reference websites/blogs/forumns:
http://www.livingubuntu.com/?p=77
http://www.apachetutor.org/admin/reverseproxies
http://ubuntuforums.org/showthread.php?t=358687
http://serendipity.ruwenzori.net/index.php/2006/12/24/proxy-no-protocol-handler-was-valid-for-the-url
http://ubuntuforums.org/showthread.php?p=1852061#post1852061
http://httpd.apache.org/docs/2.0/vhosts/name-based.html

Tuesday, April 14, 2009

MS manages to screw up (Again!)

I'm learning how to use Microsoft's relatively new data interface called LINQ, which is designed to allow developers to treat different data types (like XML files, and databases) and data queries (such as SQL queries) as objects. This in theory allows the developer to be able to debug data queries at compile time have better knowledge of what is happening during runtime.

The problem is that Microsoft forgot that a lot of web application development uses its SQL Server db as a backend. Now, SQL Server is a mature product and the basic data types that it incorporates have not changed for a significant time.

The problem I've been happening deals with integers:
  • tinyint (8-bit) - 0 - 255
  • smallint (16-bit) -2^15 (-32,768) to 2^15-1 (32,767)
  • int (32-bit) - -2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647)
I use the tinyint for lookup tables where there will be a very limited number of items. In this case, it was a table for status, which currently has two items, active and inactive.

Now, for LINQ, you can manually define your tables as a class. So, my status table looked like this:

[Table(Name = "Status")]
public class t_Status
{
[Column(IsPrimaryKey = true)]
public int statusID;

[Column]
public string type;

private EntitySet _staLU;
[Association(Storage = "_staLU", OtherKey = "statusID")]
public EntitySet StatLU
{
get { return this._staLU; }
set { this._staLU.Assign(value); }
}
}

So when I try to use this I get a "specified cast is not valid". After some searching on Google, I find that LINQ doesnt automatically convert between the various int types. I can understand this from a big to small perspective - you would not want to lose digits/accuracy. But for small to big? It should be able to automatically figure that out in the background.

Further annoyance was found when I discovered I can't even easily assign the tinyint as a proper type in C# - I can with smallint by using public int16 statusID; but that means effectively I have to use a less efficient (memory wise), larger type in my database to be able to use LINQ.

It seems to me that Microsoft should have thought this through - DBAs are not going to be happy having to redesign databases to accomodate this miss.