Posts Tagged Hacks

 

A chat protocol for remote lectures

Due to the current coronavirus lock-down we’re holding all our lectures remotely; currently via Microsoft Teams meetings. Students can see my presentation and me talking, and I can hear them, when they unmute their microphone. (By default they are muted to avoid noise and echoes.) What I thought I would miss is the lecture’s interactions: the responses I get to questions I pose to the students, as well as students’ comments and questions. We found out that such interactions can work quite well — at times better than in the face-to-face lecture — by following a simple interaction protocol.

Continue reading "A chat protocol for remote lectures"

How to make a MacBook Kensington Lock Adapter

Apple, in its infinite wisdom, has not included a Kensington lock slot in the current model of the MacBook Pro computer. Given the computer's price, desirability, and the fact that three people I know have had theirs stolen, I decided to build an improvised adapter that would allow me attach a Kensington lock to the computer. I realize, that the security offered by such a contraption is what my colleague Vassilis Prevelakis calls an "advisory lock", for Kensington locks can be easily picked or pried away. However, I think it might deter a casual thief who would snatch the laptop you've left unattended for a couple of minutes.

Continue reading "How to make a MacBook Kensington Lock Adapter"

Ten Lessons I Learned from Fixing my Laptop's Motherboard

A month ago I managed to break my laptop, by reversing the polarity of a universal power supply. The repair shop diagnosed the problem as a failed motherboard, and asked for €659 to replace it. I found the price preposterous and the notion of throwing away a motherboard for a single failed component ecologically unsound. Here is how I fixed the laptop on my own, and what I learned in the process.

Continue reading "Ten Lessons I Learned from Fixing my Laptop's Motherboard"

Batch Files as Shell Scripts Revisited

Four years ago I wrote about a method that could be used to have the Unix Bourne shell interpret Windows batch files. I'm using this trick a lot, because programming using the Windows/DOS batch files facilities is decidedly painful, whereas the Bourne shell remains a classy programming environment. There are still many cases where the style of Unix shell programming outshines and outperforms even modern scripting languages.

Continue reading "Batch Files as Shell Scripts Revisited"

Useful Polyglot Code

Four years ago I blogged about an incantation that would allow the Windows command interpreter (cmd) to execute Unix shell scripts written inside plain batch files. Time for an update.

Continue reading "Useful Polyglot Code"

HP-200LX Remote Control Hacks

All my friends know that for the past 15 years I've been semi-attached to an HP 100LX palmtop PC (recently updated to a 200LX) for my personal information management and many other tasks. The device is extremely versatile, sturdy, and flexible. Amazingly, after so many years of hard daily use, I still find new applications for it.

Continue reading "HP-200LX Remote Control Hacks"

How to Create a Self-Referential Tweet

Yesterday Mark Reid posted on Twitter a challenge: create a self-referential tweet (one that links to itself). He later clarified that the tweet should contain in its text its own identifier (the number after "/status/" bit should be its own URL). I decided to take up the challenge ("in order to learn a bit about the Twitter API" was my excuse), and a few hours later I won the game by posting the first self-referential tweet. Here is how I did it.

Continue reading "How to Create a Self-Referential Tweet"

Earth Hour: A Geek's View

What happens to the power grid when millions of people turn of their lights? I had a chance to study this during tonight's Earth Hour: an international event organised by the WWF, which asks households and businesses to turn off their non-essential lights and electrical appliances for one hour to raise awareness towards the need to take action on climate change.

Continue reading "Earth Hour: A Geek's View"

Visualizing Revision Logs with a UML Sequence Diagram

How can you visualize the developers' contributions in a collaborative project? One way involves drawing timelines adorned with marks indicating each developer's contribution. This is a simple UML sequence diagram, a diagram that allows you to see the interactions of objects, but in this case the objects are the actual developers and the interactions are their contributions.

Continue reading "Visualizing Revision Logs with a UML Sequence Diagram"

Palindromic Palindrome Checking

Stan Kelly-Bootle's column in the April 2007 ACM Queue, titled Ode or Code? — Programmers Be Mused!, was as always very enjoyable. However, I found its ending, a C function that returns true when given a palindromic string (e.g. ABCCBA), anticlimactic. The function given is recursive; I was expecting it to be palindromic. How difficult can it be to write such a function?

Continue reading "Palindromic Palindrome Checking"

The Power of Reusable GUI Elements

One can manipulate any graphical element of the Squeak environment by bringing up its halo: a rectangular set of icons representing actions that one can perform on any object. At first I found it cumbersome to have to go through the halo in order to perform any action, like recoloring an object or changing its name. Later I saw that this method is incredibly powerful.

Continue reading "The Power of Reusable GUI Elements"

(Not) Hacking the Digipass Go 3 OTP Dongle

My bank moved to two factor authentication solution, and thus required me to purchase from them a Digipass Go 3 dongle in order to authenticate my transactions. To register my dongle I keyed-in a five-digit code they gave me, and also the key's serial number appearing on its back. Given that Go 3 utilizes an open authentication framework, and a published algorithm for generating the one time password (OTP), could I utilize the key and the numbers I keyed in, for using the key in my own applications, of for cloning the dongle in my mobile phone or palmtop?

Continue reading "(Not) Hacking the Digipass Go 3 OTP Dongle"

White Noise Calms Babies

A week ago I told my colleague Damianos Chatziantoniou that drying the body of a newborn baby with a hair drier keeps it consistently dry avoiding rashes, and also calms the baby down. Today he told me the advice worked wonders. Many parents have discovered that sources of white noise, like the sound of a vacuum cleaner or a hair drier, seem to calm down a baby's crying spell.

Continue reading "White Noise Calms Babies"

Converting RIS to BibTeX

Digital libraries increasingly provide an option to export bibliographic data. Unfortunately, many, like IEEE Xplore, SpringerLink, and Scopus don't support the BibTeX format I use for storing my bibliographies. (To its credit the ACM Portal offers a BibTeX export option. On the other hand, Elsevier's ScienceDirect and JSTOR don't offer any export facility.)

Continue reading "Converting RIS to BibTeX"

Web Page Hits, Amazon.com's Sales Rank, and Actual Sales

Over the past three years I've been collecting the amazon.com Sales Rank for my book Code Reading: The Open Source Perspective, and (lately) also for its sequel Code Quality: The Open Source Perspective. Yesterday I mapped the sales rank to actual sales, and correlated those with significant events and hits on the book's web page.

Continue reading "Web Page Hits, Amazon.com's Sales Rank, and Actual Sales"

Batch Files as Shell Scripts

Although the Unix Bourne shell offers a superb environment for combining existing commands into sophisticated programs, using a Unix shell as an interactive command environment under Windows can be painful.

Continue reading "Batch Files as Shell Scripts"

A General-Purpose Swap Macro

A couple of days ago I came up with a general-purpose macro for swapping values in C programs. My colleague Panagiotis Louridas suggested an improvement, and this prompted me to see the two macros got compiled.

Continue reading "A General-Purpose Swap Macro"

How to Sort Three Numbers

Quick: how do you sort three numbers in ascending order?

Continue reading "How to Sort Three Numbers"

Supporting Java's Foreach Construct

Java 1.5 supports a new foreach construct for iterating over collections. The construct can be used on arrays and on all classes in Java's Collection framework. I searched the internet for an example on how to make my own classes iterable with this construct, but could not find an example.

Continue reading "Supporting Java's Foreach Construct"

Solving Singh's Substitution Cipher

Many of us enjoy playing with encryption algorithms. Simon Singh, before a book promotion trip to Greece, published a "substitution cipher with a twist". I would consider solving a substitution cipher aimed at the general public unfair, but the "twist" made me curious.

Continue reading "Solving Singh's Substitution Cipher"

A Pipe Namespace in the Portal Filesystem

The portal filesystem allows a daemon running as a userland program to pass descriptors to processes that open files belonging to its namespace. It has been part of the *BSD operating systems since 4.4 BSD. I recently added a pipe namespace to its FreeBSD implementation. This allows us to perform scatter gather operations without using temporary files, create non-linear pipelines, and implement file views using symbolic links.

Continue reading "A Pipe Namespace in the Portal Filesystem"

Macro-based Substitutions in Source Code

A friends asks: "How can one easily replace a method call (which can contain arguments with brackets in its invocation code) with a simple field access?

Continue reading "Macro-based Substitutions in Source Code"

Measuring the Effect of Shared Objects

For the Code Quality book I am writing I wanted to measure the memory savings of shared libraries. On a lightly loaded web server these amounted to 80MB, on a more heavilly loaded shell access machine these ammounted to 300MB.

Continue reading "Measuring the Effect of Shared Objects"

Digital Data Makes Anything Possible

Once data becomes digital anything and everything becomes possible. Consider arranging the books on your bookshelf by the color of their book cover.

Continue reading "Digital Data Makes Anything Possible"

Binary File Similarity Checking

How can one determine whether two binary files (for example, executable images) are somehow similar? I started writing a program to perform this task. Such a program could be useful for determing whether a vendor had included GNU Public License (GPL) code in a propriatary product, violating the GPL license. After writing about 20 lines, I realized that I needed an accurate definition of similarity than the vague "the two files contain a number of identical subsequences" I had in mind.

Continue reading "Binary File Similarity Checking"

A Unix-based Logic Analyzer

A circuit I was designing was behaving in unexpected ways: the output of a wireless serial receiver based on Infineon's TDA5200 was refusing to drive an LS TTL load. To debug the problem I needed an oscilloscope or a logic analyzer, but I had none. I searched the web and located software to convert the PC's parallel port to a logic analyzer. I downloaded the 900K program, but that was not the end. Unfortunately the design of Windows 2000 does not allow direct access to the I/O ports, so I also downloaded a parallel port device driver and a program to give the appropriate privileges to other programs. Finally, I also downloaded from a third site the Borland runtime libraries required by the logic analyzer. Needless to say that the combination refused to work.

Continue reading "A Unix-based Logic Analyzer"

Become a Unix command line wizard
edX MOOC on Unix Tools: Data, Software, and Production Engineering
Debug like a master
Book cover of Effective Debugging
Compute with style
Book cover of The Elements of Computing Style
Syndication
This blog is also available as an RSS feed:

Category Tags
AI (4)
AWS (4)
Android (2)
Apple (11)
C (21)
C++ (17)
Computers (58)
Databases (6)
Debugging (10)
Discussion (6)
Electronics (15)
Environment (1)
FreeBSD (26)
Funny (14)
GSIS (5)
Git (2)
Google (6)
Government (3)
Hacks (26)
Hardware (27)
History (13)
Information systems (1)
Internet (12)
Java (26)
JavaScript (1)
Linux (7)
Management (27)
Microsoft (11)
One Laptop Per Child (3)
Open source (58)
Opinion (30)
Parenting (11)
Perl (13)
Photos (13)
Politics (5)
Programming (110)
Python (3)
R (1)
Raspberry Pi (6)
Risks (7)
Scala (1)
Science (35)
Security (26)
Sights (19)
Smartphones (3)
Software (22)
Software engineering (93)
Standards (7)
System administration (46)
Teaching (9)
Technology (33)
Testing (3)
Tips (43)
Tools of the Trade (52)
Travel (9)
UML (6)
Unix (53)
Web (31)
Windows (17)
Writing (46)
XML (10)
vim (5)
Archive
Complete contents (382)
2024 (3)
2023 (5)
2022 (2)
2021 (3)
2020 (15)
2019 (4)
2018 (5)
2017 (20)
2016 (7)
2015 (6)
2014 (5)
2013 (13)
2012 (17)
2011 (14)
2010 (13)
2009 (40)
2008 (40)
2007 (41)
2006 (48)
2005 (44)
2004 (30)
2003 (7)

Last update: Wednesday, December 4, 2024 1:52 pm

Creative Commons Licence BY NC

Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.