New Fedora package: ntfs-3g-system-compression

If you have a Windows 10 installation, you might not be able to read all files on its NTFS partition. Under certain conditions, Microsoft compresses system files with new compression algorithms which the ntfs-3g driver can’t currently read. Files are displayed with question marks when listed using ls, and you’ll see Input/output error or unsupported reparse point when trying to access these files. Here’s an example:

$ ls -l Windows
...
drwxrwxrwx 1 kparal kparal        0 Sep 15 09:33  ModemLogs
-????????? ? ?      ?             ?            ?  notepad.exe
drwxrwxrwx 1 kparal kparal        0 Dec 14 21:57  OCR
drwxrwxrwx 1 kparal kparal        0 Sep 15 09:33 'Offline Web Pages'
drwxrwxrwx 1 kparal kparal    16384 Dec 14 14:17  Panther
drwxrwxrwx 1 kparal kparal        0 Sep 15 09:33  Performance
-rwxrwxrwx 1 kparal kparal   984966 Feb 13 23:15  PFRO.log
drwxrwxrwx 1 kparal kparal        0 Sep 15 09:33  PLA
drwxrwxrwx 1 kparal kparal    49152 Dec 14 21:59  PolicyDefinitions
drwxrwxrwx 1 kparal kparal   163840 Feb 14 22:41  Prefetch
drwxrwxrwx 1 kparal kparal     4096 Dec 14 14:15  PrintDialog
-????????? ? ?      ?             ?            ?  Professional.xml
drwxrwxrwx 1 kparal kparal     4096 Sep 15 09:33  Provisioning
-????????? ? ?      ?             ?            ?  regedit.exe
drwxrwxrwx 1 kparal kparal        0 Dec 14 22:09  Registration
drwxrwxrwx 1 kparal kparal        0 Sep 15 11:11  RemotePackages
...

$ ls -l Windows/notepad.exe
ls: cannot access 'Windows/notepad.exe': Input/output error

$ cp Windows/notepad.exe .
cp: cannot stat 'Windows/notepad.exe': Input/output error

$ stat Windows/notepad.exe
File: Windows/notepad.exe -> unsupported reparse point
Size: 25            Blocks: 0          IO Block: 4096   symbolic link
Device: 803h/2051d    Inode: 247077      Links: 3
Access: (0777/lrwxrwxrwx)  Uid: ( 1000/  kparal)   Gid: ( 1000/  kparal)
Access: 2019-02-14 22:40:13.270993900 +0100
Modify: 2018-09-15 09:28:56.687095900 +0200
Change: 2018-12-14 21:52:10.685553700 +0100
Birth: -

Fortunately, there’s a ntfs-3g-system-compression plugin that allows you to read those files:

$ ls -l Windows/notepad.exe 
-r-xr-xr-x 3 kparal kparal 254464 Sep 15 09:28 Windows/notepad.exe

The new package is now proposed as an update in Bodhi, but in a week or so you should be able to install it with a simple:

$ sudo dnf install ntfs-3g-system-compression

Enjoy.

New Fedora package: ntfs-3g-system-compression

glxosd and voglperf now available for Fedora in COPR

For all our gaming enthusiasts, I packaged glxosd and voglperf for Fedora and you can find them in my COPR repositories: glxosd COPR and voglperf COPR.

These tools allow you to have FRAPS-like features on Linux, i.e. show an overlay in OpenGL games/apps to display current FPS, and also capture the frame times into a file and plot them to a graph later. So you can now use it with any Linux game and fine-tune its graphics settings to match your preferred performance. Or you can see when your CPU or GPU is overheating. Or you can contribute to Open Game Benchmarks. Or something else.

This is an example of the glxosd overlay in action (don’t worry, its output is configurable):

glxosd-chivalry.png
glxosd overlay

And if you want, you can later plot the performance into such pretty graphs using this awesome glxosd analyser web page:

glxosdGraph-fps.png
fps graph
glxosdGraph-frametimes.png
frame times graph

And this is an example of the voglperf overlay (top left corner):

voglperf-xcom.png
voglperf overlay

And a generated graph:

voglperf-frametimes.png
frame times graph

There are other similar tools which you can use, but I know about any that is generic and has all these features. There is of course the Steam FPS overlay, but you can only use it for Steam games, and it can’t log frame information. There’s also GALLIUM_HUD, but that’s only available for Gallium-enabled drivers (radeon, nouveau) and also can’t log frame information. These two new tools should work with any driver and can be used for any game/app.

You can find installation instructions in the linked COPR repos. I do not intend to move these packages to official Fedora repos, but if somebody is willing to get their hands dirty and work on that, great, please contact me and I’ll try to help.

Enjoy!

Flattr this

glxosd and voglperf now available for Fedora in COPR

New package in Fedora: sendKindle

sendKindle allows you to easily send documents to your Amazon Kindle device using a command line. You no longer need to open an email client, create a new email, fill in the recipient and a subject, add attachments, hit send, no. You just write sendKindle into your terminal, drag and drop the file, hit Enter. It’s faster 🙂

I already blogged about sendKindle before. It will use your email account (I tested just GMail) to send the file to your Amazon address. (As a bonus, I have a filter defined in GMail which will move these emails from the Sent mail to Trash, because I don’t want all the files to clutter my mailbox, and it works great.)

Recently I finally became a packager (hooray!) and pushed sendKindle as my first package into Fedora. It’s currently in updates-testing, so until it receives some karma or a week passes, you can install it like this:

$ yum install sendKindle --enablerepo=updates-testing

In a week you can use your favorite package manager without any further “complications”, because it will have landed in stable updates for Fedora 17 and 18.

The project lives at github, report all your problems there (except packaging bugs, which go to bugzilla). Be sure to see the README though – if you want new features, you need to provide patches.

Enjoy.

New package in Fedora: sendKindle

Bookmarklet: Maximize your YouTube videos

A few days ago I got pretty annoyed at YouTube:

  • The video windows are really small, even enlarged. It doesn’t respect available screen size at all. It is impossible to size it arbitrarily.
  • Fullscreen is cancelled when you adjust the system volume using hotkeys (Firefox+HTML5+Linux).
  • Fullscreen is cancelled when you switch to a different application (HTML5, Flash).
  • Fullscreen can’t be used even in a dual-head setup, i.e. run the video on one screen and work on another.
  • Entering and leaving fullscreen causes video quality switching every single time (HTML5). That causes a few seconds lag. The only way to work around is to manually select video quality, then it’s not changed forth and back.

The net result: I swear a bloody vendetta to YouTube/Flash/Firefox developers every time I want to watch large videos and do something else (or adjust my volume!) at the same time.

I haven’t found any good solution for this on the Internets, so I created my own. Here’s my glorious bookmarklet:

>> Get YouTube Maximizer

(I had to create in on an external site, because WordPress doesn’t allow to insert bookmarklets into blogs. So just follow the link).

Drag and drop the button to your bookmarks bar in your browser. Then visit YouTube, open up some video and click the button in your bookmarks bar. The video should reload and fill your whole screen. It should also automatically switch to 720p quality, if available.

Before:

ytmax-before

After:

ytmax-after

This has several advantages:

  1. Your browser window is fully resizable and the video dimensions change with it.
  2. If you switch your browser to run in fullscreen, the video still works, even if you switch to a different application. Here we come, multi-head!
  3. You no longer need to manually force HD video quality.

Some final notes:

  • The bookmarklet source is here. Please bear in mind I have zero HTML/JS knowledge. If you have some patches, post them on github.
  • Flash is required for this to work. Patches welcome on how to do the same thing with HTML5.
  • If you want something else than 720p to be the default, just edit the bookmarklet and change quality="hd720" to something else.

Enjoy.

Flattr this

Bookmarklet: Maximize your YouTube videos

bzattach – script to attach multiple files to bugzilla from shell

Don’t you guys just hate using Bugzilla’s web interface for attaching files? Especially when you have like >= 5 of them? I do. It’s slow, it requires like 20 mouse clicks and whatnot.

I recently learned you can use “bugzilla attach” command from python-bugzilla >= 0.6.2 (I had to install an .fc17 package), but it’s still not as easy as I would like to.

So I created a wrapper on top of that, “bzattach” command. Usage [1]:

$ bugzilla login       #only for the first time
$ bzattach 12345 *.log

Yay!

If you like it, get it while it’s hot!
http://git.fedorahosted.org/cgit/fedora-qa.git/

[1] “–help” is also supported, be sure to check that out

Flattr this
bzattach – script to attach multiple files to bugzilla from shell

sendKindle: send files to your Kindle from command line

Do you have an Amazon Kindle device and do you find the standard way of transferring files via email too uncomfortable? I’ve created a simple tool that may be of help.

I have lots of books (PDFs, PDBs, etc) on my computer. I also frequently download something from the web (HTML pages, images, …) I want to read later on my Kindle. But I am too lazy to find the data cable and I am also too lazy to open up web client and send the files as attachments. I wanted something simpler, so I created it.

The tool is called sendKindle. It’s a simple Python CLI script that takes all files specified as arguments and sends them to your Kindle device via your email provider (you need to create a configuration file with access details first).

You can find the code at:

https://github.com/kparal/sendKindle

You can check-out the code and run the tool directly, or install using easy_install:

# easy_install -U sendKindle

And then you just do:

$ sendKindle FILE...

On the first run you will be asked to create a configuration file at ~/.config/sendkindle/sendkindle.cfg with appropriate email settings (just copy and paste and change appropriately).

And that’s all, my friends. I hope some of you will find it useful.

Enjoy.

sendKindle: send files to your Kindle from command line

Esmska 0.21 released

I finally found the time and released Esmska 0.21. You’ll find some new gateways, new centralized dialog for user-gateway communication, largely improved gateway configuration, and some other bits.

And what is Esmska, exactly? It is a program for sending SMS messages to your friends’ phones from your computer.  You just have to choose a gateway through which to send the message. Esmska supports a few international ones that can send anywhere in the world. Those are paid of course. Some countries (like the Czech Republic) have lots of free gateways too. If you have a favorite gateway not supported by Esmska and have a little of http/javascript knowledge, you can implement it in a form of a simple plugin and your work will be part of the next release.

So, this is the link you want to click on: http://code.google.com/p/esmska/ 🙂

Enjoy.

Esmska 0.21 released

jabber-roster: back up the list of your Jabber contacts

I’m a backup fanatic. I try to backup all my personal data regularly. And I don’t mean just documents stored locally on my laptop. I also mean all my data located at various network services (“in the cloud”). Do you really believe that Google servers won’t suffer a major incident and won’t lose all your emails some day? I don’t. And what about your appointments in a web calendar, your RSS feeds in a web RSS reader, your photos at a web photo gallery, etc – do you believe it will stay there forever? I don’t. So I back up everything.

My last piece of “back-up scripts” is intended for backing up the list of my friends who use Jabber. It’s a very short and simple script – you just tell it the server, username and password of your Jabber account and it will print out the list of your friends (“the roster”). That’s all. It’s not much, but I don’t need anything more. Maybe you will find it useful too.

You can download it from here:
https://launchpad.net/jabber-roster

 

jabber-roster: back up the list of your Jabber contacts

Esmska in the Czech Open Source 2010 Awards

Well this is a surprise. I was invited to the Internet and Technology 10 conference, that – as the name suggests – is mainly about present and future Internet technologies (DNSSEC, IPv6, etc). It’s happening in Prague this Monday and Tuesday, you can watch it live (Czech language only, sorry). One part of it was announcing the results of Czech Open Source 2010 Awards. It is a poll where jury and the public vote for the most favorite software, project, event, celebrity, blog and company (6 categories) that is related to open-source. I was invited in for my personal project Esmska, as for the Software category. There were also a few fellow RedHatters with me – Martin Sivák as the representative for the LinuxAlt event and Radek Vokál as the representative for the Red Hat company.

As you might expect, there’s a reason I wrote this blogpost. Yes, there is. Esmska won the third place in the public vote and the first place in the jury vote. Yay! (I still don’t understand why, though…) On the next photo you can see me receiving the award and a chocolate notebook as a prize 🙂

What is Esmska, anyway? It is a front-end to web SMS gateways. Believe it or not, in some countries it is very popular to send loads of SMS messages. Some mobile providers have even free SMS gateways available on the web. Therefore many users use them instead of typing the messages on the phone. This is particularly true for middle and eastern Europe countries like Czech Republic, Slovakia or Poland. Esmska may be very handy for them because it provides contact list, history or mass messaging features for them. If you think you could use it, check out its website. Free web gateways are suitable only for a few countries, but you can always use a paid international gateway sending anywhere to the world.

The chocolate notebook (well, the keyboard) was quite good for a piece of computer hardware 🙂

Not only I have been awarded. LinuxAlt was the first in the Event category in the jury vote, so Martin Sivák obtained the prize too. Photo below. Red Hat unfortunately didn’t win the Company category, so no chocolate for Radek Vokál.

The ultimate winner (regardless of category) was program FreeRapid Downloader. PiracyLegal content downloading rules the world 🙂

Overall it was a nice event, I enjoyed it.

Esmska in the Czech Open Source 2010 Awards

Simple scripts for operating the system clipboard

Linux systems have three kinds of text selection – primary, secondary and clipboard. The clipboard is the most famous one, Ctrl+c, Ctrl+v, you know the stuff. At work I need to note down all the important stuff I worked on recently, to have some kind of work report. So I end up with document with many bullets containing project names, bugzilla ticket summaries and URLs, etc. What I really hate is transferring rich text properties in the clipboard together with the content. That means if I select a title of some bug, it is copied (into my web application I use for creating reports) as a big thick line with custom font. One has to reset all the formatting after every such insertion. Awful!

So let’s do something about it. Wouldn’t it be nice to convert the contents of the system clipboard to plaintext only? Fortunately a little of bash scripting can help:

#!/bin/bash

# print usage
if [ "$1" = '--help' -o "$1" = '-h' -o $# -ne 0 ]; then
 echo "Usage: $0"
 echo "Takes text in system clipboard and transforms it into plaintext."
fi

# get the plaintext
TEXT=`xsel -b`

# print the text, it may come handy sometimes
echo "$TEXT"

# replace the original rich-text with plaintext
echo -n "$TEXT" | xsel -b -i

Well, and now just store this script in your PATH and call it whenever needed. I used Gnome’s Keyboard shortcuts to define a shortcut to call this script anytime I need it. Works perfect 🙂

I also needed to print same basic information about a particular bug in a specific format, so I can easily put it into my report. Manually copying all the information is not fun. Let’s create another script (python-bugzilla must be installed):

#!/bin/bash

# print usage
if [ "$1" = '--help' -o "$1" = '-h' -o $# -ne 1 ]; then
 echo "Usage: $0 bug_id|bug_url"
fi

# parse bug id
ID="$1"
if [[ "$ID" == http* ]]; then
 ID=`echo $ID | sed -r 's/.*id=([0-9]+).*/\1/'`
fi

# query bugzilla
INFO=`bugzilla query --bug_id "$ID" --outputformat='%{url} %{component} %{summary}'`

# parse info into parts
URL=`cut -d ' ' -f 1 <<< "$INFO"`
COMPONENT=`cut -d ' ' -f 2 <<< "$INFO"`
SUMMARY=`cut -d ' ' -f 3- <<< "$INFO"`

# output text in a suitable format
OUTPUT="$URL
 \"${COMPONENT}: $SUMMARY\""

# print the output
echo "$OUTPUT"

# copy the output to X clipboard
echo "$OUTPUT" | xsel -b -i

# play a notification sound
paplay /usr/share/sounds/freedesktop/stereo/message.oga

So now I just run “bug 595448” command and it prints all the necessary information out for me and puts it also into the clipboard. Hail to the improved work efficiency! 🙂

I hope this helps somebody in these kinds of repetitive tasks – creating work reports. Improvements welcome.

Simple scripts for operating the system clipboard