tag:blogger.com,1999:blog-86846732231895091152024-03-05T07:56:45.685+00:00Lucid Electric DreamsJournal of dabblings in Linux and Software EngineeringJanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.comBlogger84125tag:blogger.com,1999:blog-8684673223189509115.post-26792568612269535412015-06-07T13:16:00.001+01:002015-06-07T13:16:41.939+01:00Fedora 22 - Unresponsive Mirrors and DNFAfter installing a fresh copy of Fedora 22, I discovered that I could not install any packages due to a faulty mirror. DNF, the new package manager, failed to detect the faulty mirror and move on to the next available one. Here are a few tweaks I made to get DNF to work even in the face of bad mirrors.
Manually install the latest update to librepo
At the time of writing, a bug fix to JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-74002138450543964802013-11-13T20:27:00.002+00:002013-11-13T20:27:52.279+00:00No FileSystem for scheme: hdfsI recently came across the "No FileSystem for scheme: hdfs" error from a Scala application that I wrote to work with some HDFS files. I was bundling the Cloudera Hadoop 2.0.0-cdh4.4.0 libraries with my application and it turns out that the FileSystem service definition for HDFS was missing from the META-INF/services directory. The fix is as follows:
Create a META-INF/services directory in src/JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-9131412551138596062013-11-09T22:12:00.000+00:002013-11-09T22:13:39.435+00:00Reducing the number of threads created by the ElasticSearch Transport ClientThis is a quick snippet saved for posterity so that I won't have to pull my hair out the next time I run into this issue.
To reduce the number of threads spawned by the ElasticSearch transport client (default is 2 x num_cores) add the following option to the settings object:
Settings settings = ImmutableSettings.settingsBuilder().put("transport.netty.workerCount",NUM_THREADS).build();
JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com2tag:blogger.com,1999:blog-8684673223189509115.post-69380871738562711282013-06-08T18:13:00.001+01:002013-06-08T18:18:51.892+01:00Setting up dnscrypt on FedoraDNSCrypt is a free service by OpenDNS that provides encrypted DNS lookups. If you are concerned about man-in-the-middle attacks, data collection/spying by various entities or ad injections by unscrupulous ISPs, encrypting your DNS lookups is a good starting point. Bear in mind that just encrypting your DNS lookups will not make you secure online. It has to be used in conjunction with a lot of JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-67541397676375839972013-02-09T17:37:00.001+00:002013-02-09T17:37:25.848+00:00Mounting a Nexus 7 on FedoraIf you need to transfer several gigabytes of data between your computer and the Nexus 7 tablet, the fastest option is to mount the N7 as a MTP file system. One way to achieve this is through the mtpfs tool which can be found in the Fedora repositories. However, I found it to be buggy and slow. The better option, as mentioned in Linux Format 165, is to use jmtpfs. The installation instructions on JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-38177689713819169702012-12-29T13:00:00.000+00:002012-12-29T18:21:12.237+00:00Recovering from Cassandra "Value already present" errorThis is a write-up of the process I recently went through with a sysadmin colleague to recover from a crippling Cassandra failure that threatened to make all of our data inaccessible. I am deviating from my usual step-by-step instruction style here because I am not quite confident that this particular method is applicable to all situations. We had a clear mandate about which sets of data had to JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com1tag:blogger.com,1999:blog-8684673223189509115.post-55235725879142213332012-09-15T20:57:00.002+01:002012-09-15T20:57:24.786+01:00Powerlines Prompt for BashPowerline-bash is a cool python script that changes your bash prompt depending on the context. For example: if you are on a git directory, the prompt will display the branch name. If there are any uncommitted changes, a small plus sign will appear. Pretty cool!.
Get it from https://github.com/milkbikis/powerline-bash and follow the instructions in the README to install. I had to additionally JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-8766841848557162292011-11-16T18:24:00.001+00:002011-11-16T18:37:44.360+00:00Fedora 16 - Kile installationKile is a fantastic editor for creating LaTEX documents. It is part of the KDE suite of applications, but runs perfectly fine under Gnome when the KDE libraries are installed.
Unfortunately, the Kile package in Fedora 16 appears to be broken. When trying to start the application, a dialog box pops up with the message: "No editor component found. Please check your KDE installation". The JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com1tag:blogger.com,1999:blog-8684673223189509115.post-37294982905233672742011-11-14T22:03:00.001+00:002011-11-14T22:47:53.942+00:00Enable graphical plymouth boot in Fedora 16 with nvidia driversInstallation of nvidia drivers under Fedora is well documented. (See http://forums.fedoraforum.org/showthread.php?t=204752). In previous versions of Fedora, enabling the plymouth graphical boot was quite easy. All one had to do was to add the following kernel arguments to grub.conf.
rdblacklist=nouveau nomodeset vga=ask
Starting from release 16, Fedora uses Grub2 as the bootloader. The JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com11tag:blogger.com,1999:blog-8684673223189509115.post-90928470101324615422011-11-14T19:49:00.001+00:002011-11-14T22:50:41.422+00:00Firefox font smoothing in LinuxAfter upgrading to Fedora 16, I noticed that the font rendering looked awful in Firefox. Even an upgrade to Firefox Aurora made no difference. Purely out of desperation, I tried a method I had used previously to fix a similar issue with Chrome, (http://www.lucidelectricdreams.com/2010/09/ugly-font-rendering-in-chrome-linux.html) and hit the jackpot!.
The original post by Zach Beane can be found JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-66465508318480615152011-11-14T18:35:00.001+00:002011-11-14T22:51:05.699+00:00Installing Caffeine 2.4.1 on Fedora 16Regular readers probably know that I am a big fan of the Caffeine project (https://launchpad.net/caffeine). I even contributed the Gnome Shell patches to it (http://www.lucidelectricdreams.com/2011/06/disabling-screensaverlock-screen-on.html). After a fresh install of Fedora 16 "Verne", I attempted to install the latest version of Caffeine from the project page - which at the moment is 2.4.1 - JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-83043966785440300112011-10-17T18:52:00.002+01:002011-11-14T22:51:22.507+00:00Gnome Shell Cheat SheetSome very handy tips here. I particularly wasn't aware that I could use the scroll wheel to zoom in on windows in the overview mode.
https://live.gnome.org/GnomeShell/CheatSheetJanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-13432972155908595302011-10-14T00:33:00.002+01:002011-11-14T22:51:37.614+00:00GTIN Validation with PythonGTINs (Global Trade Item Number) are ubiquitous. We commonly see them as barcodes on products. They come in several different types and names such as EAN, UPC or ISBN etc.
Recently, I needed to validate a set of GTINs stored in a file. To my surprise (unless my Google-fu is getting weak), I could not find any libraries written in Python for doing this. The algorithm (http://www.gs1.org/barcodes/JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-78527905256465554572011-09-14T21:53:00.000+01:002011-09-14T21:55:38.463+01:00Windows 8 Developer PreviewMicrosoft has just released the Developer Preview of Windows 8 - which can be grabbed from http://msdn.microsoft.com/en-us/windows/home/.
I had a gander by installing it on a VM. The Metro UI looks quite good and I think it's great that most vendors are moving towards HTML5, CSS and Javascript based apps. (well.. at least they are mostly standardised and for once many giants of the industryJanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0Hatfield, Hertfordshire AL10, UK51.7648856 -0.23957151.7255771 -0.318535 51.8041941 -0.160607tag:blogger.com,1999:blog-8684673223189509115.post-76785479790466276362011-07-07T19:47:00.000+01:002011-09-13T21:09:11.465+01:00Using System.getProperty() with Jenkins buildsOne of my recent projects needed to be able to manipulate file paths according to a set of rules and read and process files directly from the file system. When it came to writing unit tests for this module, I was faced with a dilemma. My usual approach for this kind of system is to use the "Test Double" pattern to hide environment specific details from the tests to make them portable across JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-36533908428369529072011-06-16T22:36:00.000+01:002011-09-13T21:16:11.981+01:00Oracle client 11g installation under wineI am a steadfast Fedora user both at home and at work. However, most of my colleagues tend to use Ubuntu and one of the problems I have come across a few times is the inability to install the Oracle client software under wine in Ubuntu. It all works fine under Fedora, so why does it fail on Ubuntu with the error message "java.lang.NullPointerException at JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-62076751045790001432011-06-14T21:21:00.000+01:002011-09-13T21:09:11.465+01:00Reading and writing GSettings from PythonHere's the class I wrote to read/write the screensaver settings from GSettings. It's probably not in the best Python style, but it illustrates the idea.from gi.repository import Gio,GLibclass GnomeScreenLock: IDLE_DELAY_SCHEMA = 'org.gnome.desktop.session' IDLE_DELAY_KEY = 'idle-delay' IDLE_ACTIVATION_SCHEMA = 'org.gnome.desktop.screensaver' IDLE_ACTIVATION_KEY = 'idle-activation-enabled' JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-5503916257708668322011-06-14T21:05:00.000+01:002011-09-13T21:09:11.466+01:00Disabling screensaver/lock-screen on Gnome 3 during Flash moviesWith the release of Gnome 3, most of the old Gnome APIs have undergone major changes. Many of these changes are not backward compatible at all. This presents an interesting challenge; specially at this still early stages of Gnome 3 developement - where almost everything is in a state of flux.I regularly watch tech presentations from conferences - which are usually presented as Flash videos. JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com4tag:blogger.com,1999:blog-8684673223189509115.post-62497274836982140852011-06-05T11:06:00.000+01:002011-09-13T21:09:11.466+01:00Adding your own launchers to gnome-shell dashThis one has been driving me nuts for days!I have a few applications that I install on my home directory and never copy to the global /usr directories. Naturally, they don't show up in the applications menu. In Gnome 2, adding a shortcut to such an application was as simple as right clicking the panel and selecting "Create new launcher". Unfortunately, since Gnome 3 seems to be designed by Mac JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com2tag:blogger.com,1999:blog-8684673223189509115.post-8643884651237650292011-06-03T20:00:00.000+01:002011-09-13T21:09:11.466+01:00BufferbloatInteresting Google tech talk by Jim Gettys about Bufferbloat: http://www.youtube.com/user/GoogleTechTalks#p/u/0/qbIozKVz73gAlso checkout netalyzr to test and gather information about your network connection : http://netalyzr.icsi.berkeley.edu/ JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-12298562390382221312011-05-21T23:37:00.000+01:002011-09-13T21:09:11.466+01:00Strong,Soft,Weak and Phantom References in JavaIf you read any documentation on Java garbage collection, the term "strong/weak/soft/phantom reference" crops up quite frequently. It's easy to guess what strong references are, but what the heck is a phantom/weak/soft reference?I stumbled on a very informative post about each of the reference types at http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html. It is an article JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-50595086123626913302011-05-16T21:43:00.000+01:002011-09-13T21:09:11.466+01:00The Python ChallengeThe Python challenge is an online riddle inspired by notpron. The catch is that each level requires you to write some Python code (or Perl, Ruby etc. etc. if you are so inclined) to arrive at the solution. The hardest part is figuring out the cryptic clues. The Python bit is easy; so far, the longest piece of Python I have written to solve a riddle is about 6 lines. (Admittedly, I am still on JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-84555421638322992572011-05-15T14:09:00.000+01:002011-09-13T21:09:11.467+01:00Javac type inference bugScenario: A generics based configuration reader that worked perfectly fine under Eclipse, suddenly started failing inside a Jenkins build. The cause was a compilation error: "type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds int,java.lang.Object".According to this bug report, this is an almost 6 years old javac bug. JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0tag:blogger.com,1999:blog-8684673223189509115.post-67970124987129131192011-05-12T20:05:00.000+01:002011-09-13T21:09:11.467+01:00Kill tasks in Windows through the command lineI received a frantic phone call from my Dad last night, who lives a few thousand miles away, across a few oceans. "My computer is not working. Something is wrong with my hard disk" - he said. "Fix it!". Although it was flattering that my dad thinks that I could magically fix a bad hard drive from a few thousand miles away, it didn't sound quite right because he had just recently bought that JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com2tag:blogger.com,1999:blog-8684673223189509115.post-13983665068011254532011-03-26T19:21:00.001+00:002011-03-26T19:24:11.108+00:00Hadoop Installation GotchasOver the last few years, with most large scale data processors such as Google, Yahoo, Amazon, Twitter and Facebook open-sourcing their internal data crunching algorithms/software, "BigData" projects have taken off exponentially. We are now in the BigData era of computing, where a large number of companies and individuals are contributing to or adopting software stacks such as Hadoop, JanuZhttp://www.blogger.com/profile/13168312903452312467noreply@blogger.com0