DeutschEnglish

Submenu

 - - - By CrazyStat - - -

26. March 2012

autoNUM turns NUM on when external keyboard is connected

Filed under: Windows — Tags: , , , , , , , , — Christopher Kramer @ 11:41

autoNUM a small tool meant for laptops/notebooks. It turns NUM on automatically when you connect your external keyboard to your notebook. When you disconnect it, it automatically turns NUM back off again.

This is very helpful if you use an external keyboard frequently and love to use NUM when it is plugged in.

The tool has been available for quite a while now, but now an important update has been made. It fixes a bug that made autoNUM not recognize that the keyboard is not connect on startup. This is now fixed. Furthermore, the UI has been slightly improved.

Check out the tool and tell me if you like it.

Recommendation

Try my Open Source PHP visitor analytics script CrazyStat.

21. March 2012

Public SVN for CrazyStat

Filed under: CrazyStat — Tags: , , , — Christopher Kramer @ 23:12

Finally, CrazyStat’s SVN has gone public!

CrazyStat uses Sourceforge for SVN hosting. You can browse it here:

https://sourceforge.net/p/crazystat/code/

To checkout the current development version of CrazyStat, use one of these:

  • SVN over HTTP protocol:
    svn checkout http://svn.code.sf.net/p/crazystat/code/trunk crazystat-code
  • SVN protocol:
    svn checkout svn://svn.code.sf.net/p/crazystat/code/trunk crazystat-code

In the SVN repository, you can find the current CrazyStat 1.71 development version (in the trunk) along with 1.71 beta1 and beta2.

You can also read the commit logs to see what is going on with CrazyStat development.

In case you want to test the upcoming CrazyStat version 1.71, I’d recommend checking out the current development version from the trunk. Please let me know if you find any bugs or issues with the current development version (which will soon become RC1…).

This is part of my plans to make development of CrazyStat more open.

Greetings!

13. March 2012

sqlite.js: SQLite for Javascript!

Filed under: DBMS,JavaScript — Tags: , , , , , — Christopher Kramer @ 12:01

I just found something quite cool which I thought might be interesting to some of you.

Alon Zaka created emskripten, a LLVM-to-JavaScript converter. It can convert LLVM-bytecode such as provided by compilation from C/C++ code into JavaScript. This approach seems quite cool and it already proved to produce some cool results:

He converted the SQLite-library, which is written in C, into JavaScript. You can find (and fork) the project on github or just try the demo.

The first thing that I was curious about was: How does it store the database file? Well, it creates a new database when you do SQL.open(). But you can pass data to SQL.open(data) to start with a pre-filled database. So I think using this library would normally look like this:

  1. fetch the initial database from the server (e.g using AJAX). At least DB schema and some important data.
  2. open the database with SQL.js
  3. do some operations on the database, mostly SELECTs probably
  4. maybe fetch some more data using AJAX from the server when needed
  5. maybe send some data to the server to save changes using form or ajax

So this would mean we move some more stuff to the client. It would allow us to use SQL on the client side just like we do on the server-side. So we could use the same queries for javascript-based clients on the client and for html-only-clients on the server. (But exposing SQL-queries used in the server might make SQL injection as easy as never before…)

I see two other interesting ways of using this:

  1. In combination with HTML5 local storage – this would allow to store a persistent client-side database that could be accessed using SQL. Sounds pretty cool and the main usage scenario of SQL.js for me.
  2. On the server using node.js – but when I think about it: There are better ways to access a database within node.js, so this is probably only showing that it works, but no real usage scenario.

Tell me what you think about it.

10. March 2012

phpliteadmin: CSV import and export

Filed under: DBMS,PHP,phpLiteAdmin,Server Administration — Tags: , , , , , , , , — Christopher Kramer @ 12:24

In case you use sqlite, a serverless, transactional SQL-complete database engine, you might also know phpliteadmin. It is a web-based DB admin tool just like phpMyAdmin is for MySQL. It is small and does not require complex installation just like sqlite. It is great to do most simple operations on a sqlite database, but in my opinion it still has some important limitations and bugs.

One thing I recently missed was the possibility to import CSV files into a SQLite database. The SQLite shell makes this very easy (if the file has the correct syntax). But this has also some limitations and you have to leave the phpLiteAdmin GUI and start a SQLite shell. So I thought it should be part of phpLiteAdmin. It already had some GUI options for CSV import, but the actual import implementation was missing, so I implemented CSV import myself. On the way testing the exported csv and importing it again I noticed some export bugs of phpliteadmin like this one and fixed them on the way.

So those are the changes I did to phpLiteAdmin:

Import:

  • implemented CSV import with some features like:
  • you can define Enclosure, Escaper, Null and first-row-field-description just like when exporting
  • using PHP’s fgetcsv()
  • can import files that were exported with phpliteadmin using the same settings!
  • can even import files exported with phpliteadmin without my corrections and improvements (see below), although they are not “standard CSV”.

Export:

  • removed line terminator option because:
    • this was not implemented
    • in my opinion anything else than a linebreak does not make sense, so useless feature
  • Fix: Tables with indexes were exported multiple times
  • Fix: Last column was terminated which is not usual in CSV
  • NULLs are not enclosed anymore to allow distinction between “NULL”-text
  • FIX: Removing CRLF was not implemented
  • FIX: Tables that were not exported caused additional linebreaks in output

You can find anything related to these changes in phpLiteAdmin’s bug tracker.

You can also get my version with the improvements from the bugtracker or download it here.

I really hope this will make it into the next release of phpLiteAdmin, but unfortunately I did not get any feedback by the developers of phpLiteAdmin yet. Hopefully this is not getting a fork 😉

I hope you like these features and bugfixes. You can give me feedback here or in the phpliteadmin bug tracker.

I really think a good database management tool for SQLite is needed and phpLiteAdmin has the potential to become one. We will see.

You can also tell me if you use some other management tool for SQLite which you think is way better 😉

Update 2012/05/13: The phpliteadmin developers just announced that an official new version including these improvements will come up soon. Great news, I am looking forward to this new version!

4. March 2012

Forum (board) opened for discussion and support

Filed under: CrazyStat,Uncategorized — Tags: , , , , — Christopher Kramer @ 12:42

Today I would like to introduce Christosoft Forum.

It is meant both for support, especially about CrazyStat, but also any general discussion about things of common interest.

I hope it will be used especially for CrazyStat support.

You do not even have to register at the moment, you can post as guest if you solve a captcha. Let’s hope I can keep this setting and it won’t be abused.

So from now on, please use the forum if you have any problems with CrazyStat. Other users might help you before I find the time or you might find the solution for your problem in an old thread.

Let me know what you think of it, either here or in the forum.

Also let me know if you have suggestions, e.g. for subforums or forum settings.

Edit: This is part of my plans to make development of CrazyStat more open. Expect other steps like Bugtracker or public SVN soon…

29. February 2012

Windows: Mount VHD-file (virtual hard disk) via Right-Click

Filed under: Windows — Tags: , , , , , , — Christopher Kramer @ 12:18

You might know .vhd-files from Virtual PC or Windows Backup. In case you need to access a file from such a virtual hard drive, you can easily mount it in Windows.

It is possible via drive manager, but today I found a solution that is even a lot easier: Just right click a vhd-file and select to mount the file via “send to”.

Here is the tutorial including the necessary batch scripts:

How-To Geek: Mount and Unmount a VHD File in Windows Explorer via a Right-Click

Works great on Windows 7 – not tested any other version.

19. February 2012

CrazyStat 1.71 will be available in Russian

Filed under: CrazyStat — Tags: , , , — Christopher Kramer @ 22:49

Good news: The upcoming CrazyStat version 1.71 will come with a Russian language file.

Thanks a lot to Vladimir for the translation!

He did not only translate CrazyStat (and gave a lot of other feedback – thanks for that as well) but also offered to support Russian users via email. I will offer a mailform at the time CrazyStat 1.71 is released for that. Vladimir also proposed that I should open a forum to improve support and discussion around CrazyStat. I think this is a brilliant idea and I will definitely realize this along with the other ideas to make CrazyStat more open.

Russian is the first language that really benefits from UTF-8 and the Russian language file showed some minor problems in CrazyStat with UTF-8 that will also be fixed in 1.71. Other languages like Chinese will hopefully benefit from this as well one day.

CrazyStat 1.71 is into testing now and will hopefully be released soon. I already blogged that it will also be available in Danish and the other changes.

Translations of CrazyStat are always very welcome. If you speak some language that CrazyStat does not speak already, I would be very happy if you could translate CrazyStat. It is really not much work and I will help you if you have any problems. Languages like Chinese, Spanish, Italian, Japanese, Hindi, Arabic and French are still missing, just to name a few. If you speak any of these languages or some other language, please contact me and help to spread CrazyStat.

17. February 2012

Subversion (SVN): Permanently remove files from repository (history)

Filed under: Linux,Server Administration — Tags: , , , , , , — Christopher Kramer @ 20:02

As I am about to make CrazyStat’s subversion repository public, I checked whether there is anything in there that is not suitable to be made public. I stumbled upon some logfiles which I had once used for testing and accidentally commited to the repo. These logfiles contained private data and therefore, I needed to remove them from the history before making the repository public.

And that is how it can be done:

As SVN has no ‘obliterate’ command yet (see feature request here), you need to perform the following steps:

  1. Make sure nobody else uses the repo at the time
  2. Dump your repository to a dumpfile
  3. Filter the dumpfile (remove the files you do not want to be in there anymore)
  4. Create a new repository
  5. Import the dumpfile in the new repository
  6. Replace the old with the new repository
  7. Check it
  8. Clean up

These steps in detail:

Step 1: Make sure nobody else uses the repo at the time

I think the easiest way would be to remove write-permissions from the repository-folder. E.g. if you access your svn through apache, just chown it from www-data to root and nobody should be able to write anymore:

chown -R root:root /var/svn/REPOSITORY

Step 2: Dump your repository to a dumpfile

svnadmin dump /var/svn/REPOSITORY > dumpfile

Step 3: Filter the dumpfile

svndumpfilter exclude /path/of/file/to/remove < dumpfile > newdumpfile

This will remove the file “/path/of/file/to/remove”. You can remove multiple files at a time like this:

svndumpfilter exclude file1 file2 < dumpfile > newdumpfile

I did not find any way to use wildcards, though. Let me know in case you find anything.

Update: Thanks to the comment by Florian! Here is the way to use wildcards:

svndumpfilter exclude –pattern "*.OLD" < dumpfile > newdumpfile

Florian also pointed us to a documentation of svndumpfilter which might be helpful for some of you.

Step 4: Create a new repository

svnadmin create /var/svn/REPOSITORY_NEW

Familiar, right? 😉

Step 5: Import the dumpfile in the new repository

svnadmin load /var/svn/REPOSITORY_NEW < newdumpfile

Step 6: Replace the old with the new repository

chown -R www-data:www-data /var/svn/REPOSITORY_NEW
mv /var/svn/REPOSITORY /var/svn/REPOSITORY_OLD
mv /var/svn/REPOSITORY_NEW /var/svn/REPOSITORY

In the first line I also changed the file owner and group to www-data to make the new repository accessible for apache. In case you do not use apache (e.g. svnserve), skip the line or change the file owner and group to your needs (see what the owner of the old repo was using “ls -l /var/svn” ).

Step 7: Check it

You update your working copy (shouldn’t change anything). But when you browse your history and want to see one of the files you removed, you will get an error that the file could not be found.
You might want to make a fresh checkout and a commit to see whether everything still works as expected…

Step 8: Clean up

In case everything went well, you can delete a couple of things:

rm -R dumpfile newdumpfile /var/svn/REPOSITORY_OLD

 

Deleting old revisions

I also found a useful blog post on how to delete old revisions and only keep new ones. Some users might prefer this option if it is not a single file they want to get rid of but complete old revisions.

 

By the way, the CrazyStat SVN repository will be publicly available soon…

Hope somebody finds anything of this useful.

15. February 2012

WordPress: Frontend and Backend in different Language

Filed under: Wordpress — Tags: , , , , , — Christopher Kramer @ 23:45

In case you want to use a different language for the wordpress frontend (your blog) and the backend (admin panel), here is a tip how it can be done.

Step 1: Set frontend language

Configure the language of WordPress for the language you want your frontend in. You do this in wp_config.php using the constant WPLANG:

define ('WPLANG', '');

This unsets the language, meaning the frontend will be English. This also works if you use a localized version of wordpress. If you want to set another language, do so:

define ('WPLANG', 'de_DE');

This would set the language to German. You need to have a corresponding .mo-file in wp-content/languages (in this example, wp-content/languages/de_DE.mo).

Step 2: Set the backend language

Step one will also affect the backend. If you want to have the backend in another language, there is a neat little plugin which changes the backend language for you, which I found on this forum.

<?php
/*
Plugin Name: Change backend language
Version: 0.5
Plugin URI: http://forum.wordpress-deutschland.org/konfiguration/32642-frontend-soll-englisch-sein-adminbereich-deutsch-engl-od-deut-download-nehmen.html
Description: Changes the backend language
Author: Oliver Schlöbe
Author URI: http://www.schloebe.de/
*/

function os_setAdminLang($locale) {
    if( WP_ADMIN === true ) {
        $locale = 'de_DE';
        return $locale;
    }
}

add_filter('locale', 'os_setAdminLang', 1, 1);
?>

This changes the backend language to German. In case you want another language, change ‘de_DE’ to the desired language in line 13. You need a corresponding .mo-file just like for the frontend.

Save this as something like wp-content/plugins/change_be_language.php

Then active the plugin in your backend and your backend will turn into the language you set.

Attention: Make sure there are no extra spaces in the plugin-file. Especially at the end, some editors tend to add spaces or line breaks. This will result in problems (headers cannot be sent etc.).

Hope someone finds this useful.

Update: Just found out, that the author wrote a blog post himself about this (English text at the bottom of the page)…

14. February 2012

Horde language selection does not work

Filed under: Linux,Server Administration — Tags: , , , , , , , , — Christopher Kramer @ 13:22

When selecting a language at login, Horde webmailer does not change the language?

Here is what I found out what helps:

On Debian, run the following command:

dpkg-reconfigure locales

Then select the correct languages. I had only selected the UTF8 languages for German, but Horde needs the following ones:

de_DE ISO-8859-1
de_DE@euro ISO-8859-15

If you have the problem with another language, select the corresponding language.

On Ubuntu, the chosen languages are stored here:

/var/lib/locales/supported.d/

I had a file named “de” in there where my chosen languages where listed and I added the ISO-versions above. You can find all supported languages here:

less /usr/share/i18n/SUPPORTED

On Ubuntu, after you included your languages, you have to run the following command:

dpkg-reconfigure locales

Afterwards, you need to restart apache:

apache2ctl -k graceful

That’s the smoothest way. In case it does not work, use one of those:

apache2ctl restart
service apache2 restart
/etc/init.d/apache2 restart

Now refresh Horde and everything should work.

Another problem is the following: if you chose a language in your Horde settings (login, Global Options, Locale and time, Select your preferred language), this overwrites the language you chose on login. So select “default” there to be able to chose language on login.

Hope this helps somebody.

« Newer PostsOlder Posts »