Fleximus Blog

 

Convert squid timestamps

2011-07-17 posted by Fleximus
When you work with a squid access log file you sometimes want to know when a site or resource was accessed.
Squid does not store the date and time information for that in a human readable format.

It is stored as <unix timestamp>.<centisecond> so you can use a command like that to post-process to make it more readable for you: cat access.log | perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e'
 

Nginx file extension whitelisting

2011-06-23 posted by Fleximus
Nginx is a great webserver that is flexible, feature rich and fairly well documented. But have you ever wanted to whitelist files upon their extensions and did not find a solution in the documentation reference? The bad answer is you will not find it. The good answer is: It is possible.
if ($request_filename !~* \.(gif|html|jpe?g|png|ico|js|css|flv|swf|pdf|xml)$ ) {
  return 404;
  break;
}
The request filename is checked against that regular expression which looks for all endings of filenames you want. If it does not match, Nginx will display a 404 (not found) page. This snippet should be used in the config file before any other rewrite rules or checks.
 

Faster boot times on Nehalem systems

2011-06-23 posted by Fleximus
FreeBSD boots painfully slow on new servers with Intels Nehalem chipsets. You don't want to wait 180 seconds and more? Here's the solution, just add these two lines to your /boot/loader.conf and the boot time will significantly decrease:
hint.atkbdc.0.disabled="1"
hint.atkbd.0.disabled="1"

The reason is that FreeBSD tries to find and initialize a PS/2 keyboard where no PS/2 is in the system at all.
 

Haiku gets eight studens for GSoC 2011

2011-04-28 posted by Fleximus
Haiku have been allocated eight students for this years Google Summer of Code program. Overall, 417 mentoring organizations applied and 3731 students submitted 5474 proposals. Haiku is proud to be one of 175 accepted mentoring organizations, with 35 submitted proposals and 8 accepted students!

That means, that 8 people are working on eight projects that will be hopefully successfully finished at the end of this summer. It is also Haiku's opportunity to grow and refine young, intelligent, and highly motivated students into people who will continue to develop Haiku in the years to come.

Here's the overview of the accepted projects:
  • Services server and Contacts files integration
  • USB Video Driver for High-end Webcams
  • Language bindings for the C++ API
  • SDL upgrade
  • Add USB 3.0 support to Haiku
  • Bâtisseur: a build server for all.
  • Port ZFS to Haiku
  • VirtualBox guest additions for Haiku


You can also look at the full announcement from Haiku's website for this.

Wow, driver stuff is always a good thing but also a port of the ZFS file system sounds very promising. As I use Haiku in VirtualBox, the guest additions are helpful for a lot of people I think. Looking forward!
 

DragonFly BSD 2.10 released

2011-04-27 posted by Fleximus
The 2.10 release supports, thanks to updates of ACPI and APIC interrupt routing support, a much larger variety of hardware and multiprocessor systems than previous releases.

The Hammer Filesystem can now deduplicate volumes overnight in a batch process and during live operation. For estimation of space savings for existing data you can use this command:
# hammer dedup-simulate

The pf Packet Filter was updated to match OpenBSD's 4.4 version of pf where DragonFly BSD used pf from OpenBSD 4.2 before.

Gcc 4.4 is now used as the default system compiler. Oher BSDs use older gcc versions, so it's the first to take that step.

The bridging system has been rewritten. Multiple interfaces on a single system can be bound together transparently under a single virtual MAC address, and bandwidth aggregated to that new interface.

The MPLOCK (the primary lock, that when held ensures only a single cpu is operating within the kernel) has been removed from every area except the VM system. DragonFly is one of the few non-academic operating systems to use a primary sychronization mechanism that is not a blocking mutex.

DragonFly BSD now offers significant performance gains over previous releases, especially for machines using AHCI or implementing swapcache(8).

Here is the original DragonFly BSD 2.10 release page.