Planet Larry

July 10, 2009

Dion Moult

Chrome in the Clouds: The Google OS

If you read my initial post about Google Chrome (the OS, not the Brow- wait a minute, is there even a clear distinction anymore?) you would have realised that I didn’t really give opinions on what I felt about it but instead  how I visualised it to be. I believe in designating some mull-over time before making a judgement. (hypocritically speaking, I did not do that when constructing my conspiracy theory when Google Wave came out)

Now is the time to see what exactly is going on.

My feelings in a nutshell

  • Would I buy such a product? If it were cheap (100 dollars or so), yes.
  • I feel Google is harming open-source.
  • Cloud computing is very important to me for accessibility and synchronisation.
  • We cannot fight, and should not fight.

The story behind it

The first point is easy to justify and I do believe this is very agreeable. This is an area of the markt people have always looked towards with an expectation of a “trustworthy” brand, and Google has just provided that to them. People will buy for this OS.

To a company, Google is probably executing its marketing strategy in the most effective way possible. They use a product-orientated approach, making the product first then selling it to the market – or so it seems. Google knows two things: 1) They have craploads of data, and 2) They own (pretty much) the biggest mass marketing device in the world. However they do know that even though they “own” this realm, they cannot control it. It’s like a pet – you own but cannot control it.

They way you control it is by feeding it. Such is the nature of open-source development. However Google is able to turn open-source into money by producing a good percentage of the product before open-sourcing it. This allows Google to keep the leash on the project. You developers aren’t building the product side by side – no: you are doing the grunt work that turns a framework into something consumers will love – something with the name Google slapped onto it.

Let’s move onto my third feeling. This is because of a trend I have noticed over time. Computers is no longer about being in full control of your data – it’s about being in full control of your data no matter where you are. Cloud computing sorts this out – it’s no wonder Google’s objective is “to be the hub through which all the world’s information passes through“. Sorry guys, but the fact is that most consumers want this. The only time they won’t is when the company providing it has a bad reputation – but Google? No, Google’s never been evil have they? Not to the average joe they haven’t. It’s the average joe that changes the workflow – it’s the average joe that makes such a way of working part of your daily routine.

You see, Chrome isn’t about making an operating system to do useful stuff – Chrome is all about changing people’s workflow to become web-centric. Instead of moving into the desktop market, what Google is doing is moving consumers into the web market.  Why do you think it’s named Chrome after their browser? It saves on the advertising costs. You advertise the OS, you advertise the browser. Google is pushing ahead HTML 5 specifications to redefine what the web is capable of, and their browser Chrome going to be the biggest, baddest boy in the playground that knows the meaning of the word “compatibility” backwards. Advertise them both at the same time – what you get are people getting the “wow” experience Google can provide with all its toolkits online from the browser, and making it easy as pie to integrate it into how they work. It’s not because Google Docs is simply an application that allows you to edit documents online, it’s because it’s a shared, accessible, compatible, synchronised alternative.

We cannot and should not fight.

Yes. My last point is so awesome it deserves its own special section.

You cannot fight once a market leader has made a choice on a product/system. We saw it with Windows and we may very well see it again. (I assume you have all seen Google Wave?) Instead we have to understand the market. What does the market want? How do we provide for it?

Now, I am a KDE user myself but what I see as major areas for Linux and DEs in general to focus on are:

  • Plasmoids (in KDE at least) – this is a stepping stone to integrate new technologies and the web into the desktop workflow
  • Provision of private clouds, complying with open-standards – for private, secure and PERSONALISED (imagine giving users the freedom to shape their cloud environment) mobility and synchronisation
  • The social desktop
  • The semantic desktop

Am I right, am I crazy, have I missed out stuff?

Shower me with your thoughts please.

Related posts:

  1. The Google Operating System – Chrome.
  2. Beware of Google.
  3. How to install Chromium (Google Chome) on Gentoo Linux

July 10, 2009 :: Malaysia  

Matija Šuklje

Cloud computing on netbooks — Why?

All this talk about Google's Chrome OS has made me think a bit.

While in general I agree with both Dion Moult and Christian Weilbach and am in general mistrusting to cloud computing (at least in its currently most popular form), there is something else that bothers me with this hype.

As of late a lot of talk and effort about cloud computing was being done in the direction of making it work on netbooks and similar mobile devices. To me this makes no sense! Having your documents and data online is a great idea if you have no computer of your own or you have to migrate a lot, but only have a stationary system.

But if you can take all your data with yourself on a ultra-portable device with hours of autonomy time (e.g. netbook, smartphone), why would you rather have it online out of your direct reach? It is neither practical, because you need a network connection all the time, nor does it spare you much diskspace (if we completely ignore IP and privacy complications). Yes, SSD's are still small, but frankly, all that music and movies take up a lot more space then your calendars, inbox and documents put together!

There are cases when clouds make sense. But it always depends on what they are used for and how they are implemented. For example, I am very happy with SpiderOak's encrypted and clouded backups and am looking forward to SocialDesktop if its done right (and it seems like it might be). I even have some insane ideas about binding together NEPOMUK with P2P and F2F technology. But I will write about all this some other time.
<!--break-->

July 10, 2009 :: Slovenia  

Iain Buchanan

Dell Inspiron 9100 Internals part 3: CPU cooling assembly

After removing the video card, the next step was to access the CPU fan. In the picture on the right you can see the Microprocessor Thermal-Cooling Assembly starting with the CPU fan at the bottom middle, running over the northbridge copper heat transfer pipe, and finally to the CPU heatsink. This Aluminium block has two copper pipes running to the left and right fans, for extra cooling.

Once I had got this far, I suspected the blockage was after the fan, but before the Aluminium block. I removed the video card (as you saw previously) and then the four screws on the block.

The block gave a bit of resistance, and then lifted. Experts would recommend you do this to a hot machine, and this is the reason why: There's the CPU nicely stuck to the block. oops! The CPU pulled right out of the closed ZIF socket! Note that you can't do this to a warm laptop, unless you're fast, as it takes time to get this far.

There's a great thread here about removing a stuck CPU. I think the dental floss is a bit over the top (and time consuming), so I used a heat gun. I placed the assembly upside-down so the CPU wouldn't fall off, and blew the heat gun (or hair dryer) on the two end fins. Stop when it's only just too hot to touch. Then only a tiny bit of pressure was required to lift the CPU. Don't apply pressure to the corner of the CPU with a screwdriver!

Here's the final shot showing no CPU or video card.
Make sure you cover the ZIF socket
with something to keep it dust free. And don't touch the CPU or heat sink heat transfer surface, as your skin-oils can deter the heat transfer.



Here's the cooling assembly. You can see the thick dust covering the channel. There was also dust all through the fins. (Again, sorry for the bad photos).






Now I cleaned the CPU surface and heat sink surface with alcohol and a lint-free cloth, and applied a covering of Arctic Silver. The next two photos show why it needed cleaning:




And now it's time to reinstall! Follow the pull-apart instructions backwards.

Take careful note of where the screws go as some screws were different sizes to the ones listed in the Dell guide. Also make sure you take care with re-inserting the parts. I cracked the display bezel and one hinge because I couldn't fit the centre hinge cover properly. Nevermind, they're only about US$25!

On the right you can see a gcc compile at 100% CPU usage. The CPU has only just started to heat up at 43 degrees C. It didn't pass 58 degrees after compiling my system for hours, and the fans were all at low / medium speed.

Finally, at idle, it's now 40 degrees C. (woot).

Oh, and by the way: I suspended before taking out the CPU, and I resumed days later without any software issues!

July 10, 2009 :: Australia  

July 9, 2009

Iain Buchanan

Dell Inspiron 9100 Internals part 2: Video card

Part 1 of pulling-apart my laptop is here.

In this part I'm showing pictures of the video card before and after removal.

Here is the exposed shot again:
At the top left you can see two sets of cooling fins with a copper pipe running diagonally to a daughter board. This board is my ATI Mobility Radeon 9700 M10 with 64Mb RAM (woohoo!). Other options are the Mobility 9700 with 128Mb RAM, and the Mobility 9800. (I wish I had the 9800...)

Below the heat sinks on the far left is a fan. One heat sink transfers heat from the video card (furtherest back) via the copper pipe you can see. The other heat sink transfers heat from the CPU via a copper pipe that runs under the video card. You can just see it running parallel to the back edge.

Follow the Dell instructions for removing the video card (and my disclaimer) in Post 1. It looks like this:
You can see the copper transfer pipe, and the cooling fins. Copper is excellent at transferring heat! You'll see why in Part 3.






The next photo shows what the system board looks like without the video card!
You can now clearly see the CPU heat transfer pipe, as well as a third copper pipe under the video card. The third pipe looks like its attached to the northbridge heat sink. This third pipe runs diagonally to the CPU cooler, and ends in a small aluminium heat transfer block under the black plastic cover you can see.

The video card slot is visible next the the fan. Kudos to Dell and other laptop manufacturers for making laptops almost as modular as desktops, however replacement video cards are hundreds of dollars! I can't find any cheap second hand parts. If you can, let me know!

July 9, 2009 :: Australia  

Dell Inspiron 9100 Internals part 1: accessing the components

So I've had my Inspiron 9100 since 2003 or 2004 - when they were quite new. Back then the 3.0GHz P4 was a super machine, and even now it beats most light laptops with boot-up time and performance.

Lately it's been under a desk as a remote server, so I haven't seen much of it. I pulled it out recently and noticed the fans were spinning quite a lot, and the CPU temp was quite high - 60 - 70 degrees.

I pulled out the two side ventilators (fans) and cleaned a large amount of fine dust from the fans and heat sink fins. This has massively reduced the fan usage, and the CPU temperature is now down to 40 degrees at idle.

However there's one more fan - the CPU fan - that I couldn't easily reach. I could hear it all the time so I assume its suffering from the same problem: dust. I finally decided to pull it apart and clean it, and here is my progress. This is also an interesting look into how a Dell laptop wears over time - not too bad in my opinion.

First, CONTINUE AT YOUR OWN RISK! The pull-apart starts easy and low risk, but as soon as you pull apart the display assembly, video card and CPU you're in the high-risk area. If you break your laptop, you can keep the change from selling the parts on eBay!

Second, follow the instructions from Dell - they're the ultimate pull-apart guide and I only found them lacking at the very last stage (CPU fan removal).

Here's a grainy shot of the left hinge cover - there's plenty of dust there. (sorry about the bad quality - it's my phone camera). See the dust near the display attachment:


Now I've taken off the keyboard and surrounds. There's more dust:


Here is a shot of the laptop from the top as you would sit at it to work, but without the display, keyboard, touchpad, etc. The CPU fan is at the bottom centre.


Here is just half of the screws I removed (I count 30 so far). Next to them is the hinge covers:


This got me to some of the system board components. In the next post I'll show the removed video card, CPU and heatsinks.

Enjoy!

July 9, 2009 :: Australia  

Ciaran McCreesh

Vim Plugins on Github


I’ve moved some of my Vim plugins from vim.org to Github. This means that rather than having to spend hours painfully updating things on a site with an uptime on par with ahf’s, I can now spend a few seconds updating things locally and then automate waiting hours to be able to push to a site with an uptime on par with ahf’s.

You can now get, and more importantly, send patches that won’t get ignored for:

  • inkpot, the original and best 88/256 colour scheme
  • detectindent, if you have to work with heretics who don’t use four-space indenting
  • securemodelines, if you like modelines but don’t like malicious documents being able to trash your terminal
Posted in vim Tagged: detectindent, inkpot, securemodelines, vim

July 9, 2009

Dirk R. Gently

A Beginners Setup to Quake Wars


Header

If you are just getting into Quake Wars, has a Strogg just thrown a grenade in your area and then quickly pulled out his Lacerator jumping around the corner to finish you off, all before you could say, “What the…”? Welcome to Quake Wars. Quake Wars has been around for a couple years and has some very devote followers. I almost threw out Quake Wars, discarding it as too tough and moved on. I’ve played a good bit of Urban Terror and thought I could mesh skills pretty well in QW but I couldn’t. For one, QW is a completely different game that UT. It is highly team-based and class-independent game. Second, experts there have a highly configured setups that can make your twist-left-hand stretch-forefinger setup into minchmeat. This is a guide that will get your setup somewhat on par with the experts and put you on evener ground.

ETQW is highly configurable. It literally has thousands of settings that can be changed. Thankfully we will only have to change a number of them the get on par with other players. Be of warning though that changing some settings are considered cheats and the built-in cheat system (Punkbuster) may disallow some settings. I have built a configuration that will work on just about all servers. If there are values that are not allowed by Punkbuster, Punkbuster will let you know in the chat window.

Keyboard Layout

The most important thing you can do is to build a keyboard layout where most commonly used keys are close to the fingertips. Here’s the layout I use. Green keys are at the fingertips, blue require a bit of reach, yellow are just out of reach, and red are need be.

A couple notes. Sprint toggle is the always running toggle. Sprinting is useful most of the time but makes scoping opponents and moving impossible. All keys to right are automated responses that I frequently use. 9 and 0 will respawn you in either the original spawn or the foremost spawn.

User Configuration File

Configurations are put in the users autoexec.cfg file. There won’t be one originally so you will have to create it. The autoexec.cfg file in Linux goes in the user configuration folder: ~/.etqwcl/sdnet/<playername>/base. In Vista it goes in in the users Documents\Id Software\ETQW…\sdnet\base. This file gets loaded when the user logs in. To be able to test it though it needs to be in ETQW’s global location <ETQW-config-folder>/base. Create an autoexec.cfg in the user folder and redirect to the global one:

exec global.cfg

You can name it anything you want. Once you have your global config set up you can test it from a running QW by opening console (~) and running exec global.cfg. QW will let you know of any error exist in the configuration file.

Global Configuration File

I could explain all the details of the configuration file but rather I’ll just give it to you. It has all the explanations in it plus links you need to look up an details. A couple notes: A smooth, even frames per second is critical to QW. You’ll want 30fps or 60fps without any hitching. Good graphics and great light don’t mean a thing when you’re looking to make that great hit and find yourself fighting your hardware. The config is for a nvidia 9600 GSO which at 2009 this is a medium level graphic card that handles shaders and lighting poorly, the config will reflect that. I haven’t give away all my secrets, so, well here it is:

Enjoy!

// Contributor akau <dirk.r.gently@gmail.com>
// http://www.planetquakewars.net/Guides/Config_Guide?locale=en_US
// http://4newbies.planetwolfenstein.gamespy.com/ETQW/iffy_autoexec.php
// http://www.modwiki.net/wiki/CVars_(ETQW) - cvar listings

/// Hardware ///

// 30 fps is all this card's got, "showcom_fps 1" to draw fps
// http://community.enemyterritory.com/forums/showthread.php?t=2042
seta com_unlockFPS 1
seta com_unlock_timingMethod 2

// Texture Quality (-2 to 2) - Texture and Visual Quality mirror those found
// in Settings > Advanced in the game
seta image_diffusePicMip "0"
seta image_bumpPicMip "0"
seta image_specularPicMip "-2"
seta image_anisotropy "0"       // (0 off, to 16 by 2^)

// Visual Quality/Performance
seta r_megadrawmethod "2"       // Lighting Quality (0-3) (0 high, 3 LOW)
seta com_lastFoliageLevel "0"   // Foliage Quality (0-2) (0 low, 2 high)
// Terrain Quality, Shader Effects, Effects Level, Debris/Weather many settings
seta com_gpuSpec "0"            // Shader Level (0-3 - low, normal, high, ultra)
seta r_multiSamples "0"         // Anti-Aliasing (0,2,4,8,16,32)
seta image_filter "GL_LINEAR_MIPMAP_NEAREST" // faster antialiasing

seta r_swapinterval "0"         // disable vsync
seta r_shadows "0"              // enable shadows
seta r_softParticles "0"        // disable better explosions/smoke
seta r_useAlphaToCoverage "0"   // disable smooth foliage

seta r_useThreadedRenderer "2"  // For multiple cpus
seta image_filter "GL_LINEAR_MIPMAP_NEAREST" // bilinear AA, trilinear default

// High FPS boosts
// r_megaDrawMethod, r_shadows, r_softParticles above
seta com_gpuSpec "2"            // Graphics (controls many?): 0 = low, 2 = high
seta com_machineSpec "2"        // Processor: 0 = low, 1 = med, 2 = high
seta g_decals "1"               // bullet mark decals 1 = on, 0 = off
seta g_showPlayerShadow "0"     // player shadows 1 = on, 0 = off
seta r_skipMegaTexture "0"      // use mega textures 0 = on, 1 = off
seta r_skipStuff "0"            // have foliage and grass 0 = on, 1 = off

// Additional FPS boosts
seta r_skipBump "1"             // Disables the bump while walking
seta r_skipSpecular "1"
seta r_shaderQuality "0"        // Shader quality
seta r_detailTexture "0"        // Detail level textures
seta r_detailFade "0"           // Detail level fades

seta com_videoRam "768"         // usually ETQW can detect video memory

// Resolution
// r_mode list:
// http://community.enemyterritory.com/forums/showpost.php?p=349547&postcount=4
seta r_mode "10"                // -1 for custom
seta r_aspectRatio "2"          // 0=4:3, 1=16:9, 2=16:10, 3=5:4 TFT, -1 custom
seta r_fullscreen "1"
//seta r_customAspectRatioV "10"
//seta r_customAspectRatioH "16"
//seta r_customHeight "900"
//seta r_customWidth "1440"
//seta cg_fov "90"                // field of view, default 90 some people may
                                  // a wider fov but increases view depth
                                  // 100.39 16:10 106.27 16:9, 110 16:10 120 16:9?
// seta image_lodbias "-1"        // increases viewable distance
// seta r_visdistmult "1.2"

// Sound
seta s_volume_dB "-10"
seta s_volumeMusic_dB "-25"
seta s_force22kH "1"             // lowering audio can help graphics a bit

// Network - http://ucguides.savagehelp.com/Quake3/connection.html
seta cl_maxpackets "100"      // max packets 100 for PunkBuster bandwidth.
seta cl_packetdup "1"         // If high PL - make 1.
seta snaps "40"               // Leave this at 40, servers will adjust.
seta rate 25000               // DSL/Cable - best at 25,000 servers will adjust.
seta cl_timenudge 0           // Leave at 0 for less lag and less trouble.
seta cg_lagometer "0"         // Displays network lag

// Mouse
seta sensitivity "13.0"         // sensitivity
seta m_smooth "1"               // smooth mouse movements
seta m_pitch "0.022"            // vertical sensitivity scale
seta m_helicopterPitch "0.022"  // mouse/joystick no inverted when flying
seta m_yaw "0.022"

// VOIP - enable or disable - team, global, fireteam
seta ui_voipReceiveTeam "1"
seta ui_voipReceiveGlobal "0"
seta ui_voipReceiveFireTeam "1"

/// General Settings ///

// Seen intro, doesn't work in Linux anyhow
seta g_skipIntro "1"

// For Windows tilda key
seta com_allowconsole "1"

// Enough of the tooltips
seta gui_showTooltips "0"
seta g_tooltipTimeScale "0"

// Punkbuster is our friend
seta net_clientPunkbusterEnabled "1"

// Limit rolling and bobbing motions
// Warning some servers may not allow this
seta pm_crouchbob 0
seta pm_bobpitch 0
seta pm_bobup 0
seta pm_runroll 0
seta pm_runpitch 0
seta pm_runbob 0
seta pm_walkbob 0

// I find the run toggle useful
seta in_toggleSprint "1"

// Superfluous respawn text (Alpha)
seta gui_showRespawnText "0"

/// HUD settings ///
// http://community.enemyterritory.com/forums/showthread.php?t=14167

// no rotating command map
seta g_rotatecommandmap "0"

// Chat colors
seta g_chatDefaultColor .6 .8 1 .7      // B global chat color (RGBa color)
g_chatTeamColor .8 .8 .8 .7             // team chat color
g_chatFireTeamColor 1 .6 .6 .7          // fireteam chat color
seta gui_chatAlpha "0.7"
seta g_chatLineTimeout "8"              // default 5

// Less distracting waypoints, icons, mines, objectives, crosshair, vehicles,
// fraglist, commandmap, fireteam list
seta g_waypointAlphaScale "0.5"
seta g_waypointDistanceMax "3084"
seta g_waypointDistanceMin "16"
seta g_waypointSizeMax "15"
seta g_waypointSizeMin "10"

seta g_playerIconAlphaScale ".5"
seta g_playerIconSize "10"
seta g_playerArrowIconSize "5"
seta g_drawVehicleIcons "0"               // Disable the vehicle icons
seta g_friendlyColor ".8 .8 .8 .5"
seta g_enemyColor "1 .2 .21 0.5"
seta g_neutralColor "0.45 .45 .45 .5"

seta g_drawMineIcons "0"
seta g_mineTriggerWarning "0"

seta gui_objectiveListAlpha "0.4"
seta gui_objectiveStatusAlpha "0.4"

seta gui_crosshairColor "0 1 0 .70"
seta gui_crosshairSpreadScale "0"
seta gui_crosshairGrenadeAlpha "0.286585"
seta gui_crosshairStatsAlpha "0"
seta gui_crosshairSpreadAlpha "0"
seta gui_crosshairAlpha "0.7"
seta gui_crosshairKey "pin_14"
seta gui_crosshairDef "crosshairs"

seta g_showVehicleCockpits "0"            // cockpits take alot of space
seta gui_vehicleDirectionAlpha "0.5"
seta gui_vehicleAlpha "0.8"

seta gui_obitAlpha "0"                    // remove leftside kill message
seta gui_commandMapAlpha "1"
seta gui_fireTeamAlpha "0.8"
seta gui_personalBestsAlpha ".4"           // Disabled because of bug?
seta gui_showRespawnText "0"

/// Player ///
seta ui_name "myname"
seta ui_clanTag ""
seta ui_clanTagPosition "1"

/// Keybindings ///

// Don't unbind all unless you plan to bind every key. ETQW will just replace
// otherwise.
//unbindall

// Actions //

// Movement
bind "e" "_forward" "" "default"
bind "s" "_moveleft" "" "default"
bind "d" "_back" "" "default"
bind "f" "_moveright""" "default"
// Lean - lean with shift key and s and f
bind "s" "_leanleft" "shift" "default"
bind "f" "_leanright" "shift" "default"
// Crouch/Prone/Sprint/Walk
bind "shift" "_movedown" "" "default"
bind "v" "_prone" "" "default"
bind "r" "_sprint" "" "default"
bind "CTRL" "_speed" "" "default"
// Toggle sprint key behavior.
// On: move forward always sprints; Off: hold sprint key to sprint
bind "F4" "toggle in_toggleSprint"

// Weapons - melee, second, primary, grenades, gadgets (packs, cameras,
// explosives, airstrike), designators, tools (construct, revive, hack), deploy
bind "q" "_weapon0" "" "default"
bind "a" "_weapon1" "" "default"
bind "w" "_weapon2" "" "default"
bind "c" "_weapon3" "" "default"
bind "z" "_weapon5" "" "default"
bind "4" "_weapon6" "" "default"
bind "x" "useweapon weapon_tool1" "" "default"
bind "3" "useweapon weapon_tool2" "" "default"

// Reload
bind "t" "_reload" "" "default"

// Use
bind "g" "_activate" "" "default"

// Vehicle
bind "capslock" "_usevehicle" "" "default" // enter vehicle
bind w "_leanleft" "" "vehicle"            // strafe in Desecrator
bind r "_leanright" "" "vehicle"
bind "shift" "_sprint" "" "vehicle"        // use shift as vehicle boost
bind "1" "_weapon0" "" "default"           // decoys with right mouse click
bind "MOUSE2" "_weapon0" "" "vehicle"

// Fireteam Menu
bind "o" "_fireteam" "" "default"

// Type Chat - team, global, fireteam
bind "y" "clientMessageMode 1" "" "default"
bind "u" "clientMessageMode" "" "default"
bind "i" "clientMessageMode 2" "" "default"

// Automated Chat
bind "MOUSE3" "_context" "" "default"
bind "MOUSE3" "_quickchat" "shift" "default"

// VOIP - team, global, fireteam
bind "5" "_teamVoice" "" "default"
bind "6" "_Voice" "" "default"
bind "7" "_fireteamvoice" "" "default"

// Respawn
bind "h" "kill"

// Sane screenshot button
bind printscreen screenshot

// Spawn at default spawn and forward-most spawn
bind "9" "setSpawnpoint base"
bind "0" "setSpawnpoint default"

// GreasedScotsman's insta-class changes and announce
// GDF use CTRL + (1234-qw-asd-5-zx) - (ALT Strogg)
// soldier
bind "1" "clientTeam GDF; clientClass Soldier 0;wait;kill;sayTeam '^7'Respawning as a'^m'Soldier'^7'with an '^d'Assault Rifle'^7'" "CTRL" "default"
bind "2" "clientTeam GDF; clientClass Soldier 1;wait;kill;sayTeam '^7'Respawning as a'^m'Soldier'^7'with a '^d'Rocket Launcher'^7'" "CTRL" "default"
bind "3" "clientTeam GDF; clientClass Soldier 2;wait;kill;sayTeam '^7'Respawning as a'^m'Soldier'^7'with a '^d'GPMG'^7'" "CTRL" "default"
bind "4" "clientTeam GDF; clientClass Soldier 3;wait;kill;sayTeam '^7'Respawning as a'^m'Soldier'^7'with a '^d'Shotgun'^7'" "CTRL" "default"
// medic
bind "q" "clientTeam GDF; clientClass Medic 0;wait;kill;sayTeam '^7'Respawning as a'^m'Medic'^7'with an '^d'Assault Rifle'^7'" "CTRL" "default"
bind "w" "clientTeam GDF; clientClass Medic 1;wait;kill;sayTeam '^7'Respawning as a'^m'Medic'^7'with a '^d'Shotgun'^7'" "CTRL" "default"
// engineer
bind "a" "clientTeam GDF; clientClass Engineer 0;wait;kill;sayTeam '^7'Respawning as an'^m'Engineer'^7'with an '^d'Assault Rifle'^7" "CTRL" "default"
bind "s" "clientTeam GDF; clientClass Engineer 1;wait;kill;sayTeam '^7'Respawning as an'^m'Engineer'^7'with a '^d'Shotgun'^7" "CTRL" "default"
bind "d" "clientTeam GDF; clientClass Engineer 2;wait;kill;sayTeam '^7'Respawning as an'^m'Engineer'^7'with an '^d'Assault Rifle w/ Gren. Launcher'^7" "CTRL" "default"
// field-ops
bind "5" "clientTeam GDF; clientClass FieldOps 0;wait;kill;sayTeam '^7'Respawning as a '^m'Field Ops'^7'with an '^d'Assault Rifle'^7" "CTRL" "default"
// covert-ops
bind "z" "clientTeam GDF; clientClass CovertOps 0;wait;kill;sayTeam '^7'Respawning as a'^m'Covert Ops'^7'with a '^d'Scoped Assault Rifle'^7" "CTRL" "default"
bind "x" "clientTeam GDF; clientClass CovertOps 1;wait;kill;sayTeam '^7'Respawning as a'^m'Covert Ops'^7'with a '^d'Sniper Rifle'^7" "CTRL" "default"
// aggressor
bind "1" "clientTeam Strogg; clientClass Aggressor 0;wait;kill;sayTeam '^7'Respawning as an'^m'Aggressor'^7'with a '^d'Lacerator'^7" "ALT" "default"
bind "2" "clientTeam Strogg; clientClass Aggressor 1;wait;kill;sayTeam '^7'Respawning as an'^m'Aggressor'^7'with an '^d'Obliterator'^7" "ALT" "default"
bind "3" "clientTeam Strogg; clientClass Aggressor 2;wait;kill;sayTeam '^7'Respawning as an'^m'Aggressor'^7'with a '^d'Hyperblaster'^7" "ALT" "default"
bind "4" "clientTeam Strogg; clientClass Aggressor 3;wait;kill;sayTeam '^7'Respawning as an'^m'Aggressor'^7'with a '^d'Nailgun'^7" "ALT" "default"
// technician
bind "q" "clientTeam Strogg; clientClass Technician 0;wait;kill;sayTeam '^7'Respawning as a'^m'Technician'^7'with a '^d'Lacerator'^7" "ALT" "default"
bind "w" "clientTeam Strogg; clientClass Technician 1;wait;kill;sayTeam '^7'Respawning as a'^m'Technician'^7'with a '^d'Nailgun'^7" "ALT" "default"
// constructor
bind "a" "clientTeam Strogg; clientClass Constructor 0;wait;kill;sayTeam '^7'Respawning as a'^m'Constructor'^7'with a '^d'Lacerator'^7" "ALT" "default"
bind "s" "clientTeam Strogg; clientClass Constructor 1;wait;kill;sayTeam '^7'Respawning as a'^m'Constructor'^7'with a '^d'Nailgun'^7" "ALT" "default"
bind "d" "clientTeam Strogg; clientClass Constructor 2;wait;kill;sayTeam '^7'Respawning as a'^m'Constructor'^7'with a '^d'Lacerator w/ Plasma Launcher'^7" "ALT" "default"
// oppressor
bind "5" "clientTeam Strogg; clientClass Oppressor 0;wait;kill;sayTeam '^7'Respawning as an'^m'Oppressor'^7'with a '^d'Lacerator'^7." "ALT" "default"
// infiltrator
bind "z" "clientTeam Strogg; clientClass Infiltrator 0;wait;kill;sayTeam '^7'Respawning as an'^m'Infiltrator'^7'with an'^d'Accurized Lacerator'^7" "ALT" "default"
bind "x" "clientTeam Strogg; clientClass Infiltrator 1;wait;kill;sayTeam '^7'Respawning as an'^m'Infiltrator'^7'with a'^d'Railgun'^7" "ALT" "default"

// Automated responses quick-keyed //
// http://4newbies.planetwolfenstein.gamespy.com/ETQW/vsay.php

// Global Replies / End Games
bind "HOME" "clientquickchat quickchat/global/yes" "" "default"
bind "END" "clientquickchat quickchat/global/no" "" "default"
bind "INS" "clientquickchat quickchat/global/taunts/owned" "" "default"
bind "PGUP" "clientquickchat quickchat/global/taunts/meh" "" "defaults" //broke
bind "DEL" "clientquickchat quickchat/global/cheers/goodgame" "" "default"
bind "PGDN" "clientquickchat quickchat/global/cheers/wellplayed" "" "default"

bind "UPARROW" "clientquickchat quickchat/global/hi" "" "defaults"
//bind "DOWNARROW" "clientquickchat quickchat/global/sorry" "" "defaults"
bind "LEFTARROW" "clientquickchat quickchat/global/sorry" "" "defaults"
//bind "RIGHTARROW"

// Team Replies
//bind "KP_NUMLOCK"
bind "KP_SLASH" "clientquickchat quickchat/responses/onit" "" "default"
bind "KP_STAR" "clientquickchat quickchat/responses/sorry" "" "default"
bind "KP_MINUS" "clientquickchat quickchat/responses/thanks" "" "default"
bind "KP_HOME" "clientquickchat quickchat/need/team/medic" "" "default"
bind "KP_UPARROW" "clientquickchat quickchat/need/engineer" "" "default"
bind "KP_PGUP" "clientquickchat quickchat/need/team/covertops" "" "default"
bind "KP_LEFTARROW" "clientquickchat quickchat/need/team/radar" "" "default"
bind "KP_5" "clientquickchat quickchat/need/team/apt" "" "default"
bind "KP_RIGHTARROW" "clientquickchat quickchat/need/team/avt" "" "default"
bind "KP_PLUS" "clientquickchat quickchat/need/medic" "" "default"
bind "KP_END" "clientquickchat quickchat/enemy/indisguise" "" "default"
bind "KP_DOWNARROW" "clientquickchat quickchat/enemy/deployables/aptspotted" "" "default"
bind "KP_PGDN" "clientquickchat quickchat/enemy/deployables/avtspotted" "" "default"
bind "KP_INS" "clientquickchat quickchat/commands/captureforwardspawn" "" "default"
bind "KP_DEL" "clientquickchat quickchat/self/disguise/enemydisguisedasme" "" "default"
// State Class //
bind "KP_ENTER" "clientquickchat quickchat/self/imsoldier" "" "soldier"
bind "KP_ENTER" "clientquickchat quickchat/self/immedic" "" "medic"
bind "KP_ENTER" "clientquickchat quickchat/self/imengineer" "" "engineer"
bind "KP_ENTER" "clientquickchat quickchat/self/imcovertops" "" "covertops"
bind "KP_ENTER" "clientquickchat quickchat/self/imfieldops" "" "fieldops"
bind "KP_ENTER" "clientquickchat quickchat/self/imaggressor" "" "aggressor"
bind "KP_ENTER" "clientquickchat quickchat/self/imtechnician" "" "technician"
bind "KP_ENTER" "clientquickchat quickchat/self/imconstructor" "" "constructor"
bind "KP_ENTER" "clientquickchat quickchat/self/imoppressor" "" "oppressor"
bind "KP_ENTER" "clientquickchat quickchat/self/iminfiltrator" "" "infiltrator"

July 9, 2009 :: WI, USA  

July 8, 2009

Daniel Robbins

Funtoo-dev Mailing List - Initscripts

Funtoo now has a Google Groups mailing list called funtoo-dev, which can be used for Funtoo discussion, patch submissions or bug reports.

On the list, I've posted an overview of upcoming planned changes to Funtoo's init scripts. With dhcpcd-5, all that will be required to configure a new Funtoo install for wired DHCP ethernet is:

# rc-update add dhcpcd default
# rc

Pretty nice!

I'm looking for feedback on the new initscript plan. Please feel free to post feedback here as well as on the mailing list. Talk to you soon!

July 8, 2009

Dan Ballard

Much needed server maintenance

I've finally gotten around to some long overdue server maintenance on Kvasir (mindstab.net et all). This is where running a Gentoo server can kind of be fun. I can mostly ignore it for ages, just poking at it when a GLSA (Gentoo security advisement) comes out for software it's running, and then when I feel like sitting down to it, I can upgrade all the software it's running to the latest stable versions.

The difference in comparison to other distros is of course that you are always current with their stable, but their stable can only stay current so long before they have to release a new version or else everything will break on some upgrades. In Gentoo they give you the tools to deal with it and pass the breakage onto you. So I upgrade slowly and cautiously and then fix a few things when config files change or libraries change and more things need to be recompiled, but it works. I installed Gentoo on this server 4 or 5 years ago and look, it's still going and running all new software. I think that's pretty cool.

And to top off the changes, I finally got around to installing a "new" 512MB ram stick in the server as well, now doubling its ram to 1GB. Which is cool, and just in time because the new clamav is eating RAM like candy. I'm actually wondering if something is wrong with it because it's really eating ram...

Ah well, anyways, the server got some well needed love and attention and is feeling much better.

July 8, 2009 :: British Columbia, Canada  

George Kargiotakis

Vodafone, Cosmote 3G on Linux (wvdial and umtsmon)

The following configs can be used when you have either Vodafone Mobile Internet or Cosmote Internet on the Go or both 3G USB sticks and you want to connect to the 3G Internet (in Greece) while using Linux. I’ll provide two ways to connect to 3G, the command line way using wvdial and the GUI way using umtsmon.

1) Using wvdial
Create /etc/wvdial.conf:

[Dialer Defaults]
New PPPD = yes
Dial Command = ATDT
Dial Attempts = 1
Modem = /dev/ttyUSB0
Modem Type = Analog Modem
ISDN = 0
Baud = 460800
Username = user
Password = pass
Init1 = ATZ
Init2 = AT&F E1 V1 X1 &D2 &C1 S
[Dialer cosmote]
Phone = *99#
Stupid Mode = 1
Init3 = AT+CGDCONT=1,"IP","internet"
[Dialer vodafone]
Phone = *99#
Stupid Mode = 1
Init3 = AT+CGDCONT=1,"IP","internet"
[Dialer vfPIN]
Init4 = AT+CPIN=1234
[Dialer cmPIN]
Init4 = AT+CPIN=5678

WARNING: You HAVE to change the PINs on the last part of the config

To connect to Cosmote, plug in the usb stick:

# wvdial cmPIN
# wvdial cosmote

To connect to Vodafone, plug in the usb stick:

# wvdial vfPIN
# wvdial vodafone

2) Using umtsmon
Connection->Manage Profiles and create the necessary profiles with settings that look like these:
umtsmon
Username and Password does not really matter. Enter something like User/Pass or Username/Password.

Both versions tested on Debian and Gentoo and they are working just fine.

If someone has the Wind ADSM settings please provide them as a comment so I can complete the post with all three Greek 3G providers.

References: List of AT commands

July 8, 2009 :: Greece  

Ciaran McCreesh

Paludis 0.38.0 Released


Paludis 0.38.0 has been released:

  • The =...* dependency operator in configuration files and command-line arguments now matches component-wise rather than character-wise.
  • Support for EAPI 3 is present and used during tests but excluded from the install target.
Posted in eapi 3, paludis releases Tagged: paludis

July 8, 2009

Dion Moult

The Google Operating System – Chrome.

Read Google’s original blog post about it.

That’s right, my conspiracy theory about Google (orignally posted a good month back) has come true, and it’s going to be out there around late 2010.

Brief summary: Google is making an operating system (Linux-based too) with help from the open-source community that focuses on getting the user online and into a browser as quick as possible. The browser is now the ultimate tool on the system. It is currently mainly meant for stuff like netbooks (note this is a separate project from Google Android) but will apparently also be able to provide a good experience for any desktop setup.

Since it’s too late to grimace at Google during their drawing board sessions, I like to ask myself what would an OS be in a time when many of our activites are web-centric.

Most of the main problems I outlined for Google in my conspiracy theory was how they could convice people to change their workflows. Apparently Google has decided to give them an operating system. This interface can easily be optimised to make it feel natural to shift their workflow completely into what they can do in a browser, some tabs and the new shabang HTML 5 will come with.

I took a look at Moblin, another netbook Linux-based OS – one thing instantly popped through my head: this doesn’t look like any window manager, it looks like a website or single application. Something you might expect similar to MythTV. (If I am wrong please correct me).

The first decision I would make on designing a UI for Google’s purposes is not to have any start menu. Something similar to Apple’s dock with modifications (also with an auto-hide) would be great for optimising screen real estate. I would also integrate what I now see as KDE Plasmoids as part of the entire interface (as in within applications itself too instead of only the desktop shell). I would also ask myself what applications could be and should be replaced by web applications. Such examples are email, document editing, chatting, and social networking. What could not and should not be are graphics and multimedia editors, games, and system management tools. It seems very much now that we can split our activities into 2: if you want to make technology, do it offline. If you want to use technology, do it online.

Personally, I can easily now see how easily I can adapt my workflow to this internet-centric pattern.

What about you? What do you expect from Google’s OS?

Related posts:

  1. Beware of Google.
  2. How to install Chromium (Google Chome) on Gentoo Linux
  3. Kaizen and Kakushin’s Practicality in Open-Source Business Models

July 8, 2009 :: Malaysia  

July 7, 2009

Sean Potter

Server and Linux

I'm finally getting around to rebuilding my server. I've got an Intel Q6600 CPU, 8gb of ddr3 ram, and five 160gb hard drives for a raid5 array. On top of that, I have two tv tuners if I set up a MythTV server.

At the moment, I haven't decided on a distro for it. I'm by far the. Most familiar with Gentoo. However, it has never been the best choice for servers. So I'm more or less between Ubuntu and Debian as final choices. Suggestions are very much welcome.

The server is mostly going to be used for storage purposes, so I'm fairly sure I'm going to rely on ext4 as the filesystem for my raid array. Again, it's still up in the air. Off the top of my head, I don't entirely remember what other services I wanted to run on it... But it isn't a machine I plan to leave on 24/7 for the moment. I'd really like to build a mini-itx Atom machine to take care of email and other network services for my home.

So more updates will come from this in the near future as I finish assembling the machine itself.

July 7, 2009

Nikos Roussos

greek coding camp 2009


hackers in action

diary post for the greek coding camp 2009 that took place at paleochora (chania, crete, greece) for 5 days (4-7 july 2009).

day 1 (4/7)

we reached the island at 5.30 in the morning. we made a stop to enjoy the local hospitality with a rich breakfast and an hour of sleep. we travelled by car (about 1.30h) to the camping (paleochora) and we set up our tents.

first thing to do is share the projects:
- OpenOffice Templates translation
- OpenOffice greek numbered lists
- OpenOffice greek build testing
- Transifex work-flow support
- Letterscript for greek final “s” bug

lunch break with greek mousaka and tsikoudia :D

personally i was more interested on openoffice projects and especially the greek build testing.

day ended with a quick visit at the cold sea and a few glass of wine.

day 2 (5/7)

day started with some network problems. it seems that some lady rested her bag over the router, so it got warm beyond accepted limits :P

two more new guys arrives, so during lunch break we had some great conversations.

after some installation problems we managed to install the latest release candidate on cmpachar’s fedora laptop and on ubuntu virtualbox installation on my netbook. thanx to ntua we had access to a (12g ram, 16 core cpu) fast machine, so we also compiled openoffice straight from the subversion.

day 3 (6/7)

early waking. some of us did a nice conversation about lost and its timeline :D

later we had a sort seminar-like conversation about pgp essentials and gpg usage. just to convince everyone who didn’t have a key to sign ours :P

later at night we visited the near by village and we were enlightened by hoo2 about rubick cube solution mind algorithms.

day 4 (7/7)

day began with openoffice testing again. cmpachar did a great job there.

a new page added to the event wiki, since we managed to convience a young user for the benefits of free software (potato guy really helped on this one).

playing potato guy

highlights: openoffice greek build testing completed for the greek build by cmpachar and me, glezos and alupo completed the transifex task, elias and manolis translated openoffice templates to greek, pantelis and hoo2 almost finished adding usb dsl modems support at the network manager.

totally 16 hackers joined the greek coding camp. we had great fun, combining swimming at the libyan sea and tsikoudia with coding. i hope this will be a new event series in greece, so we can terrorize every greek camping with our geek conversations and habits :D

July 7, 2009 :: Athens, Greece

Dion Moult

A little math probablility problem.

I was originally planning tomorrow to post the new Perspective Magazine for you to ogle at (distribution on Friday!) but I shall delay that and you shall be rewarded for waiting with a PDF you can download of the magazine. Ooh.

Instead tonight I had some free time (because tomorrow I shall be skiving school spending time productively at home) So I decided to look at an NRICH problem. Yes, that’s right. I was so bored I decided to do math. Edit: Apparently I didn’t notice the star rating system so it seems as though I picked an easy one.

Click to see problem: Succession in Randomia

Let’s consider a probability tree:

Diagram2

… OK. The first thing we notice is that it looks prettier. Let’s see the series for B now: 1/4 + 1/16 + 1/64 + … . This is identical to T. We can do the same for L and say we have 2/8 + 2/32 + 2/128 … which is exactly the same as B and T. Plugging it into a/1-r (r being 1/4) we get 1/3 for all three. Hence we can say that in fact it is a completely unbiased way of choosing a successor.

My answer to that question is therefore: “Yeah they have an equal chance

Well, I wasn’t going to stop here. Why don’t I simulate it? Here is the coding that simulates the situation (the cheapest brute force technique to tackle the problem):

If you don’t know programming, go take a read through the code anyway and see if you can get a grasp of what’s going on :)

<?php
// The number of times each king as won.
$bingo = 0;
$toto = 0;
$lotto = 0;

// How many times we are going to do the crowning ceremony
$ceremonies = 10000;

// Loop through these instructions to carry out the crowning ceremony.
for ($i = 1; $i < $ceremonies+1; $i++)
{
    $win = FALSE; # Nobody has become king yet.
    $oddeven = 1; # Because the first throw is odd. Assume 1 = odd, 0 = even.
    $firsttoss = TRUE; # We are tossing for the first time.

    // This variable is used later to determine which variable $x or $y is
    // reassigned a value and which keeps the previous toss value.
    $a = 0;

    // Keep on tossing the coins until somebody wins the kingdom.
    while ($win == FALSE)
    {
        // Here we only flip one coin, this will alternate between $x and $y.
        // The one ($x or $y) that isn't assigned a new value will retain the
        // previous toss value so we can find out whether or not we have got
        // two HH or TT in a row.
        // Assume H = 1, T = 2
        if ($a == 0) {
            $x = rand(1,2);
            $a = $a + 1;
        } elseif ($a > 0) {
            $y = rand(1,2);
            $a = 0;
        }

        if ($firsttoss == TRUE) {
            // Nobody can win on the first toss.
            $firsttoss = FALSE;
        } else {
            // If it is HH and ODD...
            if ($x == 1 && $y == 1 && $oddeven == 1) {
                // Lotto will become King.
                $lotto = $lotto + 1;

                // Somebody has won the Kingdom.
                $win = TRUE;
            }

            // If it is TT and ODD...
            if ($x == 2 && $y == 2 && $oddeven == 1) {
                // Lotto will become King.
                $lotto = $lotto + 1;

                // Somebody has won the Kingdom.
                $win = TRUE;
            }

            // If it is HH and EVEN...
            if ($x == 1 && $y == 1 && $oddeven == 0) {
                // Bingo will become King.
                $bingo = $bingo + 1;

                // Somebody has won the Kingdom.
                $win = TRUE;
            }

            // If it is TT and EVEN...
            if ($x == 2 && $y == 2 && $oddeven == 0) {
                // Toto will become King.
                $toto = $toto + 1;

                // Somebody has won the Kingdom.
                $win = TRUE;
            }
        }

        // ... If nobody has won anything ...
        if ($win != TRUE) {
            // We flip again, so Odd->Even or Even->Odd.
            if ($oddeven == 0) {
                $oddeven = 1;
            } else {
                $oddeven = 0;
            }
        }
    }
}

// Tell the computer to print out what results we have.
echo 'Bingo: '. $bingo .'<br />';
echo 'Toto: '. $toto .'<br />';
echo 'Lotto: '. $lotto .'<br />';
?>

I ran it and here is an example result I get. Out of 10,000 ceremonies, this is the number of times each king has won:

Bingo: 3322
Toto: 3340
Lotto: 3338

Pretty close, eh?

No related posts.

July 7, 2009 :: Malaysia  

Roderick B. Greening

usb-creator-kde - available for testing

So, I meant to post this up a couple of weeks ago... better late than never.

I have posted an early beta copy of usb-creator package in my PPA. It contains packages for both the gtk and kde front-ends and a common package, which contains the back-end, and some other common bits.

If you are interested in trialing the beta, feel free to download the debs or add my PPA to your sources.list (if you add it to your list, please read the warning on my PPA page).

To get the files, navigate here.

Here are some screenshots showing the kde front-end in action. Enjoy!







July 7, 2009 :: NL, Canada  

July 6, 2009

Brian Carper

Tokyo Cabinet, Engage

I posted recently about being dissatisfied with how my blog was playing with MySQL. I was going to try for some kind of file-based storage, but in the end I decided to go with Tokyo Cabinet, which is a very lightweight key/value store.

This simplifies a lot of code, because a blog is pretty much one list of objects (posts) with a bunch of sub-objects (tags, categories, comments). An SQL DB is made for independent objects that are related to each other via keys. So storing a post means deconstructing it into its parts and stuffing all the parts into their own tables, and fetching a post means fetching all the parts and putting it back together. A bit of a bother.

With a key/value store, a post is a hashmap, and it has sub-lists of comments and tags etc., and you serialize the whole thing and stuff it into the DB; when fetching you un-serialize it and you're good. Clojure being a Lisp, there's already a nice serialization format (s-expressions), so there's hardly any work to be done.

I'll give it a few days and if everything actually works, I'll push the code to github. The code is still pretty nasty and ad-hoc; I did this rewrite in the matter of a couple of hours on a weekend. But parts of it may be useful to someone.

I also plan to do some kind of simplified "How to make a blog in Clojure" tutorial in the near future. The code for this blog is bloated with a lot of functionality that is pretty specific to my site and that most people don't need. A more to-the-point tutorial would probably be more helpful.

July 6, 2009 :: Pennsylvania, USA  

July 5, 2009

Daniel Robbins

Apache/Slowloris DOS Mitigation Guide

My friend Ryan Vick and I just finished up our Slowloris DOS Mitigiation Guide. We hope you find it useful. We detail various ways to protect against the Slowloris DOS, and have a few surprises along the way. Give it a read and let us know what you think!

Covered in the article: anti-slowloris.diff, iptables connlimit, proper hardware load balancer configuration, Cherokee web config

July 5, 2009

July 4, 2009

Dan Ballard

cl-pack 0.1.1

I've released cl-pack 0.1.1. Just a few code improvements suggested by Zach. This is just light stuff, some slight tweeks to be more in line with lisp standards and a few small speed up using native functions I didn't know about instead of my own code.

He'd suggested some more radical changes too, the biggest being to turn the two pack/unpack case statements into macro-foo so that I could just go

 
(define-directive #\i ...)
 

all on its own. I gave it a good try and pretty much got it working, but it unfortunately spits out about 125 style warnings, increased the code by about 100 lines or ~ 20% and I'm not sure in the end if it really was any clearer, so I scrapped that for now and am just releasing the basic easy changes and moving onto a few more features.

The planned release will be hopefully something like a few more features for 0.2.0 and then if nothing explodes, release it as 1.0 and cl-pack should be done-ish.

July 4, 2009 :: British Columbia, Canada  

Roy Marples

On the importance of MTU

So, I'm now finally natviely IPv6 enabled :)

This led to an  interesting debtate about my internet connection. In a nutshell my  Drayetk Vigor 100 is broken, but apparently by design. The problem is this - for IPv4 goes through my NAT whose public IP has an MTU of 1492 so Path MTU Discovery works fine. However IPv6 does not need NAT and the PPPoE interface does not have a public IPv6 and nor do the internal clients use it even it there was one. So the path MTU is 1500, which is too big for the PPPoE to handle.

The correct solution is to obviously terminate the IPv6 on a PPPoA connection, but only the  Cisco 877 router does this and that's outside of my price range, even on eBay. One solution is to clamp the MSS on the router to 1430 so that all clients work. But this is a hack. The best solution with my hardware is to force the MTU to 1492 for all nodes inside my network, so they share the same MTU as the PPPoE so that Path MTU Discovery works.

You can see this working for yourself on IPv6 now, as this site is IPv6 enabled and sits behind the PPPoE link. You'll need to query IPv4 servers for the address though as I don't yet have a glue record for IPv6, but as I'm changing registrar that should change in a few weeks :)

Because of this, I've made the dhcpcd default to request and use the MTU value if offered by the DHCP server. You'll be seeing this in dhcpcd-5.0.5 (now out). dhcpcd-5.0.6 will feature restoring the MTU correctly between leases.

July 4, 2009

Dan Fego

Auto-detecting a USB Headset

After a lot of trial and error today, I’ve still only gotten part of the way to my objective: making my new Plantronics USB headset get auto-detected in Gentoo, and make it my “primary” ALSA device. That is, when it’s plugged in, all audio goes to it, and when it’s not, all audio goes to the speakers. Much, much easier said than done.

The first hurdle was coming to the realization that ALSA in fact sees this headset as its own sound card. Once I got that far (it took me a while, with some help on IRC), all I needed in the end was 4 additional lines in my /etc/modprobe.d/alsa file:

alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-hda-intel
options snd-hda-intel index=1

alias snd-card-1 snd-usb-audio
alias sound-slot-1 snd-usb-audio
options snd-usb-audio index=0

The first 2 lines were already there, and then I added the two lines about snd-card-1 and sound-slot-1. Easy enough. The other two lines (not counting the whitespace) are to tell the system what order they go in. 0 is primary, 1 is second, etc. So by having index=0 for snd-usb-audio, that device is my first card, and the on-board is my second. Easy enough. I kept getting fouled up in testing my various configs by not actually removing the modules; I was just restarting ALSA. Not good. Once I got that config working, I wrote a couple of bash scripts to flip those variables, update the configs, etc. Here's my "on" script:

#!/bin/bash
# Script to swtich around audio devices when headset plugged in
if ( grep -q "options snd-usb-audio index=0" /etc/modprobe.d/alsa )
then
echo "Exiting..."
exit 1
fi

sed -i '/options snd-hda-intel/ s/0/1/' /etc/modprobe.d/alsa
sed -i '/options snd-usb-audio/ s/1/0/' /etc/modprobe.d/alsa
update-modules -f
/etc/init.d/alsasound stop
sleep 0.5
modprobe -r snd-usb-audio
modprobe -r snd-hda-intel
/etc/init.d/alsasound start
sleep 0.5
/etc/init.d/mpd start

It's simple enough, in retrospect, and it works. The "off" script is identical except it does the reverse flip at the beginning. I could have made it one script, but whatever.

The next step was to make this all happen automatically. That's where I'm stuck. I've been tinkering with udev for hours now, and I can't seem to write the rules right. My current rules look like this:

ATTRS{id}=="U0x47f0xc001", ACTION=="add", RUN+="/home/dfego/bin/udev-headset-on.sh", ENV{IS_PLANTRON}="yes"
ENV{IS_PLANTRON}=="yes", ACTION=="remove", RUN+="/home/dfego/bin/udev-headset-off.sh"

I don't even remember now if this particular "add" works, but some of the ones I wrote today did. However, not one, not a single one of my "remove" lines worked. All day. None of them. It's almost depressing. For some God-forsaken reason, I can't make anything trigger on a remove event. So I tried using a single script and having it go on all events, but that fell on its face because udev insists on running it lots and lots of times every time an event happens, even when I built protections into the script that it couldn't run more than once simultaneously. So I don't know what to do. For now, I'm just going to be happy with what I've done and use the script. It's not like I plug my headset in and out all that often (except, of course, today). But I feel sad and defeated, and very much like I wasted a ton of time doing something that doesn't work for some reason beyond my comprehension. It should work... it just doesn't.

Maybe I'll try again one of these days. Maybe not.

July 4, 2009 :: USA  

July 3, 2009

Steven Oliver

AUTO_INCREMENT Part 2


Back in June I discussed how Oracle databases don’t have an AUTO_INCREMENT type. In the process of this discussion I showed a way around this. While I like this method in certain situations, in others it has several flaws that really bug me. First off and foremost if you are using your table as a log tracking the progress of a process than you’ll have to reset the sequence every time you restart the process. Well, I guess that assumes you, like myself, truncate or delete * from that table every time you run the process. Either way, I think that should be an unnecessary step. It’s sort of like having an UPDATED_ON column and actually feeding it the SYSDATE every time you do an insert. Why not just set DEFAULT SYSDATE when you create the table?

Now my second method for replacing the AUTO_INCREMENT type has it’s flaws as well, but it works quite well for the log style table I described above. This time we won’t use a SEQUENCE at all though. Instead we’ll simply use the rowcount(*).

CREATE OR REPLACE TRIGGER state_trg
BEFORE INSERT
ON scheme.state_table
FOR EACH ROW
BEGIN
SELECT rowcount(*)+1 INTO :NEW.column_pk FROM state_table;
END;

Now before you go crazy and start adding this to all kinds of tables be careful, this method isn’t perfect either. First if you ever delete from the table without truncating or deleting * you’ll (hopefully) get a unique constraint violation error. Hopefully why will be obvious. Again, the code has it’s uses, it’s up to you decide when and where it’s a good or bad idea.

Enjoy the Penguins!

July 3, 2009 :: West Virginia, USA  

Paulo Roberto

HOWTO – Servidor DAAP no FreeBSD

O Firefly (antigo mt-daapd) é uma implementação DAAP (Digital Audio Access Protocol) que é o protocolo utilizado pelo iTunes para compartilhar as bibliotecas de audio na rede. É compativel com iTunes no Windows e no Mac OS X assim como players compativeis com DAAP como o Amarok. Portanto é uma boa idéia manter um repositório de mídia centralizado em um servidor na rede.

A homepage do projeto é http://www.fireflymediaserver.org/. Além de servidor DAAP o Firefly provê mais alguns goodies. Vale a pena checar.

Instalação:

A instalação no FreeBSD é bastante simples. Considerando que voce tenha o ports (e saiba usa-lo) apenas instale-o a partir de /usr/ports/audio/firefly. Não há qualquer problema em manter os padrões sugeridos para as dependencias.

Configuração:

Adicione “firefly_enable=”YES” e edite o arquivo de configuração /usr/local/etc/mt-daapd.conf. Lembre-se de criar as pastas usadas para a database e certificar-se de que pertencem ao usuário daapd. Inicie o serviço via /usr/local/etc/rc.d/mt-daapd start. As configurações e atualizações manuais da biblioteca de midia podem ser manipulados pela interface web http://<server>:3689.

O firefly se anuncia na rede utilizando o Bonjour da Apple e pode conflitar com o Avahi.

Se voce completou os passos descritos acima com sucesso, poderá visualizar sua biblioteca de audio nos computadores de sua rede local através do iTunes ou Amarok.

July 3, 2009 :: Brazil  

Dion Moult

Blender 2.5 Features Video

blender2.5-dev1Hello everybody, I’m back from my 5 day jungle trek and I’m just catching up on what I’ve missed throughout the week. I was initially going to award you all with a post about the trek itself, but it turns out Jonathan Williamson from Montage Studio (the very same who does the Blender screencasts and gave some good tips for ThoughtScore) has got himself a Blender build for Windows 7 and has recorded a short screencast demo-ing the development.

I am truly amazed with what has been going on and I will definitely throw myself back into Blender this holiday and its stuff like this that really shows what open-source is capable of. Blender is one serious threat to the huge commercial monopoly in the 3D industry. Here is a short list of the features he describes:

  • New design/look
  • Panel splitting/deleting/management
  • Not limited to one window only
  • Massive reorganisation of features that make it more intuitive
  • Real-time playback animation while editing
  • Real-time playback animation while rendering
  • Every single value in Blender can now be animated
  • Support for macro options
  • New transform panel
  • Search option for features

Without further ado:

Clicky here to watch the video.

Related posts:

  1. The Blender Model Repository and BlenderNation: open-source merger?
  2. Blender 3D: Architecture, Buildings and Scenery – Review
  3. Blender Suzanne Awards announced.

July 3, 2009 :: Malaysia  

Iain Buchanan

The Twouble with Tcl

From time to time I do a bit of tcl. Mostly as maintenance for existing tcl programs. I haven't made up my mind entirely about it yet - I've seen some very powerful programs in tcl, and yet occasionally I'm still "surprised" by a feature.

I spent a couple of hours today trying to figure out why a tcl program of mine wasn't running, and so I've made some notes:

Real languages don't have reserved words


In tcl, you can redifine parts of the language in tcl itself. For example if you wanted to redefine if, just write a new function:
proc if {cond expres} {
puts "cond is $cond"
puts "expr is $expres"
}

set a 1
if {$a == 1} {
puts hello
}
Sounds neat. In fact proc itself is just a command that takes 3 arguements (name, arguements, and body). However, don't start using simple names in your tcl languages like this:
proc open {} {
set ::alarm_socket [open_socket $::options(-alarm_host)]

foreach host $::options(-hosts) {
verbose "open $host"
set ::sockets($host) [open_socket $host]
# set up an event handler for when data is readable on this socket:
fileevent $::sockets($host) readable [list process $host]
# initialise socket timeout with open time
set ::socket_t($host) [clock seconds]
}
}
Because open is what you might call a reserved word. (I should have known with open, but should I really have to remember all the reserved words?)

The error looked something like this:
$ ./test.tcl
invalid command name "::tcl::tm::UnknownHandler"
while executing
"::tcl::tm::UnknownHandler ::tclPkgUnknown msgcat 1.4"
("package unknown" script)
invoked from within
"package require msgcat 1.4"
("uplevel" body line 2)
invoked from within
"uplevel \#0 {
package require msgcat 1.4
if { $::tcl_platform(platform) eq {windows} } {
if { [catch { package require registry 1.1 }] } {
..."
(file "/usr/lib/tcl8.5/clock.tcl" line 23)
invoked from within
"source -encoding utf-8 [file join $TclLibDir clock.tcl]"
(procedure "::tcl::clock::format" line 3)
invoked from within
"clock format [clock seconds]"
(procedure "alarm_timeouts" line 3)
invoked from within
... and so on. Yeuch! And it was encountered with this one line:
   puts "$::argv0: [clock format [clock seconds]]"
The problem? I redefined open, which was used internally by clock.

Real languages don't have types:


You can do lots of nice things in tcl without types, in a similar (but different) way to perl.
set a world
puts "Hello $a" ;# prints 'Hello world'
set a 1
incr $a
puts "$a + 2" ;# prints '2 + 2'
This looks normal to someone used to perl and tcl. Noticed how I don't need format specifiers or concat functions. You can also do this:

set a pu
set b ts
$a$b "Hello World"

Which prints:
Hello World

Real languages don't have comments


They have a comment command of course! And the comment command is a command that takes arguments (the comment itself) that aren't evaluated. Except that because of this, you can't have an unmatched brace in a comment:
# if ($sometest) {
$somecode
#}

The tcl solution?
if (0)
blocks or the like...

Conclusion


So if you haven't yet learnt tcl, I encourage you to find a tcl hackers tcl program, and delve into it to see just how it works.

If you try to learn tcl only by writing it and not by reading others' code, then you'll learn tcl with the habits you're used to, and you will possibly miss some of the powerful features.

After all, C programmers can program C in just about any language!

July 3, 2009 :: Australia  

July 2, 2009

George Kargiotakis

Using Firefox Password Exporter

I am using the Password Exporter addon for Firefox to sync my passwords between my various Firefox installations (2 OS on the laptop, 2 OS on the desktop and one for portable firefox on a usb stick). I am using it with version 3.0.X and 3.5 just fine.

I have created a shell script that finds the differences between two exported password files and creates a new xml with the differences of the two so that one can edit it and pick the ones he wants imported.
File: ff-password-sync.sh
To use it follow these two steps on each firefox installation:
Firefox->Tools->Add-ons->Password Exporter->Preferences->Export Passwords
Then use the script (you need bash and mktemp):
$ ./ff-password-sync.sh laptop-password-export-2009-07-01 dektop-password-export-2009-07-02
If it runs successfully you should have 2 files in your home dir:
ff-password-sync.diff: Contains the differences of the two files in diff format
ff-password-sync.xml: Contains the unique username password combinations that are missing
Edit ff-password-sync.xml to possibly remove entries you don’t want imported and then go to:
Firefox->Tools->Add-ons->Password Exporter->Preferences->Import Passwords
and load ff-password-sync.xml

If you engage in this process it’s almost certain that you will hit this bug:
“Can’t add a login with both a httpRealm and formSubmitURL.’ when calling method: [nsILoginManager::addLogin]“

The fix is provided by a user on his blog: Fix for Firefox’s Password Exporter Add-on

July 2, 2009 :: Greece  

Sean Potter

Wishing for more KDE integration

An effective Linux desktop is made up of various sets of software, using various programming languages, paradigms, toolkits, and more. The two major desktop environments competing for top dog are obviously KDE and GNOME. I've been using KDE since the 2.x days, and it was X-Windows before that. I have to admit that KDE4 is bringing a lot of improvements in desktop usability, but there's a lot of non-KDE programs out there that I use on a daily basis that simply don't work as nicely as I'd like to see.

  • Firefox - My only real complaint about Firefox is the lack of support for the QT toolkit. Yes, there is a project going on to port it over to QT... sadly, the progress is slow and the usability isn't there yet.
  • Thunderbird - KMail isn't that bad, but it randomly crashed on me. For that reason, I use Thunderbird. Again, no QT support. My other complaint is that the "Message Checker" plasmoid doesn't support Thunderbird for checking mail.
  • Pidgin - Kopete doesn't stand a chance against Pidgin. It's a more solid codebase, and much more widely supported. I think Kopete would benefit more if they build a QT client for libpurple, Pidgin's backend.
  • OpenOffice.org - This has shown the most improvement in this area over all the other programs I've listed so far. QT4 support finally arrived a week or so ago, and now I'm just waiting for Gentoo to update Portage. KOffice is a very nice office suite, but OpenOffice.org is a much more robust application.

Reasons such as those above are what have sparked my interest in developing a QT4 client for XMMS2. I'm hoping that in the near future we'll see more KDE/QT4 compatibility with some of these programs I've listed.

July 2, 2009

Patrick Nagel

VirtualBox 3 – SMP for guests

VirtualBox – my current favourite desktop virtualisation software – has been released in version 3.0.0 two days ago, so I gave it a try. The most interesting new feature in this new version is the “Guest SMP” support. It finally removes the limitation, that a guest can only work on one host core (which means, when you have a 4-core host CPU, the guest could only run with 1/4 of the speed).

The documentation is not very clear about what “Guest SMP” really does – it could, for example, just show multiple CPUs to the guest, but still only use one host core. To make sure that my assumption of VirtualBox 3 actually making it possible to assign multiple host CPUs/cores to the guest, so that it can actually run faster, I did a quick test. I started by making one of my Linux VMs a dual CPU VM:

vbox3_multi_cpu2

In the VM, I then started to build the Linux kernel, once with make -j1 and once with make -j2. This is my CPU usage monitor on the (2-core) host, which shows both cores’ usage combined:

vbox3_multi_cpu

In section 1 of the graph, only one compiler process is running (make -j1). At the end of section 1 I aborted the building process and (in section 2) I typed in make -j2. Thus, section 3 shows the CPU usage when two compiler processes are running simultaneously in the VM. So my assumption was correct, it is now possible to make all of the host’s processing power available in a VM.

Thanks, VirtualBox team! (I won’t address the company behind VirtualBox, since this would probably cause my post to be outdated before I can press the “Publish” button). Lets just hope that this great project will see further development, it is currently the best desktop virtualisation project available, in my opinion. It would be even greater if all of the functionality was available in the Open Source version though. This would ensure that, no matter what the current company behind VirtualBox decides to do with it, development could go on.

July 2, 2009 :: Shanghai, China  

July 1, 2009

Steven Oliver

24″ HP Monitor vs Fonts


What on earth is it about monitors that makes them all render my fonts differently??

At work I have twin DELL 19″ 3:4 LCD displays. At home a 24″ HP 16:9 LCD and they seem to render things completely differently. It’s enough to drive me nuts. One thing of note though is I only really seem to have trouble with this using gVim. Is the font rendering code in vim so old that switching monitors ruins the font??

Enjoy the Penguins!

July 1, 2009 :: West Virginia, USA  

June 30, 2009

Dirk R. Gently

Restore Settings on a Broken Firefox


When people have a problem with Firefox I’ve seen many people will resort to deleting their old profile (or folder) and creating a new one. This works, but doing this though will get rid of any passwords, history, bookmarks… you may have. I recently deleted the Microsoft fonts on my installation and Firefox began to display alot of site with monospace – thought I was still in vim :) . Having used Firefox quite a bit, getting a new profile was a good idea anyhow as cruft and buggy configs can slow down the browsing experience.

Details

First you’ll need to get to your Firefox configs:

cd ~/.mozilla/firefox/

Backup your old profile and profile list:

mv xxxxxxxx.default{,.bck}
mv profiles.ini{,.bck}

Create a new profile:

firefox -CreateProfile <profilename>

This command will tell you the name of the new folder. Copy important information to the new profile:

cd *.default.bck
cp places.sqlite key3.db formhistory.sqlite signons3.txt persdict.dat content-prefs.sqlite ../*.<profilename>

This will transfer your bookmarks, browsing history, form entries, passwords, personal dictonary changes, and page zooms. There might be a couple other things you’d like to add (possibly your firefox preferences), take a look at Transferring data to a new profile.

June 30, 2009 :: WI, USA  

Daniel Robbins

10th Anniversary of Gentoo

NeddySeagoon and I have been trying to figure out the official 10th anniverary date of Gentoo, and here are the dates I've figured out so far:
  • July, 1997 - Started a new position at University of New Mexico, was using Debian 1.3
  • Nov, 1998 - Was using/developing for Stampede Linux at home, but had not (yet) started Enoch?
  • Apr, 1999 - Was working on Enoch - wrote xpak .tbz2 code that is still in Portage
  • May 18-27, 1999 - First version of Enoch released, according to LWN.net. My blurb for Enoch: "Enoch is an advanced GNU/Linux distribution for the x86 PC Architecture, designed to bring your Linux experience into a new dimension. Or something like that."
  • Aug, 1999 - My new dual Celeron mobo would not run Linux, went to FreeBSD, Achim Gottinger kept Enoch going
  • Late 1999 - Must have came back to Enoch and done the Gentoo name change right about now - the "Gentoo" name was Bob Mutch's idea - started incorporating some FreeBSD ideas into Enoch - Portage (as we know it today) was born.
  • July 26, 2000 - Gentoo 1.0 release "imminent", cvs online, rsync "coming soon"
  • Nov 3, 2000 - Gentoo 1.0 Release Candidate 2
  • Dec 11, 2000 - Gentoo 1.0 Release Candidate 3
  • Aug 14, 2001 - New Gentoo Logo/Web site debut - designed by me! Still in use today! :)
  • Feb 16-17, 2002 - Was in Brussels, Belgium to attend FOSDEM
  • Mar 31, 2002 - Gentoo Linux 1.0 Released !!!
  • May 10, 2002 - Gentoo Listed as one of the top 10 Linux distributions on DistroWatch
  • Apr 8, 2002 - Gentoo Linux 1.1a released :)
  • Jun 10, 2002 - Gentoo Linux 1.2 released :)
So, we're thinking of calling "late 2009" the official 10th anniversary of the birth of Gentoo - whaddya think? If it sounds good, we need to get the party planning committee together...

June 30, 2009

George Kargiotakis

nicotine+ 1.2.12 ebuild

I’ve uploaded an ebuild for the latest version of nicotine+ on gentoo’s bugzilla. Nicotine+ is a great p2p app written in PyGtK2 to connect to the Soulseek network.

I’ve also added psyco as a USE flag since it makes nicotine+ faster…but sadly, a bit more unstable as well. Test it and see if it makes any difference to you.

Ebuild: nicotine+-1.2.12.ebuild

June 30, 2009 :: Greece  

June 29, 2009

Jason Jones

Zend Studio on Gentoo AMD64

Since I've been job-hopping for the last bit, I've had the chance to install fresh gentoo builds on quite a few 64-bit computers in the last couple of months.

I've also been looking at different IDEs for PHP development.  After using jEdit now for close to 5 years, I've gotta say the one which impresses me the most is Zend Studio for Eclipse - (freely available (albeit crippled) at Zend.com).

The first computer I installed it on, didn't give me any grief at all.  It just worked.  The next few, however, because I was installing from scratch, gave me a few problems, so I thought I'd jot down what is needed in order for ZendStudio to properly install and execute.

If you have a 64-bit computer, the following libraries are needed, but never explicitly requested.  I'm pretty sure if you have a 32-bit computer, everything will work just fine out of the box.

  • emul-linux-x86-java (required for installation.  Installation will fail without it)

  • emul-linux-x86-gtklibs (required for execution.  If not there, ZendStudio will simply exit right after invocation, with no GUI loading at all.



After those two are installed, (along with some sort of X-Window system, of course) things should work just fine.

Hope this helps someone.

June 29, 2009 :: Utah, USA  

Daniel Robbins

Metro 1.4.1 Released

Metro 1.4.1 has been released! I have new documentation online, now hosted on funtoo.org:

June 29, 2009

Dirk R. Gently

Keyboard Template


I needed a keyboard template and I couldn’t find any so I made one (uh kinda). The outline was made by aphasia100stock:

Notes

  • Converted from .ai format to .svg
  • Removed inner borders
  • Added Letters, Numbers, Symbols
  • Added guidelines to be able to reference keys.

Download svg

Thanks aphasia100stock for the outline.

Enjoy!

June 29, 2009 :: WI, USA  

June 27, 2009

Daniel Robbins

Anti-Slowloris DOS patch in Funtoo

I've committed an anti-slowloris patch to Funtoo, in apache-2.2.11-r1. I recommend that Apache users upgrade to this new version. (see http://bit.ly/WGSvD)

All still-affected MPMs (everything except prefork) have been masked. The intent here is to force you to use an Apache configuration that is not vulnerable to slowloris. If you are in a situation where slowloris cannot affect you, you can manually enable the other MPMs to gain access to them.

I tested the anti-slowloris patch myself on a Drupal installation I had on my machine. Without the patch, slowloris was able to make Apache unresponsive immediately. With the patch, Apache was a bit laggy but continued to run with no problems.

June 27, 2009

June 26, 2009

Daniel Robbins

Apache Slowloris DoS is Nasty - Protection Guide in Works

The Apache SlowLoris DoS is a pretty nasty thing. If you are running Apache (who isn't) then I strongly recommend you look carefully at the link above, learn about how this exploit works, and ensure that your infrastructure is safe.

If you are running Apache or IBM Web servers that are directly exposed to the Web, you are vulnerable. If you have a load balancer in front of your Web site (most of us don't) you may still be vulnerable. Your load balancer needs to be configured to protect against this DoS, many (including Cisco) need to be told to do so and do not protect by default. So test to ensure your infrastructure is protected.

From what I've read, if you have a squid proxy in front of Apache, you should be safe, but we have not confirmed this yet.

I'm planning to get a SlowLoris Protection Guide available early next week which will help to provide detailed information on how to protect against this particularly nasty DoS.

I also think that the Apache team's historical response to this very preventable issue has been horrendous - we all run Web servers in the real world, not some theoretical happy world, and it's Apache's job to ensure that it manages its own resources properly. For future Web-related efforts, I think I'm going to be avoiding Apache and looking at the Cherokee Web Server.

June 26, 2009

Brian Carper

Clojure, SLIME, ODBC, SQL Server

I had a lot of trouble connecting to an MS SQL Server at work via Clojure. Java 6 comes with a JDBC-ODBC bridge which worked fine from a Clojure REPL at a command prompt, or from inferior-lisp in Emacs, but in SLIME it would hang every time I tried to connect and I'd have to kill Java. Couldn't for the life of me figure out why.

I got it to work eventually by using Microsoft's own JDBC driver, which you can download here.

Once you put the downloaded .jar file on your CLASSPATH (in my case, sqljdbc4.jar) you can connect like this:

user> (def db {:classname "com.microsoft.sqlserver.jdbc.SQLServerDriver"
               :subprotocol "sqlserver"
               :subname "//server_hostname;database=SomeDatabase;user=SomeUser;password=SomePassword"})
#'user/db
user> (use 'clojure.contrib.sql)
nil
user> (with-connection db 
        (with-query-results rs ["SELECT * FROM whatever"] (prn rs)))
... results ...

Posted for the sake of Googlebot and for my own future sanity.

June 26, 2009 :: Pennsylvania, USA  

Daniel Robbins

Initscripts - Keeping It Simple

I've been reviewing Roy Marples' 0.5.0 release of OpenRC for inclusion in Funtoo (we're currently at 0.4.2,) and the big change with 0.5.0 is that Roy has ripped out the existing networking functionality, and replaced it with something a lot simpler.

I think this is a step in the right direction, but I'm leaning towards "going all the way" and ripping out networking support entirely, in favor of having Funtoo-supplied /etc/init.d/net.* templates that actually call the route/ifconfig/ip/vconfig/brctl commands directly, and users can modify to suit their needs.

Why do this? Here are some reasons:
  1. WYSIWYG - no need to figure out some kind of distro-specific network configuration layer that is supposed to make things easier for you.
  2. It encourages (but does not force) users to become familiar with the ifconfig/ip/route commands, which is a good thing.
  3. It is the most flexible option, since it allows you do get as freaky with your network as you want.
  4. It allows users to leverage the dependency-based functionality in the initscripts for their own purposes - the dependency functionality was designed to be used by end-users.
  5. Theoretically faster.
  6. Self-documenting.
  7. Simpler.
  8. Reduces footprint of the initscript code (reduced maintenance.)
Now, here are some negatives, along with how I hope to address them:
  1. It's more complicated - Yes, slightly, initially, which means Funtoo network documentation needs to be written to help users. Several easy-to-use /etc/init.d/net.* samples need to be available for beginners. That will make things easy for networking newbies.
  2. Configuration gets stored in /etc/init.d rather than /etc/conf.d (where some might say it "should" be) - This, I do not really agree with, so I don't see it as a significant negative. I don't think that /etc/conf.d should be a mandatory design rule for storing configuration. For networking, putting configuration in /etc/init.d is simpler - users who like /etc/conf.d can still use it, and I can have our templates be usable with /etc/init.d or /etc/conf.d for configuration storage. And designing complex network configuration scripts just for the sake of getting all network configuration stuffed inside variables in /etc/conf.d is not a winning strategy.
  3. Not desktop-friendly - Some might say that Gentoo and OpenRC network configuration scripts isolate the user from the complexity underneath, and are thus better. In theory, this may be right - in reality, it creates another distro-specific configuration layer you need to learn, and developers need to maintain. And it's not significantly easier, really.
So, I think this is the right way to go. Let me know what you think.


June 26, 2009

June 25, 2009

Sean Potter

New Beginnings

I deleted all my old posts. It was about that time. I have a record of them all for myself to look at, but there's no need for them to plague the internet any longer. I figured it was time for some change, as my life has been so plagued with trouble these past few months. Maybe this is exactly what I need.

Things are going well. I'm looking for a new job, and contemplating how I'd like to finish up my bachelor's degree. For the time being, I think I'm going to stick with the restaurant industry. Honestly, I love the people, and I love the hours. A 9-5 job seems so boring to me, and I've never been one to get up early more than two days in a row.

I have some exciting projects I'm slowly working on. Obviously, number one is BIOSLEVEL, my group's product review site with an open source-twist. It's down at the moment, but I promise it won't be down much longer. I just need to finish interfacing with phpBB3 and make a few other small adjustments before it will live again.

Also in my newfound spare time, I started working on a QT4 XMMS2 client. I don't have much accomplished outside of an interface, but it's promising. I'm not a fan of Amarok, and using a GTK-based audio player just isn't pretty. I'd like to incorporate many different ideas into it such as Last.FM browsing, multiple playlists, iPod support, and much more. Once I have a little more going, be certain that there will be a post here about it

June 25, 2009

Dirk R. Gently

Getting Help from Console


If you’re in console (aka virtual console) doing an install or repairs on a system, it’s good to know how to get help if problems occur.

“Ground Control…”

To get help in console you can use a chat client. Read this page on how to set up irssi – a terminal/console IRC program. The guide will walk you through setting up irssi and connecting to freenode where many Linux distribution chat channels are located.

“Waiting for details, Houston…”

When you tell the people in the chat-room what your problem is, sometimes they will need to know additional information. This could be the output of a command or the contents of a configuration file. To do a command without leaving irssi do Ctrl+Alt+F2 (F3, F4… can also be used) to enter another console, then enter the command.

Be better not to have to write everything down on a notepad and then type it into irssi, this is where it becomes useful to use a collaborative debugging tool like pastebin. Pastebin is a website that temporarily holds configurations, bug outputs… that you can refer other people to get help. There are several tools that can be used from the command line that can send files to a pastebin service, for example pastebinit. Add pastebinit from your distro, then upload a file. For example, your xorg.conf file:

pastebinit /etc/X11/xorg.conf

For uploading the output of a command, first you have to put it into a file:

fdisk -l &> partitions.txt

&> will redirect all output to a text file (both standard output and error output) and now it can be uploaded.

“I have visual…”

Occasionally you might need to actually show a picture of what your question is about (e.g. if you have a question about a console-based installer). For this you can use fbshot. fbshot is a framebuffer screenshot program. To take a screenshot of the first console (Ctrl+Alt+F1):

fbshot -c 1 console1.png

Then you can use links and a image-hosting website to upload the image.

June 25, 2009 :: WI, USA  

June 24, 2009

Jürgen Geuter

Porting as iterative software development (who cares whether it's Mono?)

A few days ago I wrote about people complaining that somebody was "wasting time" by porting Tomboy from Mono to C++ in a project called Gnote. Other people like it cause it frees them of the danger that is Mono and whatnot.

So what should we call this port of a program from one language to another one? Waste of time? Rescue from the patent-trap? How about we are all revolutionary and call it just what it is? Software development.

Let's just leave the snake pit that the whole Mono discussion is for a bit and look at something a lot less overcharged with FUD and suspicion, let's look at Python development.

In Python you usually write Python code to implement the functionality you need (wow who saw that one coming? ;-) ), but since Python is not really the fastest running language (it's interpreted and lacks a JIT after all [at least CPython does]) it's quite usual to port your library to C for the heavy lifting: After you have the functionality working (and you've got unit tests of course) you start rewriting parts of the library in C to be able to gain native speed. Most cryptographic libraries in Python go that route because crypto-algorithms are bloody expensive.

Does anyone call it a waste of time? No. Why? Because even if the direct porting might not even be a lot faster it will probably be in the end. It's just the normal process of development.

When I need to create something new, I first start building some prototype of sorts. To build prototypes I use the tool that allows me to get the prototype up to where it needs to be as quickly and efficiently as possible: When I need to design a GUI, I use paper or a whiteboard, when I wanna design a library I hack together a quick implementation in a dynamic language that makes developing things in an agile way easier (for me that means usually Python though Prolog has been good to me at times, too). Prototyping is a really important step in development because only when you prototype you can really see whether the basic idea that your mind created actually works.

Now let's go back to the whole Gnote thing. We have a working app, why would someone take a different language/platform to implement it? Well cause nobody (probably someone will come and say they do but I think most people don't ;-) ) prototypes in C++ because C++ isn't great for that. All the little things you have to manage make it harder to get to the point where the prototype is good enough so you use something else. Maybe Mono. Now we have an app that works, which means the file format to store things works, basic conceptual problems have been ironed out. The prototype has done its job. Of course we can keep it, develop it further but maybe someone thinks it's time to take what we learned from the prototype and reimplement it in a language that allows things to run faster, less resource consuming and whatnot. That's not a bad thing and not even against the prototype implementation (Tomboy in this case), it's just a new way to look at what we've learned to see whether we gain something from doing it differently.

How often have we read about people wanting to have some application or framework rewritten in another language: "Oh I'd love to use RubyOnRails but Ruby is just so slow!", "Oh I wanna use Django, but Python isn't installed on my webhost, I wished it was implemented in PHP!", "I really like Eclipse but there's no good JRE for my platform and it doesn't run well, I wished it was implemented in C!"? Why do we treat it differently when Mono is involved?

Why does the whole Mono discussion always seem to go towards FUD and flames and people accusing each other of conspiracies? Just look around, it's a completely normal process, one that happens every day all around everyone who develops.

June 24, 2009 :: Germany  

June 23, 2009

George Kargiotakis

Filter out advertisments from greek sites using adblock plus

I’ve decided to start a filter for adblock plus to filter out advertisements from Greek sites.

You can find more information on subscribing to the filter on the page: Greek adblock plus filter.

I started the list a long time ago with some personal filter for sites I visit the most. In order to enrich the list I searched and found a list with the supposedly “top 50″ greek sites (regarding traffic), so I visited them and started adding filters to reduce the ads on them.

I warn you though, the filters are a bit strict…and I don’t like flash ads…I really don’t. I hope you like the list.

Please contact me, by email or by commenting on Greek adblock plus filter page to add your own custom filters to the list.

June 23, 2009 :: Greece  

Kevin Bowling

Mirroring Fedora

Introduction

This post details setting up your own private mirror of Fedora’s repos.  There are many ways to do this, but this method is by far the best for heavy usage.  By using MirrorManager, clients in your IP range need no custom configuration.  Roaming laptop users automagically hit your mirror while on the premises, yet use the public infrastructure elsewhere.  Setup isn’t exactly hard, but it isn’t well documented so I’ll write about my experience here.

Some background info.. we have at least 50 Linux desktops, laptops, servers and VMs running about half Fedora 10 and half Fedora 11 at work.  Due to the number of systems, breadth of packages used, and desire to quickly update when new releases are out, I decided on a full mirror setup.  If you only have a handful of systems, you may be better off simply using a general purpose caching proxy like Squid, perhaps telling MirrorManager to point to it.

This guide should be used in addition to http://fedoraproject.org/wiki/Infrastructure/Mirroring which has some background info.

Initial setup and mirror

First, get prepared by installing MirrorManager-client, which contains the report_mirror script you will need.  If your mirror isn’t running Fedora, you can clone the source of this app from their GIT repo.

yum install mirrormanager-client

You’ll be using rsync, a sysadmin’s best friend, for efficient mirroring.

Set up a shell script like mine below (d0mirror.sh) one level up from where your mirror will be accessible (http, ftp, rsync, nfs - covered later).  This one mirrors against kernel.org.  Choose a mirror close to you on the Internet.

rsync -vaH --exclude-from=fedora-excludes.txt --numeric-ids --delete --delete-delay \
 --delay-updates rsync://mirrors.kernel.org/fedora-enchilada fedora-mirror
report_mirror

And a text file (fedora-excludes.txt) excluding things you don’t want/need.  Take a look through a public mirror and decide if you want to eliminate anything else.  You may want to remove the *.iso line below if you want users to be able to pull disc images from this box.  Otherwise, this is probably a good list for most people.  You can exclude all of linux/updates/testing/ if you don’t enable the testing repo on any of your machines.

**/debug/**
**/alpha/**
**/source/**
**/SRPMS/**
**/*.iso
**/ppc/**
**/ppc64/**
linux/core/**
linux/development/**
linux/releases/7/**
linux/releases/8/**
linux/releases/9/**
linux/releases/test/**
linux/updates/8/**
linux/updates/9/**
linux/updates/testing/7/**
linux/updates/testing/8/**
linux/updates/testing/9/**

Run your shell script and sit back for up to a day or two depending on your connection speed.  My current mirror weighs in at about 80G.

Internal distribution

While you wait for sync, decide how you want to run the service internally.  HTTP is nice because it is easy for users to browse and decently quick with keep-alive.   Using NFS, rsync, or FTP may be a bit more efficient if you are worried about this.  You can list several URLs in MirrorManager for the best of all worlds.

Add the following to your Apache configuration if you decide to use HTTP:

Alias /fedora/ "/mnt/ar1/fedora-mirror/"

AddType application/octet-stream .rpm

<Directory "/mnt/ar1/fedora-mirror">
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>

<LocationMatch "\.(xml|xml\.gz|xml\.asc|sqlite)">
    Header set Cache-Control "must-revalidate"
    ExpiresActive On
    ExpiresDefault "now"
</LocationMatch>

Set up any other services of you choice to push that directory out in addition.

Working with MirrorManager client and server

Next, open up /etc/mirrormanager-client/report_mirror.conf.  Take notice of the site name, password, and host name.  You will need to set these up in MirrorManager in a bit.  The paths here are all local and used by report_mirror to check what you have available.

# if enabled=0, no data is sent to the database
enabled=1
server=https://admin.fedoraproject.org/mirrormanager/xmlrpc

[site]
# if enabled=0, no data about this site is sent to the database
enabled=1
name=<yoursitename>
password=<yourhostpassword>

[host]
# if enabled=0, no data about this host is sent to the database
enabled=1
name=x345-a2.internal
# if user_active=0, no data about this category is given to the public
# This can be used to toggle between serving and not serving data,
# such enabled during the nighttime (when you have more idle bandwidth
# available) and disabled during the daytime.
# not passing it means leave it alone in the database.

[stats]
# Stats are only sent when run with the -s option
# and when this section is enabled.
enabled=0
apache=/var/log/httpd/access_log
vsftpd=/var/log/vsftpd.log
# remember to enable log file and transfer logging in rsyncd.conf
rsyncd=/var/log/rsyncd.log

[Fedora Linux]
enabled=1
path=/mnt/ar1/fedora-mirror/linux

[Fedora EPEL]
path=/var/www/html/pub/epel
enabled=0

# lesser used categories below

[Fedora Web]
enabled=0
path=/var/www/html/pub/fedora/web

[Fedora Secondary Arches]
enabled=0
path=/var/www/html/pub/fedora-secondary

[Fedora Other]
enabled=0
path=/var/www/html/pub/alt

# historical content

[Fedora Core]
# if enabled=0, no data about this host is sent to the database
enabled=0
path=/var/www/html/pub/fedora/linux/core

[Fedora Extras]
enabled=0
path=/var/www/html/pub/fedora/linux/extras

Log into https://admin.fedoraproject.org/mirrormanager, creating a new account if you need to.  Add a new site with the same name as the config file from above.  You’ll set the site password here, and make sure to check the ‘private’ box if this is only for internal users.  Now, add a host under this site.  The name here should probably be a FQDN of your actual mirror, even if it is internal only (i.e x345-a2.internal from my example above).  Once that is done, add a “site-local netblock”.  This is your public IP network/netmask or network in CIDR notation.  If you only have one public IP, it will be in the format nnn.nnn.nnn.nnn/32.

Almost done.  Now, click Add Category.  “Fedora Linux” is the only one you are concerned with if you followed all the values in this guide so far.  Add the others if needed.  Tell them your upstream source (rsync://mirrors.kernel.org/fedora-enchilada from above) and then your internal URL (http://x345-a2.internal/fedora/linux for my setup).

Conclusion

Once your rsync is complete and report_mirror is done, you should see clients start hitting your box.   Don’t forget to add your mirror script (domirror.sh from above — rsync and report_mirror) to cron!  You may wish to join the private ‘fedora-mirrors’ mail lists to be informed of new releases and changes.

The best thing is that it works across all package requests, including new machines, roaming users,  ‘preupgrade’, etc.   All in all, pretty nifty!  Your users will love you when their upgrades are almost instant!  The Fedora infrastructure is set up very well for mirroring, public and private, and this is how the project copes with the huge demand for new releases.  Comment away if you need clarification or help.

Share and Enjoy: Digg del.icio.us Slashdot Facebook Reddit StumbleUpon Google Bookmarks Print this article! E-mail this story to a friend! Turn this article into a PDF! TwitThis

Related posts:

  1. Fedora 9, KDE 4.0 done right Wow! I just downloaded the Fedora 9 KDE live spin. ...
  2. Syncing Directories with Multiple Computers I have a laptop, a workstation, and a server at...
  3. Kernel developers don’t get Xen The recent bruhaha surrounding Xen on LKML (http://lkml.org/lkml/2009/6/2/475) is really...

June 23, 2009

June 22, 2009

George Kargiotakis

Using halevt to automount media and make them appear on ROX desktop

With the recent addition of halevt in Gentoo’s portage it is now relatively easy to automatically mount media like USB sticks and CD/DVD discs on /media.

What I wanted to do was to emulate my previous set of configs and scripts that ivman used to create icons of automatically mounted media on ROX desktop (called pinboard). I am using ROX pinboard on top of my favorite window manager, fluxbox.

The idea is that halevt is started by the fluxbox startup config file and when a new device is attached to the computer, halevt config calls a script that creates an icon on the ROX pinboard using ROX rpc. When a device needs to be removed ROX pinboard is configured to call a special eject command that checks for a couple of things before unmounting the device and calling the script to remove the icon from ROX pinboard.
Apart from automatically mounting/unmounting of devices I have also added a nice option in the halevt config to unmount and eject the CD/DVD drive when the eject button on the device is used and of course when the CD/DVD is not in use. That emulates a bit the windows behavior that so many users have gotten used to.

Since the script used by halevt involves a lot of file reading/writing and parsing I thought it would be wise to convert my old rox.panelput bash script to perl. And I was correct, the speed difference, even for such simple tasks is more than noticeable.

The installation process. Please take notice of the user executing the commands, $ is for normal user, # is for root:
0) create /usr/local/bin/ path and put it in your shell’s PATH
# mkdir /usr/local/bin
$ echo "export PATH=$PATH:/usr/local/bin/" >> ~/.bashrc

1) install halevt
# echo "sys-apps/halevt ~x86" >> /etc/portage/package.keywords
# emerge halevt


2) create ~/.halevt/HalevtConfigActions.xml in your home directory:
File: HalevtConfigActions.xml (right click->Save-as)

3) Create /usr/bin/eject.hal. Take notice that the script uses bash and not dash!
#!/bin/bash
if [ -z $1 ]; then
echo "Usage: eject.hal "
exit
else
echo "$1" | egrep "^/dev"
if [ "$?" == "0" ]; then
#echo "Device First, find mount point"
TOSCAN=`echo "$1" | sed -e 's/ /\\\\\\\\040/g'`
TOUMOUNT=`grep "$TOSCAN" /proc/mounts | cut -d" " -f2`
UDI=`hal-find-by-property --key volume.mount_point --string "$TOUMOUNT"`
DISC=`hal-get-property --udi "$UDI" --key volume.is_disc`
/usr/local/bin/rox.panelput.pl Remove "$TOUMOUNT"
halevt-umount "$1"
halevt-umount -s
if [ "$DISC" == "true" ]; then
/usr/bin/eject -p "$1" &>/dev/null
fi
else
#echo "Mount Point First, find device"
UDI=`hal-find-by-property --key volume.mount_point --string "$1"`
DISC=`hal-get-property --udi "$UDI" --key volume.is_disc`
TOSCAN=`echo "$1" | sed -e 's/ /\\\\\\\\040/g'`
TOUMOUNT=`grep "$TOSCAN" /proc/mounts | cut -d" " -f1`
/usr/local/bin/rox.panelput.pl Remove "$1" nowait
halevt-umount "$1"
halevt-umount -s
if [ "$DISC" == "true" ]; then
/usr/bin/eject -p "$TOUMOUNT" &>/dev/null
fi
fi
fi

File: eject.hal

4) Create /usr/bin/rox.panelput.pl perl script. The script is written very simplistically to be easily understandable and changable.
File: rox.panelput.pl

5) Start halevt from fluxbox startup..make sure ~/.fluxbox/startup file contains at least the following, changing YOURUSERNAME to the one appropriate:
/usr/local/bin/rox.panelput.pl Restore
killall -9 halevt; halevt -f -u YOURUSERNAME -g plugdev &
/usr/bin/rox -p pinboard

6) go to ROX options and change ‘eject command’ to use eject.hal
rox-using-eject-hal-screenshot

That should be all. Upon fluxbox restart halevt should start and when you plug in your usb the set of scripts will create an icons on ROX pinboard for you.

Example:
usb-mounted-by-halevt-and-rox.panelput.pl

References: http://forums.gentoo.org/viewtopic-t-731555-highlight-halevt.html

June 22, 2009 :: Greece  

Jürgen Geuter

Linux Action Show Season 10, Episode 7 - Cleaning up the mess

Usually I do really enjoy the Linux Action Show: The production quality is good, they aggregate some stuff I might have not seen earlier and are most of the time just fun. I like that they have their own agendas and positions which often go out of the "linux mainstream", it gives people a good hook to start thinking about what's really right and good and what's just propaganda of any side of the discussion.

Today I listened to Episode 7 of Season 10 (the current one at the time of writing this) and I gotta say that that episode was just below any quality standard when it came to the "Mono Discussion".

A few remarks first: I have written about Mono before, coming to the conclusion that it is in fact not evil. I use a bunch of Mono applications (because they allow me to do things better than I could do them without these apps): I run Banshee, GNOME-Do, Tomboy and F-Spot without feeling "guilty" or "bad". Those apps rock and make my days better. I am not a "Mono hater" (though I'd probably avoid writing C# just as I would avoid writing Java just cause I don't like those languages, but that's a different topic).

The discussion was triggered by the Fedora Project deciding to drop Tomboy from the LiveCD and the default install and replacing it with GNote, which is pretty much a clone of Tomboy just written in C++. Bryan and Chris then went on and on, pushing each other into more and more extreme phrases. Now I know how it is sometimes and how getting into that kind of ranting can be fun, but that's why you can edit your podcast to make sure that you've got at least the facts straight. Let's do some cleaning up.

Complaint No.1: Duplication is waste of developer time



Both hosts complained that Hubert Figuiere, the creator of Gnote would just waste developer time replacing an app that works. They continued collecting all those little bugs they encountered in the different Linux distros they use, hinted at some MacOSX features the Linux kernel didn't have and that duplication was the reason for those "flaws in Linux".

This might look like it makes sense if you don't look to closely: You have X people, each putting in Y hours a month into Linux/FOSS. If one person spends Z hours to do something "useless" we lose those hours and have just X*Y-Z hours left for the "valid" stuff. Which would make sense if hours were that freely distributable which they ain't for a bunch of reasons: I don't know Hubert, but maybe he has no interest or skills to hack on the Kernel or patching it to duplicate some MacOSX feature? So his hours couldn't be spend in that area. But the more important aspect, one that always annoys me when it comes to Wikipedia deletionism, too: If somebody takes time out of his or her full day to do something, that is never futile or useless, if it was, that person wouldn't have done it. Whether Hubert just doesn't like Mono cause of legal reasons or cause he hates the platform for its less that stellar startup times or just cause he loves C++ oh so much more doesn't matter: He decided that it was worth his time to implement a Tomboy clone in C++.

FOSS is about choice and this is a great example: You can chose to use the Mono app that is probably more mature or you can use Gnote. Maybe you just don't wanna have Mono on your system for space reasons (or cause you don't wanna compile it [me being a Gentoo user knows the pain: It's the reason I don't run any KDE apps: compiling kdelibs and family just wastes precious time and resources]), maybe Mono doesn't run? Your choice. The best program will win the mindshare or both projects will agree on a standard that lets them interact. That is the way FOSS works. Just cause Tomboy was first and works we shouldn't grant its developers the monopoly on note-taking: what happens if Gnote goes in a different direction in a month and creates something even more awesome? Do we wanna risk losing that? New perspectives on problems, on software implementations are good, they allow us to see flaws more clearly and competition forces us to define open interfaces and standards that allow better integration in the long run. If Beagle had not gotten competition by Tracker we probably wouldn't have the Xesam standard that allows everybody to plug random desktop search engines into the desktop. Competition is our strength, because it makes our platform stronger, more refined.

Complaint No.2: Dropping Mono programs is just cause of FUD and legal threats that don't exist



The next big comlaint was that fedora was just dropping Tomboy cause of FUD: That the Mono haters had won to cheat them into dropping Mono. This has a few aspects:

a) If anybody in the fedora project sees a legal ambivalence with Mono it's their fucking Job as distribution to drop Mono: They have a responsibility for their users and bringing them into a situation that might compromise them is just dead wrong.
Now let's just say they have a few concerns, as little as they are, they are just not 100% sure that Tomboy is fine. A competing product comes a long that works and that is clearly not having any of the legal ambiguities that Mono has. It would be completely stupid not to drop Mono: You have a program to provide the functionality you want with less trouble? Go for it I say!
b) Even if they didn't see legal trouble there's the fact of slimmer dependencies. Mono is a big dependency if you have it there just for Tomboy. If dropping Tomboy for a functionally good enough replacement allows you to clean that much space for your user, why wouldn't you do that? Maybe that allows you to put that other nifty new program on the LiveCD? Maybe more documentation or a new language? All reasons that are worth it.
c) The fedora people make their decisions based on the facts they have in front of them. You can disagree, can get involved into the process but in the end it's up to the project to decide their way. They don't have to please anyone, they make decisions and in the case of Fedora those are usually made completely in the open. I think the Fedora devs are a bunch of really smart people and if they decide something for their own project, who am I or who are you to tell them what to do?

Complaint No.3: Dropping Mono from your distro is as bad as any DRM



This is the part that got Chris all excited and with every word more into the wrong spectrum of the discussion: Chris (and Bryan) seem to have just read over the Fedora/Gnote messages very quickly cause they seemed to have missed half of it: Fedora does not delete Mono and Mono apps from the repos, they are just not on the LiveCD and the default install. Every user can have all of those apps by selecting it in the package manager and hitting "install". Mono is not gone.

Based on this false assumption Chris said that Fedora dropping Mono was just as bad as DRM, that it was just another software vendor locking him out of software. This whole notion is ridiculous and very clearly not thought through.

What does DRM do? The supplier of something uses DRM to force you to use the Software or content just exactly as that supplier intends it, no installing the software where the supplier doesn't want it, no playing content on unregistered players. DRM locks you out of options.
If Fedora had dropped Mono and all Mono apps completely how would that relate? Well ... not at all in fact. It would just mean that Fedora wouldn't support Mono anymore with their limited resources (see Complaint No.1), nobody would bar you from setting up a repo with all the Mono stuff and somebody probably would do that very quickly. It's like some Windows Software Shop not supporting running their app under Wine: It's not like they forbid you from doing it, it's not even that they wouldn't help you if you come with good suggestions on how to make running it on Wine easier, it's just that they wouldn't write "We support running this under Linux through Wine" on their box.
The Fedora has any right to drop certain packages from their repos if they can't or don't want to support them anymore, it happens all the time: Old unmaintained software is dropped because maintaining it is a pain. Fedora knows whether they can and want to support Mono and if they see it as the best way to drop Mono packages cause their resources are limited it is the right thing to do. Because the users deserve to only get official packages that are maintained and supported. Every DRM comparison fails here in any thinkable way.

I think Chris and Bryan just got carried away by their quick perception that everything was about FUD and just reacted out of that wrong perception without thinking it through. But I hold them to higher standards than that: If you speak "for the community" (well they don't speak for all of it but they do have a bunch of listeners which gives their opinion and voice some weight) you gotta think before accusing projects of things. It's just really bad style if you don't.

I for one am looking forward to the next episode of the Linux Action Show, one of those Podcasts that I enjoy listening to. What's your opinion on the whole thing? Do you see Fedora's replacing of Tomboy with Gnote as negatively as Bryan and Chris do? I'm looking forward to your opinions!

June 22, 2009 :: Germany  

June 21, 2009

Zeth

Mobile Wireless Questions and Answers

Some interesting questions and answers from my local Linux Group, the responses were written by Linux wireless expert Quentin Wright.

The first questioner wants temporary Internet access for a local community group:

I run a group in a venue without Internet access, I've been thinking of getting a USB 3G dongle (possibly with one of those USB->Ethernet hubs people like Three offer).

You could just get a pay-as-you-go SIM and a dongle.

I quite like the Netgear MBM621 which is an HSPDA/Ethernet modem and does NAT. Unfortunately they cost about 230 UKP new, and second-hand ones sell for nearly as much on eBay.

The next two questions are from the same author, who has connection problems with a mobile broadband USB dongle.

I have the T-Mobile web-n-walk mobile broadband USB stick which identifies itself as a Huawei E220/E270 HSDPA modem.

I recently downloaded and installed the latest version of the vodafone-mobile-connect (VMC) package for Fedora 10.

This installed okay after I had installed a few other things it required and it now runs, detects the Huawei and is quite happy to read and send text messages, which I previously had to do using a hand-crafted script.

But it will not set the device into internet mode, and although it installed lots of files in /usr/share/vodafone-mobile-connect/ I can't find what I have to change to make it work with the t-mobile network.

Not especially constructive I'm afraid, but it works out of the box with Ubuntu 9.04 using Network Manager. There is a look-up table of providers and their configurations installed by default - something different from VMC.

It may well work similarly with Fedora 11 as they said they were going to put the code in - I'll try it in the next day or so other distractions at work permitting.

I got rid of Network Manager because it interfered with other things (including the latest version of Firefox) and I mostly prefer to use scripts to handle my network connections (including changing /etc/hosts, and other things). Various colleagues who previously used 'NM' have now switched to 'wicd' which they find works where NM breaks in recent versions of linux. I don't know what's going on there.

Things have been particularly complicated with respect to networking since the transition to the Devicescape architecture in the kernel last year, coupled with the incorporation of the driver code from the more common wireless devices into the kernel as well.

These changes have in turn obliged the driver developers, the wpa-supplicant people, and the teams involved in the configuration utilities like Network Manager and wicd to catch up with the changes in the kernel. Further the distribution builders have had quite difficult decisions to make about the particular kernel build and other components to put into their release.

It's not sufficient to make a statement like "NM breaks with such-and-such a version of Linux". In reality a problem will relate to the combination of the specific kernel version, the particular device being used, as well as the versions of NM and wpa-supplicant.

Additionally in some distributions, like Debian, Mandrive and PCLinux OS, with some devices multiple conflicting drivers are loaded when particular devices are detected. In other distributions like Arch Linux, SUSE and Debian the firmware has to be copied into /lib/firmware. The symptom is that Network Manager appears to work, including acceptance of the key and even the appearance of a brief connection which then dies.

In endeavouring to triage NM problems in Ubuntu, about 50% of the problems relate to a failure to understand how to use the configuration icon. In particular the mistakes that are made are:

  1. Right clicking and using manual configuration when it is unnecessary.
  2. Failing to appreciate that it is necessary to left-click on the icon to configure wireless. This is a particular problem with users coming from a Windows environment.
  3. Not knowing the network passphrase, or only having a hex passphrase when a string is required (some BT Homehub users).
  4. Setting it up, changing the hub configuration and failing to make a note of the default keyring password and being unable to change the configuration.

On the topic of kernel versions, it's not enough just to rely on the kernel version for the 3G modems, because the udev rules have to be right as well.

As a rule it's best to avoid upgrading. The best strategy seems to be to have multiple partitions, maybe with a shared /home partition and do a clean install into the least used partition. You might then decide to migrate to the latest (greatest?!) version, or alternatively just give it a miss this time around.

Discuss this post - Leave a comment

June 21, 2009 :: West Midlands, England  

Dirk R. Gently

Customizable LiveUSB


If you ever have an emergency and need a rescue disk to recover your Linux install, or maybe you just want to brag to your friends there’s some good LiveCD/USB’s out there and many distro’s now make LiveUSB install images, but it is also possible to create your own customizable LiveUSB. Hey, if you’re willing to put the time in, you can have a portable Linux in your pocket.

There’s alot of articles about creating your own custom CD/LiveUSB but many of them seemed dramatic involving messing with things like syslinux… Plus many of these create a fixed image, meaning that once it’s on your USB it can’t be changed. But having a customizable Linux on a USB flashdrive isn’t that difficult – just install Linux to the USB drive.

Partition the USB Drive

The first thing you’ll need is at least a 2GB flash drive. Anything less and you better plan a real basic install. First thing you might like to do is partition the flash drive. This isn’t necessary but I was pretty sure I wouldn’t need the 4GB for what I needed so I partitioned the flash drive to have a 1GB FAT32 partition first (so that Vista can see any files I put on it) then I partitioned the remaining 3GB as ext4 with kparted (there’s also gparted for gnome users).

Install via VirtualBox

No need to burn an ISO and reboot, use VirtualBox and do it from your desktop. You can follow my Testdrive a LiveCD with VirtualBox post to getting VirtualBox setup. I personally used Arch Linux for this install because it’s easy to configure, Gentoo should work well too, and Ubuntu looks to be easy.

Note: At the time VirtualBox does not have 64bit capabilities. If you want to install a 64bit Linux on your flash drive best to boot a LiveCD and follow these instruction from there.

Make sure your user is part of the VirtualBox group to enable usb recognition:

gpasswd -a <username> vboxusers

Boot the LiveCD/USB iso/img in VirtualBox then in Devices > USB devices select your flash drive. Now the installer will recognize your flash drive. Proceed to install the distro on the flash drive. If you partitioned beforehand you can skip partitioning and go to setting Filesystem Mountpoints. When you reach GRUB setup be sure to install GRUB on the flash drive itself, for me it was /dev/sdb. Be sure NOT to install GRUB to a partition, it should be at the beginning of the drive.

Fix Grub

Because your BIOS is likely setup to recognize your hard drive before your USB drive you get drive denominations like /dev/sda for your hard disk and /dev/sdb for your flash drive on regular bootup. If booting from a flash drive, many BIOS’s have you enter a key (mine is F10) to get to a Boot Menu. So when you select your flash drive in your BIOS Boot Menu your flash drive now becomes /dev/sda, hard drive /dev/sdb. In grub terminology this is hd0 and hd1. Most BIOS’s are like this (though there a few exceptions). To know for sure you won’t be able to detect this until you try and boot your flash drive (more below).

Close VirtualBox and open your GRUB menu list and change to the first recognized drive:

mount /dev/sdb2 /mnt/usb
vim /mnt/usb/boot/grub/menu.lst

or however you edit your system files. Then change:

# (0) Arch Linux
title Arch Linux
root (hd1,1)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/34393cdf-9f39-431e-88c8-ea89a2518c83 ro
initrd /boot/kernel26.img

to:

# (0) Arch Linux
title Arch Linux
root (hd0,1)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/34393cdf-9f39-431e-88c8-ea89a2518c83 ro
initrd /boot/kernel26.img

The (hd0,1) value denotes the partition number, again starting with 0. So this denotation tells GRUB the root filesystem is on the first drive, second partition.

Arch-specific Details (Mostly)

If you already did the configuration for your hard disk, you should be able to copy most the configuation files over to the flash drive (rc.conf, mirrorlist, modprobe.conf, local.conf…) and then install xorg, xfce4… by chrooting in. This is my chroot script:

#!/bin/bash
# chrootmount – change root to current directory

cp /etc/resolv.conf etc/resolv.conf
mount -t proc none proc
mount -o bind /dev dev
mount -t sysfs none sys
chroot . /bin/bash
source /etc/profile
grep -v rootfs /proc/mounts > /etc/mtab
source ~/.bashrc

This will allow you to just cd to the mounted directory and enter command to chroot to the new environment. From there you can install a desktop environment (I choose XFCE because I wanted a lightweight environment and limited disk space):

pacman -Syu
pacman -S xorg xfce4 gdm <few-fonts> nvidia

And a couple other things following the Beginner’s Guide.

The kernel initramfs image will need to be rebuilt too to have usb driver support. In the chrooted environment edit /etc/mkinitcpio.conf and add usb to HOOKS:

HOOKS=”base udev autodetect pata scsi sata filesystems usb”

Then find the the kernel version name and version:

uname -r

and build a new initramfs image:

mkinitcpio -g /boot/kernel26.img -k <your-kernel-name-version>

The -k option needs to be specified to use the chrooted kernel and not runtime kernel that is being used by chroot.

When done, exit chroot:

exit && umount proc sys dev

Reboot and Test

Now reboot and get to the BIOS Boot Menu. As I said, all BIOS’s are different so keep an eye for a key to get to it. Once in the Boot Menu select your USB drive.

Try and boot the flash drive. If you get a GRUB 17 error or boot into hard drive OS, you’ll have to edit your menu.lst. You can find the devices Grub sees by starting the flash drive again and in the Grub menu press e to edit. On the root line press e again and delete to:

root (hd

now press tab and it will show you the availble drive and partitions. Enter the correct one, hit escape and then b to boot. That’s it, you should now have your own customizable Linux USB drive.

Troubleshooting

If you get errors loading the kernel, it may be because USB device detection may need a delay before loading root. Try to add this to the end of your kernel line in your menu.lst:

rootdelay=8

Conclusion

I was a bit surprised. I didn’t think a USB drive would be much different that a CD/DVD but actually it was alot faster. And I just discovered that I’m using a USB 1.1 flash drive. :) Not quite as quick as my hard drive but definitely not bad. This is also the first time I ran without an xorg.conf and my desktop runs great. Definitely worth a try if you ever need a rescue os to fix problems with.

June 21, 2009 :: WI, USA  

June 20, 2009

Nikos Roussos

foss devs conference 2009


workshops

another great libre software event just ended. this time was the foss developers conference organized by eellak.gr. two full days with presentations (6 sessions) and workshops (14).

my highlights from the conference: openerp greek community announced at the conference, moodle workshop, great olpc workshop by re-public e-zine, a complete foss guide for education by kaskamanidis, a vivid presentation about ltsp by kainourgiakis (the last two were a good brainstorm input for me concerning my educational linux distributuion). and of course it was nice to see again some good friends :)

i have to admit that it was a great experience since i helped organizing this conference. more to come :)

eellak

June 20, 2009 :: Athens, Greece

Matija Šuklje

x86 vs. amd64 in Portage

I just realised something: how come if there's almost no way of getting a 32-bit x86 CPU nowadays and almost all CPU are x86_64, that ARCH="x86" is still the default and most maintained in Gentoo/Portage?

Yes, I know there's still people who use 32-bit, but there's also still people who use PPC (or even more exotic arches) and that's in second place.

Wouldn't it make sense for ARCH="amd64" to be at least as well supported as ARCH="x86" (if not even made the default/primary) in the given circumstances?

hook out >> woke up (still) laptopless, getting some grub and studying finances :P

P.S. I'm probably not the only one who finds it a bit confusing that the GCC calls the architecture x86_64, but Portage calls it amd64, am I?
<!--break-->

June 20, 2009 :: Slovenia  

George Kargiotakis

Firefox 3.0.11 to 3.5b99 migration glitch on certificate authority root files

I’ve recently migrated on my debian from iceweasel (firefox) 3.0.X to swiftfox (firefox) 3.5b99 and I noticed that I could not import any new certificate authority root files. When I used a new profile everything worked as expected, so it was something that had to do with the migration of my old version 3.0.X profile to the new, version 3.5. It looks like there has been a modification in the way firefox 3.0.X and firefox 3.5 handles cert8.db file inside the profile directory. As soon as I deleted the file and restarted firefox I could import new certificate authority root files just fine. Of course I lost the old ones I had imported in the past…

June 20, 2009 :: Greece  

June 19, 2009

Allen Brooker

Degree Result!

I now have a 2:2 in BSc Computer Science with a Year in Industry. Considering how badly I can do in exams, I am quite happy with this result. Won’t get full results for a short while yet, but getting that result is a weight off my mind.

Congrats to everyone else getting their results. Hope you get what you wanted.

Edit: CV updated. I’ve also fixed the broken download link on this site.

Rant: Why do Monster and other job sites not allow PDF uploads? I had to use a Windows machine to get test the RTF export to make sure it looked OK.

June 19, 2009 :: England

June 18, 2009

Zeth

Visualising your favourite keywords in Twitter

Twitter is a social networking site that allows you to share short messages about what is going on in your life, or to share some cool link you have found.

Previously I have talked about Twitter scripting, Twitter GNOME integration and Tag Clouds.

Having a live and visual representation of what is happening on Twitter is quite fun. These are especially fun on a monitor or flat-screen, e.g. in a party, in an office, or at an event.

Twitter's own search is pretty good, it shows you the latest results for a keyword (or set of keywords) and automatically polls for updates, however you need to click to show you the updates, which reduces the usefulness on an unattended monitor.

http://commandline.org.uk/images/posts/twitter/twittersearch.png

A step up from this is Monitter, which allows you to put different keywords in columns and sort by geographic location.

http://commandline.org.uk/images/posts/twitter/monitter.png

Twitterfountain finds the latest messages for a keyword, and can also look on Flickr to find images to use for the background of the page.

http://commandline.org.uk/images/posts/twitter/twitterfountain.png

Flotzam is able to pull from several social networking sites, including Twitter, Facebook and YouTube. However, Flotzam requires Silverlight on Windows or Moonlight on Linux.

http://commandline.org.uk/images/posts/twitter/flotzam.png

Lastly, and my favourite so far, is Visible Tweets, this simply puts one message on screen and then animates to the next message.

http://commandline.org.uk/images/posts/twitter/visualtwitter.png

Please let us all know if you find another one, or if you think of a cool use for one of these sites. Please also share any other sites or tools you are using.

Discuss this post - Leave a comment

June 18, 2009 :: West Midlands, England  

June 17, 2009

Roderick B. Greening

usb-creator-kde - in action and with icons...

Here's a new screenshot showing usb-creator-kde with media detected and some icon bling (icons subject to change).

Basically, I updated the ui elements from QPushButton to KPushButton and assigned icons as KIcons based on appropriate icon/button functions. So they should change with the icon theme - yay.

Anyway, here it is...


June 17, 2009 :: NL, Canada  

usb-creator-kde - adventures in gobject land

I'll first start out with a disclaimer: I am not fluent in Qt nor Gtk programming. What I know or have learned is through the internet, various books and reading others code. So, what I describe below may not be the best way to achieve the end result, but it appears to work and allow for minimal interference with an existing application backend.

Now that that's out of the way, I'll proceed with the discussion: porting gobject calls to Qt so that I can get a usable KDE/Qt frontend for usb-creator-kde.

For the gtk client (usb-creator), the backend currently implements timers, callbacks, and process watchers via gobject. Similar mechanisms exist for Qt. The current backend is unsuitable for general use by both a gtk and Qt frontend as gobject and Qt seem to tromp all over one another, and cause the frontend to crash. TO get around this, we need to move the gobect calls to the gtk frontend, and implement wrappers that the backend can call from the frontend. Once we have wrappers in place, we can then re-implement the wrappers in our desired frontend (e.g. PyKDE).

Here's an example of some code from the backend:

self.timeouts[udi] = gobject.timeout_add(UPDATE_FREE_INTERVAL, self.update_free, udi)
And from the PyGtk manual:

timeout_add
int timeout_add(int interval, callback callback [, mixed user_data1, ... ]);

Registers a function to be called periodically. The function will be called repeatedly after interval milliseconds until it returns false (or nothing) at which point the timeout is destroyed and will not be called again.

So to keep the timeout alive, your callback function needs to return true;
Unfortunately, there is no single call in Qt that provides this mechanism (none that I know of). So, to implement this, I needed to write a couple of functions, using unnamed arguments lists, lambda notation, etc.

First off, we need a generic timer callback function that will call our passed function, test the return value, and stop the timer if the return value is not True. I also want this function to be private to my frontend class. Here what it looks like:

def __timeout_callback(self, func, *args):
'''Private callback wrapper used by add_timeout'''

timer = self.sender()
active = func(*args)
if not active:
timer.stop()
So, func is the passed calback function to execute, followed by a list of optional arguments *args. The sender will be a timer object, which we get from self.sender, assuming that the parent is some QObject or derivation thereof (in my case, the frontend class KdeFrontend is derived from QObject).

Ok, that allows us to have an arbitrary function with any number of arguments, and have it stop a timer when appropriate. We now need to implement the public wrapper that will use this private callback. Here is the code for that:

def add_timeout(self, interval, func, *args):
'''Add a new timer for function 'func' with optional arguments. Mirrors a
similar gobject call timeout_add.'''

timer = QTimer()
QObject.connect(timer,
SIGNAL("timeout()"),
lambda: self.__timeout_callback(func, *args))
timer.start(interval)

return timer
The add_timeout function takes the same parameters as the gobject.timeout_add function. Inside, we setup a new timer, connect it to our private callback, start the timer and return a reference to it. The magic is in how we connect the passed function func. Notice that we use lambda to call our private callback, passing along the func and *args. Normally, you do not pass a function with variable parameters to Qt connect statements, but in our case, we absolutely are required to do so. This is where using lambda comes in handy.

So, there you have it. A way to implement gobject.timeout_add using Qt. While everyday use of this is not likely, it will certainly help in porting applications from PyGtk to PyQt. I hope someone out there finds this useful. I know I searched for an easy way to do this, and never found anything. After lots of trial and error and asking lots of questions to my fellow developers, I was able to come up with the above.

Cheers.

June 17, 2009 :: NL, Canada  

Allen Brooker

KDE and Version Numbers

I’m fed up! I’m sorry, but I just don’t buy it. MAYBE it worked with the .0 release, but anything above x.0 IS NOT a preview / beta / release candidate. KDE 4.2.4 is the real, proper, full up released version of KDE. Amarok 2.1 is the real, proper, full up released version of Amarok.

The KDE fanboi’s (and frankly, I think it is just the fanboi’s who are still trying to use this excuse - looking at the KDE blogrolls I don’t see the devs using it any more) need to stop falling back on this excuse. NO ONE else tries to use it, and I don’t understand why they insist on trying to use it. It’s really getting old now.

KDE had all the features and stability (from my point of view, as a user) and they went and decided to throw away almost the entire codebase in favor of SHINY! What’s worse is they concentrated on new features before getting the really basic stuff which KDE3 does really well right.

The same for Amarok 2 - the developers concentrated on their stupid shiny new UI which doesn’t even work properly before getting back even a tiny amount of the functionality that makes me use Amarok 1.4 over any of the other umpteen million other media players.

I don’t think I’ve seen anyone else do this to this degree with desktop software. The first thing developers do when they do a major rewrite (and thus a major version bump) is get the product roughly on par with its predecessor in terms of features. THEN they concentrate on shiny new features. Why is this so hard for the KDE devs to grasp?

Edit: I am not saying anything (major) is lacking in KDE 4.2 - this is basically a rant about the excuse used by many whenever someone does come up with something that’s missing.

For the record, the features I am noticably missing in KDE 4.2 are:
- Plasma still crashes occaisionally (I think this may be related to downloaded plasmoids, but plasma should still sanely handle issues so my entire desktop doesn’t stop responding with no messages telling me why)
- No ability to put spaces between icons placed on a panel
- No run panel widget
- No nice small, clear memory/cpu panel widget like the KDE3 system monitor applet (there doesn’t seem to be a memory usage widget at all. I wonder if that’s so the devs can keep perpetuating the (from my experience) myth that KDE4 uses less memory)
- Memory usage is noticably greater than KDE 3.5 (as measured at hibernate time on my laptop - My laptop may have been upgraded to 2G from 512M at xmas, but the memory usage affects the time it takes to hibernate/resume my laptop)

June 17, 2009 :: England

Jason Jones

Kaboom!

Man...  When, at the beginning of this year, I wrote that 2009 was gonna be a doozie, I didn't know the half of it.
After having been employed for only a month, two days ago, Monday, at 5:00pm, my superior came in to my office and told me, with a red face, that they had to let me go.  The red face was undoubtedly due to the fact that nobody enjoys doing that sort of thing.  "Things are too tight", he said, and then, as he was necessarily hovering over me, I formatted my computer, packed my things, and that was that.

For those of you who have been following my posts, this may come as a shock, as many posts I have recently written have spoken of the spiritual confirmation that both me and my wife have received concerning my employment there.

This one is usually a toughy, but I've come to realize through many life experiences, that God has His way of doing things.  God's way of doing things more often than not, comes as a shock to our way of doing things.  Does this mean the two are incompatible?  I believe that wholly depends on whether or not you believe God really is at the helm of our lives.

I look at this situation from the following perspective.

I have no doubt at all that it was God's will that I leave Nature's Way and take the offer given me by Conexm.  I felt strongly (as did my wife) after taking the offer and beginning my employment, that I was doing exactly what I needed to be doing.  Neither Sarah nor I felt easy about my employment there, as it was very stressful, and things never felt like they settled into a groove.  Nevertheless, and notwithstanding the bumpiness of life as I was employed there, I always felt that "this is where I am supposed to be".

So, some may ask, "Why the termination?  Why would God tell you to go somewhere where he knew almost immediate termination would result?"

My response is this.  Yes, it was extremely nerve-racking and difficult, to say the least, to hear the news of my termination.  Given the current economic situation of our family, being unemployed is definitely not something which will make our lives any easier.  Holy moly, no.  But, can I discredit the confirmation both Sarah and I received?  Is it void now?  I might answer yes, if during my employment there, I had given them any reason of my own doing to terminate me.  I gave my all, I did my best, I worked my hardest.

So, in essence, since I don't know what will happen 1 month, 1 week, or even 1 day from right now, I still firmly believe that God is still at the helm of my life, and I am going to do everything I can to find His will in all this.  In doing so, I believe that since God's work and glory is to bring to pass the immortality and eternal life of his children, and I also believe that man is here on earth to have joy.  If you put those two together, one can only come to the conclusion that if we follow God's will, he will direct us both to have joy, and to eternal life.  Right now, I'm not having a whole lot of joy, persay, but I still am at peace with my current situation, and will continue to do my part.

So... Yeah..  I guess this essay was a long-winded approach to saying, "I'm now unemployed, but I haven't lost hope."

Hooray!  I get to sleep in!

June 17, 2009 :: Utah, USA  

Brian Carper

Five Things that Mildly Annoy Me in Clojure

This infamous blog post suggests that someone familiar with a language should be able to name five things they hate about it. "Hate" is a strong word, but I decided to think of five things I find mildyly annoying about Clojure, my favorite language of the moment.

Hashing integers

Clojure automatically converts integers between Integer, Long and BigInteger as needed to prevent overflow. This is good. Integers of the various classes test as equal too. This is also good.

user> (= 123 (int 123) (long 123) (bigint 123))
true

So would you expect this?

user> (hash-map (int 123) :foo (long 123) :bar (bigint 123) :baz)
{123 :foo, 123 :bar, 123 :baz}

Yes, each of the integer classes, though equal via =, do not have the same hash value when put into a hash-map. This is because:

user> (.equals (int 123) (long 123))
false

This is a wart inherited from the JVM. See here for discussion and explanation.

What's more, if you print this map and then try to read it back in, the integers will be read as int, long or bigint arbitrarily depending how big they are. This means you may not get the same class of object back that you output originally.

user> (def x {(bigint 123) :foo})
#'user/x
user> (= x x)
true
user> (def y (read-string (pr-str x)))
#'user/y
user> (= x y)
false
user> (class (first (keys y)))
java.lang.Integer
user> (class (first (keys x)))
java.math.BigInteger

This means that if you ever use integers as hash keys, you must be very careful to cast them all to the same integer type manually.

Metadata doesn't work on everything

Clojure lets you stick arbitrary metadata on various objects. This is higly useful; you can decorate objects with information that doesn't affect the value of the object. However metadata doesn't work everywhere.

user> (with-meta "foo" {:bar :baz})
java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IObj (NO_SOURCE_FILE:0)

You can only stick metadata on certain Clojure objects like Symbols, Vars, Refs, Agents, all of the Clojure collections and so on. You can't stick metadata on, say, a String or an Integer, because those are closed Java classes and can't be touched. It would be nice if you could.

use vs. require vs. import vs. load vs. ...

There are a startling number of ways to import a library into your code in Clojure. You have to choose from load, import, require, use, refer, and so on. Some work on Java classes, some work on Clojure libs. Some of them import symbols into your namespace, some of them don't. Some of them take strings as arguments, some take symbols, some take quoted lists of symbols, some take quoted lists of symbols with sub-lists of arguments. And all of these can be and usually are weirdly inlined into a namespace declaration, with a completely different list-quoting style.

So in Ruby you can do this:

require 'util'
require 'config'
require 'whatever'

Whether it's a gem, or a Ruby source file sitting locally, it all works the same as long as the load path is set up right.

But in Clojure, you do this (actual code from an IMAP library I wrote):

(ns qt4-mailtray.mail
  (:import (java.util Properties)
           (javax.mail Session Store Folder Message Flags Flags$Flag FetchProfile FetchProfile$Item)
           (javax.mail.internet InternetAddress))
  (:use clojure.contrib.str-utils))

This can quickly become unwieldy, especially if you start using the :as or :only or :rename arguments. It's made worse by Java's insane API's full of a billion classes that you need to import to do simple things. (And those things with dollar signs are mangled Java inner class names.) Clojure also lacks the ability to import a whole package worth of classes at once using java.io.* syntax, so you must name all of the classes explicitly.

every? vs some.

This is such a trite pet-peeve that it's barely worth mentioning, but it seems to be brought up repeatedly and endlessly on the Clojure mailing list so at least I'm not the only one bugged by it.

Clojure has a function (every? pred coll) which tests whether every item in a collection tests true via some predicate. To test whether every item in a collection tests false, we have not-any?. And we have a not-every? which tests whether any item tests false.

user> (every? even? [2 4 6])
true
user> (not-every? even? [2 4 6])
false
user> (not-any? even? [2 4 6])
false

Now what would you expect a function to be called which tests whether any item in a collection tests true via some predicate? If you said any? you are wrong! It's some.

Note that some isn't a predicate (hence no question mark in the name); it doesn't return true or false, as above, but rather returns the result of running pred on an item in coll.

user> (some identity [nil 1 2 3])
1

any? is pretty easy to write so it doesn't matter that much. Probably many people have an identical function sitting in some utils.clj file on their systems.

(defn any? [pred coll]
  (when (seq coll)
    (if (pred (first coll))
      true
      (recur pred (next coll)))))

Stack trace madness

Give this function:

(defn foo []
  (throw (Exception. "BARFED")))

What does the stack trace look like in SLIME when you call foo? Like this:

java.lang.Exception: BARFED (NO_SOURCE_FILE:0)
  [Thrown class clojure.lang.Compiler$CompilerException]

Restarts:
 0: [ABORT] Return to SLIME's top level.
 1: [CAUSE] Throw cause of this exception

Backtrace:
  2: swank.commands.basic$eval_region__729.invoke(basic.clj:36)
  3: swank.commands.basic$listener_eval__738.invoke(basic.clj:50)
  4: clojure.lang.Var.invoke(Var.java:346)
  5: user$eval__1506.invoke(NO_SOURCE_FILE)
  6: clojure.lang.Compiler.eval(Compiler.java:4580)
  7: clojure.core$eval__4016.invoke(core.clj:1728)
  8: swank.core$eval_in_emacs_package__336.invoke(core.clj:55)
  9: swank.core$eval_for_emacs__413.invoke(core.clj:123)
 10: clojure.lang.Var.invoke(Var.java:354)
 11: clojure.lang.AFn.applyToHelper(AFn.java:179)
 12: clojure.lang.Var.applyTo(Var.java:463)
 13: clojure.core$apply__3269.doInvoke(core.clj:390)
 14: clojure.lang.RestFn.invoke(RestFn.java:428)
 15: swank.core$eval_from_control__339.invoke(core.clj:62)
 16: swank.core$eval_loop__342.invoke(core.clj:67)
 17: swank.core$spawn_repl_thread__474$fn__505$fn__507.invoke(core.clj:173)
 18: clojure.lang.AFn.applyToHelper(AFn.java:171)
 19: clojure.lang.AFn.applyTo(AFn.java:164)
 20: clojure.core$apply__3269.doInvoke(core.clj:390)
 21: clojure.lang.RestFn.invoke(RestFn.java:428)
 22: swank.core$spawn_repl_thread__474$fn__505.doInvoke(core.clj:170)
 23: clojure.lang.RestFn.invoke(RestFn.java:402)
 24: clojure.lang.AFn.run(AFn.java:37)
 25: java.lang.Thread.run(Thread.java:619)

Yeouch. Now imagine that the above error is coming not from a simple function, but from some random line among hundreds of lines of source code.

Stack traces in Clojure will often tell you little to nothing about what is causing the error, or more importantly, where it's coming from in your code. Clojure functions are translated into Java classes when they're run through the JVM. Often can't even see the name of the function that's throwing the error; names are mangled into things like user$eval__1473.invoke, which is really really confusing when you use anonymous functions.

Per Jason Wolfe and Randall Schulz sometimes you can get a better stack trace if you dig a bit deeper:

user> (.printStackTrace (.getCause *e))

java.lang.Exception: BARFED
    at user$foo__1503.invoke(NO_SOURCE_FILE:1)
    at user$eval__1509.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:4580)
    at clojure.core$eval__4016.invoke(core.clj:1728)
    at swank.commands.basic$eval_region__729.invoke(basic.clj:36)
    at swank.commands.basic$listener_eval__738.invoke(basic.clj:50)
    at clojure.lang.Var.invoke(Var.java:346)
    at user$eval__1506.invoke(NO_SOURCE_FILE)
    at clojure.lang.Compiler.eval(Compiler.java:4580)
    at clojure.core$eval__4016.invoke(core.clj:1728)
    at swank.core$eval_in_emacs_package__336.invoke(core.clj:55)
    at swank.core$eval_for_emacs__413.invoke(core.clj:123)
    at clojure.lang.Var.invoke(Var.java:354)
    at clojure.lang.AFn.applyToHelper(AFn.java:179)
    at clojure.lang.Var.applyTo(Var.java:463)
    at clojure.core$apply__3269.doInvoke(core.clj:390)
    at clojure.lang.RestFn.invoke(RestFn.java:428)
    at swank.core$eval_from_control__339.invoke(core.clj:62)
    at swank.core$eval_loop__342.invoke(core.clj:67)
    at swank.core$spawn_repl_thread__474$fn__505$fn__507.invoke(core.clj:173)
    at clojure.lang.AFn.applyToHelper(AFn.java:171)
    at clojure.lang.AFn.applyTo(AFn.java:164)
    at clojure.core$apply__3269.doInvoke(core.clj:390)
    at clojure.lang.RestFn.invoke(RestFn.java:428)
    at swank.core$spawn_repl_thread__474$fn__505.doInvoke(core.clj:170)
    at clojure.lang.RestFn.invoke(RestFn.java:402)
    at clojure.lang.AFn.run(AFn.java:37)
    at java.lang.Thread.run(Thread.java:619)

This one at least mentions foo by name but you're still going to have a headache after a few hours of those stack traces.

Conclusion

So that's five things. You will notice a common theme. Most of these issues are inherited from the JVM. This is to be expected, I suppose. There's no way you can wrap one language in another without a few compromises.

But these things aren't show-stoppers. They are minor annoyances compared to the benefits you get from using the JVM, i.e. the good performance, tons of libraries, cross-platformness, and so on. Clojure is fun enough to work with and wart-less enough that it took me well over two weeks to write this post.

(If you were expecting me to mention loop/recur and the lack of native TCO in the JVM, you were PAINFULLY WRONG. No one who uses Clojure loses sleep over native TCO. It's largely a non-issue that's endlessly repeated by people looking for an excuse to pass up Clojure in favor of $their_pet_language. To each his own, but I have never found myself caring the slightest about loop/recur.)

June 17, 2009 :: Pennsylvania, USA  

June 16, 2009

Dan Ballard

CL-PACK 0.1 released!

Well, as promised, I've finished the first version of the little Lisp project I've been working on and it's only mid June. So with no further adu, I present cl-pack.

cl-pack is a Common Lisp library supplying perl/php/ruby compatible pack() and unpack() functions so that Lisp can easily communicate with those languages via binary protocols or files. pack() and unpack() take Lisp data and pack them into binary strings that can be stored or exchanged safely with other programs. The (un)pack functions are handy utilities that most other common languages support and now so does Lisp.

Cavets: This is the first release, therefor full coverage of all pack() syntax isn't yet available. Most data type (all common ones) are supported, as are repeaters in the form of numbers and '*'. Grouping with brackets and other extended syntax is not yet supported, but should be forthcoming in the next release. Documentation is in cl-pack.lisp and if you want to see what it can do, also look at tests.lisp. cl-pack is ASDF compatible so it should integrate with your system well. It relies on ieee-floats but ships with a copy should your system be lacking one.

You can get it at ftp.mindstab.net/cl-pack

So yeah, this is what I've been working on for the past month or so. Glad to get it out. I plan to throw up some small web page for it in a few days and then start working on the remaining syntax support.

Edit: I set up a page for cl-pack at CLiki http://www.cliki.net/cl-pack

June 16, 2009 :: British Columbia, Canada  

Allen Brooker

Amarok 2.1 Quick(-ish) Review

So I’ve just installed Amarok 2.1. Configured my collection location easy enough, downloaded the alarm script from the scripts library (haven’t tried it yet) and now I set about making it look how I want. I know exactly how I want Amarok 2 to look: Exactly like Amarok 1.4.

I like my spreadsheet layout. It works perfectly for music management. I skipped 2.0 because it had no spreadsheet layout and we were promised it in 2.1. Except it isn’t there. You’re still forced into the 3 pane layout that tries to shove everything the world knows about the currently playing track down your throat.

I almost got rid of the 3 pane layout. When the left pane (collection / playlists / etc) is hidden, you can drag the splitter bar all the way to the left and the “now playing” pane disappears. Then I opened the collection pane again. *poof* The “now playing” pane rears its ugly head again.

I hope this is a bug, and that it’ll be fixed in the next update, but at this point I wouldn’t bet my life on it.

I then went to the playlists to set up the same dynamic playlists I have in Amarok 1.4 (”Everything” and several label-based lists that I switch between depending on my mood). While looking around, I did something which made Amarok very angry (whoring the CPU) and froze the UI. This is 2009 people: USE ANOTHER THREAD AND INFORM ME WHAT YOU’RE DOING!

After several long minutes, Amarok finally came back to life and I continue my investigations. There’s no “entire collection” playlist. There’s no label based dynamic playlists. What we have instead is some weird bias stuff I don’t understand (and have no inclination to learn).

On a hunch, I get a track into the playlist and get into the “Edit track details” window. There is no labels tab. I check the other tabs. There are no labels. Well done devs. Another useful feature dropped.

So I won’t be moving my main desktop to Amarok 2 yet, because yet again the KDE developers have delivered something that’s half finished and missing useful features which were there in previous incarnations. To me it seems they’ve gone all gooey-eyed over how shiny it looks without a care in the world that people actually want some functionality out of it.

I really wish I had the time to fork some of these projects (or rebuild them from scratch) and do it right. Amarok joins the KDE desktop on the list of projects I’d fork if I had time, both for the same reasons: OOOOHHHHHHH SHINY! What? You want to actually use our application? You don’t need to use it! Just sit back and enjoy the SHINY!

Edit: All posts which recommend any media player which doesn’t have label-based dynamic playlist support will be deleted. This is the one key feature that I love about Amarok 1.4 and I won’t be moving to any media player that doesn’t have it.

June 16, 2009 :: England