jEdit Under OSX – remapping the alt key

jEdit is one of the best cross browser text editors I’ve come across. The plethora of plugins and customization makes it one of the most indispensable tools I’ve used for programming. There’s only one problem. Under OSX it does not recognize the ALT key like other oses do. Solution: remap it. And because jEdit is so customizable it’s a very simple task.

First the ALT key needs to be enabled. Do this in the startup.bsh file located in:

Uncomment the following lines:

Also note the order is changed to make the ALT key actually fire the A+ event.

Migrating a RedHat users file to FreeBSD/OpenBSD

First, figure out if your Linux password file is shadowed or not. If it is, install John the Ripper from packages or ports (security/john) and use the unshadow utility that comes with it to merge your passwd and shadow files into one Sixth Edition-style file.

Using your Linux password file, we’ll call it linux_passwd, you need to add in ::0:0 between fields four and seven. awk(1) does this for you.

At this point, you want to edit the new_passwd file and remove the root and other system entries that are already present in your OpenBSD password file or aren’t applicable with OpenBSD (all of them). Also, make sure there are no duplicate usernames or user IDs between new_passwd and your OpenBSD box’s /etc/passwd. The easiest way to do this is to start with a fresh /etc/passwd

The last step, pwd_mkdb is necessary to rebuild the /etc/spwd.db and /etc/pwd.db files. It also creates a Sixth Edition-style password file (minus encrypted passwords) at /etc/passwd for programs which use it. OpenBSD uses a stronger encryption for passwords, blowfish, which is very unlikely to be found on any system which uses full Sixth Edition-style password files. To switch over to this stronger encryption, simply have the users run ‘passwd’ and change their password. The new password they enter will be encrypted with your default setting (usually blowfish unless you’ve edited /etc/login.conf). Or, as root, you can run passwd username.

Also you will want to copy over the groups file. note again, only copy over groups that do not exist in both.

Basic pfctl control

# basic pfctl control
# ==
# Related:
# Last update: Tue Dec 28, 2004
# ==
# Note:
# this document is only provided as a basic overview
# for some common pfctl commands and is by no means
# a replacement for the pfctl and pf manual pages.

#### General PFCTL Commands ####
# pfctl -d disable packet-filtering
# pfctl -e enable packet-filtering
# pfctl -q run quiet
# pfctl -v -v run even more verbose

#### Loading PF Rules ####
# pfctl -f /etc/pf.conf load /etc/pf.conf
# pfctl -n -f /etc/pf.conf parse /etc/pf.conf, but dont load it
# pfctl -R -f /etc/pf.conf load only the FILTER rules
# pfctl -N -f /etc/pf.conf load only the NAT rules
# pfctl -O -f /etc/pf.conf load only the OPTION rules

#### Clearing PF Rules & Counters ####
# pfctl -F all flush ALL
# pfctl -F rules flush only the RULES
# pfctl -F queue flush only queue’s
# pfctl -F nat flush only NAT
# pfctl -F info flush all stats that are not part of any rule.
# pfctl -z clear all counters
# note: flushing rules do not touch any existing stateful connections

#### Output PF Information ####
# pfctl -s rules show filter information
# pfctl -v -s rules show filter information for what FILTER rules hit..
# pfctl -vvsr show filter information as above and prepend rule numbers
# pfctl -v -s nat show NAT information, for which NAT rules hit..
# pfctl -s nat -i xl1 show NAT information for interface xl1
# pfctl -s queue show QUEUE information
# pfctl -s label show LABEL information
# pfctl -s state show contents of the STATE table
# pfctl -s info show statistics for state tables and packet normalization
# pfctl -s all show everything

#### Maintaining PF Tables ####
# pfctl -t addvhosts -T show show table addvhosts
# pfctl -vvsTables view global information about all tables
# pfctl -t addvhosts -T add add entry to table addvhosts
# pfctl -t addvhosts -T add add a network to table addvhosts
# pfctl -t addvhosts -T delete delete nework from table addvhosts
# pfctl -t addvhosts -T flush remove all entries from table addvhosts
# pfctl -t addvhosts -T kill delete table addvhosts entirely
# pfctl -t addvhosts -T replace -f /etc/addvhosts reload table addvhosts on the fly
# pfctl -t addvhosts -T test find ip address in table addvhosts
# pfctl -T load -f /etc/pf.conf load a new table definition
# pfctl -t addvhosts -T show -v output stats for each ip address in table addvhosts
# pfctl -t addvhosts -T zero reset all counters for table addvhosts

Installing VMware Server on Ubuntu 8.04 Hardy Heron

I found a great post at MakeTechEasier I changed it a little and posted it.

You will be building kernel specific files so you need to have the proper header files installed for your kernel along with something to compile it.

If you are using 64 bits system, you have to install 32bit compatibility files

Download VMware Server 1.0.6

Download the patch file vmware-any-any-update-116.tgz

Extract the downloaded files

Run the VMware Server installer

You will be prompted to answer some questions. Press Enter to select the default answer. When it reaches the point that requires you to run, type No. The installer will exit. Next, apply the patch

This time, press Enter for all the questions and enter Yes to run the Once it has finished compiling, you should now see the VMware console in your Applications->Other. The first time you run vmware use the console by typing vmware in the terminal. If there are any errors it will tell us. If it says it can’t find some files all we need to do is copy them from the /usr/lib directory.

For 64 bit users

That’s it. Your VMware Server should be working now.

Realtek ALC888 and Ubuntu Hardy Heron low audio problem

Last night I installed Ubuntu 8.04 and I’m so impressed. I did the WbUI version. And let me tell you, It was the easiest OS install I have ever done. Everything is great only one problem. My audio was really quiet. I have an Realtek ALC888 chipset. I had to crank my speakers to get a descent volume.

I found a solution.

Even through I have my speakers plugged into the ‘Green’ standard front channel jack Ubuntu thinks it’s plugged into the side channel.

  1.  Open up the ALSA mixer[double click on the speaker at the top by the time]
  2. Click on Edit->Preferences
  3. Check all of the output channels
  4. Turn the volume up on all the devices till you find the right channel(be careful if you have your speakers still cranked or you’ll soil yourself)

Thats it. Easy.

Using OpenSSL to generate a self signed SSL certificate for Apache.

Originally found at How to create a self-signed Certificate

  1. Generate server key
  2. Generate csr
  3. Remove passphase so apache don’t ask for it on every server start
  4. Create self signed certificate
  5. Copy certificate to Apache dir
  6. Configure Apache to use the certificate