tag:blogger.com,1999:blog-62914822021541025772024-03-13T18:40:37.643-07:00Potrero ha caídoJumbled thoughts on teaching, VLEs, Moodle, systems administration and computer networksJavihttp://www.blogger.com/profile/16272655712298110840noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6291482202154102577.post-36231328719080919112009-11-16T20:46:00.000-08:002009-11-16T21:00:33.175-08:00Ubuntu 9.10 doesn't suspend when closing the lid on batteriesIn Jaunty you were used to shutting the laptop's lid and trusting it would go to sleep... Well, not any more in Karmic. I've already done it several times only to find out that the poor laptop was cooking in its bag, or just shut itself down after running out of batteries.<br /><br /><a href="https://bugs.launchpad.net/ubuntu/+source/devicekit-power/+bug/384304/comments/29">The problem</a> is related to a massive refactoring of gnome-power-manager, which now uses the devicekit-power daemon instead of the recently deprecated hal. Particularly, the problem has to do with the inability of devkit to determine whether we're on AC or battery reliably.<br /><br />Luckily, you can get the fix from this ppa:<br /><br /><pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"><code>sudo add-apt-repository ppa:jmartinj/dkp<br />sudo apt-get update<br />sudo apt-get upgrade<br /></code></pre><br />Hope it works for you!Javihttp://www.blogger.com/profile/16272655712298110840noreply@blogger.com0tag:blogger.com,1999:blog-6291482202154102577.post-68534240972387539922009-11-16T18:45:00.000-08:002009-11-16T19:28:35.855-08:00Is Karmic hogging all your memory, too?<div style="text-align: center;"><div style="text-align: left;">Looks like there are some memory leaks in the new Ubuntu 9.10 (Karmic):<br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyAGyBGX869nv-GCJPrvUMXqsq-cF84M19CO1Xp4fiu2QjAc2jm2HDvLwte9iQfV-KLoF0fgmaCp14D16USr9opFYjI1wdHImynPAFjRFSTLgMVjrdtsL41OzmraPKykO3ChPbDSp4FDI/s1600/karmichog.png"><img style="cursor: pointer; width: 318px; height: 254px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyAGyBGX869nv-GCJPrvUMXqsq-cF84M19CO1Xp4fiu2QjAc2jm2HDvLwte9iQfV-KLoF0fgmaCp14D16USr9opFYjI1wdHImynPAFjRFSTLgMVjrdtsL41OzmraPKykO3ChPbDSp4FDI/s400/karmichog.png" alt="" id="BLOGGER_PHOTO_ID_5404901038707112946" border="0" /></a><br /></div><br />I just took this snapshot of the system monitor after seeing how my swap space is half full, trying to find a culprit. It shows the processes running on my computer after 5 days uptime... I'm just capturing the top hogging processes, ie. the ones that have allocated over 100 MB of virtual memory. Ok, we all know about <span style="font-weight: bold;">Firefox</span>'s soft spot for memory when you have 30 tabs opened... We also know that it's normal for <span style="font-weight: bold;">Xorg</span> to join the feast, but what are <span style="font-weight: bold;">gdm-simple-slave</span> and <span style="font-weight: bold;">gdm-simple-greeter</span> doing here, taking about as much as firefox altogether??<br /><br />We also excuse evince because it's dealing with some graphics. I don't know what <span style="font-weight: bold;">two metacities</span> are good for, and last but not least, <span style="font-weight: bold;">gnome-power-manager</span> (yeah, the tiny little battery icon that also takes care of suspending, etc.) is munching on another 100 MB. WTF?<br /><br />If you are a fan of the TV series LOST, you probably know that the addiction to it comes partly from the directors' mastery of solving a mistery while puzzling you with three more on each episode. I believe the Ubuntu team applied this very same concept to the bugfixing process, so that users are constantly eager for a new release.Javihttp://www.blogger.com/profile/16272655712298110840noreply@blogger.com0tag:blogger.com,1999:blog-6291482202154102577.post-4654719501061573932009-11-09T11:38:00.000-08:002010-03-26T12:42:05.937-07:00Simyo + Alcatel X060 + Ubuntu 9.10 (Karmic Koala)Este post es para aquellos que tengáis el módem X060 que venía con la tarifa plana de Simyo y queráis utilizarlo con Ubuntu 9.10. Los que venís de Jaunty probablemente estaríais utilizando <a href="http://www.borjanet.com/archives/2009/08/01/simyo-alcatel-x060-ubuntu-904-y-2">estas instrucciones</a>, que ahora ya no funcionan.<br /><br />Los problemas son varios: en primer lugar el módem ya está soportado por el kernel y no hace falta parchear el módulo "option", así que el paquete <a href="http://www.borjanet.com/uploads/usb-modeswitch-alcatelX060-dkms_1.0.2-4_i386.deb">usb-modeswitch-alcatelX060-dkms_1.0.2-4_i386.deb</a> que utilizábamos en Jaunty ya no hace falta en Karmic y se puede desinstalar:<br /><br /><pre>sudo dpkg -r usb-modeswitch-alcatelX060-dkms<br /></pre><br />Segundo: ahora los problemas tienen que ver con el paquete "modemmanager", que es el que gestiona los módems 3G. <a href="https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/479343">Podéis ver los detalles aquí</a>, esperemos que el autor los solucione. Mientras tanto podéis bajaros la versión parcheada haciendo:<br /><br /><pre>sudo add-apt-repository ppa:jmartinj/x060-karmic<br />sudo apt-get update<br />sudo apt-get upgrade<br /></pre><br />Por otro lado necesitamos que el paquete usb-modeswitch esté instalado:<br /><br /><pre>sudo apt-get install usb-modeswitch<br /></pre><br />Si todo ha ido bien, se habrá instalado el nuevo modemmanager que corrige este asunto. Reiniciad la máquina y probad.<br /><br />¡Ya me diréis si os va!<br /><br /><b>EDITADO:</b><br />Viendo los comentarios parece que algunos tenéis problemas. Ahora que tengo un poco de tiempo puedo mirarlo, pero necesito que me mandéis un par de logs. Los que tengáis problemas haced esto:<br /><br />Lo primero, desenchufad el módem. Luego abrís un terminal (Aplicaciones > Accesorios > Terminal) y ponéis:<br /><pre>sudo stop network-manager<br />sudo killall modem-manager<br />sudo modem-manager --debug >modem.log 2>&1<br /></pre><br />En otro terminal:<br /><pre>sudo NM_PPP_DEBUG=1 NetworkManager --no-daemon >nm.log 2>&1<br /></pre><br />Enchufad el módem y le dais a conectar. Lo dejáis 2 ó 3 minutos para que se conecte. Pasados esos 3 minutos le dais a CONTROL-C en los dos terminales y los cerráis.<br />Luego os vais a Lugares > Carpeta personal. Le dais con doble click a los dos ficheros de antes (nm.log y modem.blog) y se abrirán con el gedit. Copiáis todo y lo pegáis en <a href="http://pastebin.com/">pastebin.com</a>. Pero antes buscad en el modem.log la palabra "PIN" y si aparece vuestro PIN lo borráis, para que no aparezca publicado. Al final el pastebin.com os dará un enlace por cada fichero, pues lo ponéis en los comentarios. Cuando tenga un rato lo miro e intento averiguar el problema.Javihttp://www.blogger.com/profile/16272655712298110840noreply@blogger.com41tag:blogger.com,1999:blog-6291482202154102577.post-41557708157201497092009-10-27T11:10:00.000-07:002009-10-29T06:31:38.806-07:00Grading Packet Tracer activity files from Moodle<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK4HwK_URxwkZM-nuAjJvY24KugOAQAsE-vL4y9s3AAho3oUS6PnaqtmdujJiDBjBGTitTKL_f20gQVqzSsjHfd2TCYwIser8QDJ-Vbe3McyZIzLxR2itVpEJW3JHzMkUE59yrrsbxISU/s1600-h/pt.png"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 180px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK4HwK_URxwkZM-nuAjJvY24KugOAQAsE-vL4y9s3AAho3oUS6PnaqtmdujJiDBjBGTitTKL_f20gQVqzSsjHfd2TCYwIser8QDJ-Vbe3McyZIzLxR2itVpEJW3JHzMkUE59yrrsbxISU/s320/pt.png" alt="" id="BLOGGER_PHOTO_ID_5398014028704370338" border="0" /></a><br />I love Cisco's Packet Tracer. One of my favorite activities consists of building a completely operational network, then causing a random fault somewhere and leaving students with the broken-down network to figure the problem out. These kind of activities put a lot of skills to the test: you need to understand the network, know which tools to use, emit a valid diagnostic and find a proper solution that doesn't break something else. In fact, I'd only need to page my students at 3am to make it look like a real life problem :)<br /><br />With Packet Tracer's "Activity Wizard", you can even automate the grading of these kind of exercises: you just create an answer network (the student's target) and an initial network (the faulty one). Packet Tracer will figure out what changed between both scenarios and grade each of the steps required to move between one another. A lot of things can be graded: setting the correct netmask, using the right cable, issuing any IOS command, etc. Students start off from 0% and get to 100% when they reach the answer network. This makes life extraordinarily easier for the teacher. Creating the initial and answer scenarios takes quite a bit, but it's definitely worth the effort.<br /><br />If you use Moodle, you can propose new activities, let the students work on them, and after they're done, you just open the result PKA file to check their score. I normally grade PKAs as "completed", "incomplete" or "not handed in". Only when they're incomplete do I make some comment, usually with a hint to what's going wrong.<br /><br />Now, wouldn't be great if <span style="font-weight: bold;">Moodle could put the PKA score out to the gradebook automatically</span>? That way you don't even have to download the "completed" activities. Moodle grades them for you.<br /><br />Well... this is the closest I've gotten to it. The key to this solution is a .jar that comes with Packet Tracer. This .jar has a bunch of libraries that allow PT to be used as a back-end, issue commands, query the status of any device and, among other useful things, <span style="font-weight: bold;">obtain the studen't score</span>.<br /><br />You need:<br /><ol><li><span style="font-weight: bold;">Packet Tracer 5.2</span>. I'm not sure if this file was in5.0 or 5.1, so just get 5.2 (it fixes quite a few bugs anyway). I tried this with the Linux version. Look for the "<span style="font-weight: bold;">ptaplayer-011.01.jar</span>" under /usr/local/PacketTracer5/extensions/ptaplayer/.<br /></li><li><span style="font-weight: bold;">A Java compiler</span>. In Ubuntu, "apt-get install openjdk-6-jdk" or "sun-java6-jdk" will do.</li></ol>Get this code and paste it in a file named "Grade.java":<br /><pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"><code>import apiipc.generated.system.*;<br />import java.io.File;<br />import pse.pt.PacketTracer;<br /><br />class Grade<br />{<br />public static void main(String args[])<br /> throws Exception<br />{<br /> File file;<br /> PacketTracer packettracer;<br /> if (args.length != 1) {<br /> System.err.println("You need to specify a pka file to grade");<br /> System.exit(1);<br /> }<br /> file = new File(args[0]);<br /> packettracer = new PacketTracer("localhost", 39000, true);<br /> packettracer.launch();<br /> packettracer.connect();<br /> packettracer.fileOpen(file.getCanonicalPath());<br /><br /> ActivityFile activityfile = packettracer.getActivityFile();<br /> Double s = activityfile.getPercentageComplete();<br /><br /> System.out.println((new StringBuilder()).append(s).append("\t").append(args[0]).toString());<br /><br /> packettracer.shutDown();<br />}<br />}<br /><br /></code></pre><br />Compile it with:<br /><pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"><code>$ javac -classpath ptaplayer-011.01.jar Grade.java<br /></code></pre><br />Now get some PKA file and try to grade it!<br /><pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"><code>$ java -classpath ./ptaplayer-011.01.jar:. Grade 3.3.2.3.pka<br /><span style="font-weight: bold;">100.0 3.3.2.3.pka</span><br /></code></pre><br />Yes, that "100.0" indicates the score is 100% :)<br /><br />You might want to wrap the ugly java command line into a simpler script. One thing I noticed is that Packet Tracer opens a window even though it's running in "no-gui" mode. No big deal on an X desktop (the window will pop up briefly and then disappear), but it makes the whole thing totally inadequate for headless servers without X, since Packet Tracer <span style="font-weight: bold;">does</span> need X. As a workaround, you can use xvfb. Like this:<br /><pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"><code>#!/bin/sh<br /><br />sd=$(dirname $0)<br />xvfb-run java -classpath "$sd"/ptaplayer-011.01.jar:"$sd" Grade "$1"<br />sleep 1 # Give xvfb time to die<br /></code></pre><br />That's about it. Put this, Grade.class and the .jar file in ~/pkagrader and just do ~/pkagrader/grade <activity.pka> to get the score.<br /><br />When you have a bunch of PKAs, just do this to grade them all:<br /><pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"><code>$ for i in *; do ~/pkagrader/grade "$i"; done<br /></code></pre><br />A few challenges still remain...<br /><ol><li>As of 1.9.5+, Moodle doesn't support downloading <span style="font-weight: bold;">all</span> the assignment files at once. You have to go one by one. Fortunately <a href="http://tracker.moodle.org/secure/attachment/15586/download_all_submitted_assignments.patch">this patch will add this feature</a>. It applies cleanly on a 1.9.5+ install. This is<a href="http://tracker.moodle.org/browse/MDL-7206"> the jira issue about the issue</a>.<br /></li><li>The ultimate solution would be creating a new type of activity for Moodle, something like "Packet Tracer activity" and having the grader fire up automatically after a student uploads a .pka. Anyone interested?<br /></li></ol><br /><br /></activity.pka>Javihttp://www.blogger.com/profile/16272655712298110840noreply@blogger.com3