DeutschEnglish

Submenu

 - - - By CrazyStat - - -

10. April 2014

Inkscape: Change Arrowhead color

Filed under: Uncategorized — Tags: , , , , , — Christopher Kramer @ 18:55

In Inkscape, a great open source vector graphics program, when you change the stroke color of a path, the arrow heads still reamain black. But there is a way to change their color, although quite unintuitive.

This is how it looks like:

Inkscape: arrows with same arrowhead color as the path

Inkscape: arrows can have the same arrowhead color as the path

And this is how its done:

  1. Mark the Path you want to change the color of the arrowhead
  2. “Extensions”
  3. “Modify Path”
  4. “Color Markers to Match Stroke”

That’s it!

inkscape_arrows_color

 

Recommendation

Try my Open Source PHP visitor analytics script CrazyStat.

1. April 2014

Outlook 2010: Nachrichtenkopfzeilen (Header) anzeigen

Filed under: Uncategorized — Tags: , , — Christopher Kramer @ 18:15

So kann man sich in Outlook 2010 die Header anzeigen:

  • Nachricht öffnen (doppelt anklicken).
  • Bei “Kategorien” auf den kleinen Pfeil unten rechts klicken
    outlook_header
  • Unter “Internetkopfzeilen” finden sich die Header:
    outlook_header2

“Kategorien” wäre das letzte, wo ich danach gesucht hätte (bzw. habe). Ich finde das extrem unintuitiv platziert, wahrscheinlich ist aber vor allem die deutsche Übersetzung (“Kategorien”) hier besonders schlecht.

Vielleicht verkürzt dieser Beitrag ja jemandem die verzweifelte Suche.

27. March 2014

TeXworks: Compiling your main.tex from an included part

Filed under: Uncategorized — Tags: , — Christopher Kramer @ 18:31

In case you have split your LaTeX document (let’s say main.tex) into multiple parts (let’s say part01.tex, …) and use include or input to stick it back together, you cannot compile part01.tex because it misses all the header stuff. So you need to compile main.tex. But is there a way in TeXworks to compile it using the Play-Button or CTRL+T?

Yes, there is. Add this line at the top of part01.tex etc:

% !TEX root = main.tex

Then just compile your files normally. It will compile main.tex, show the main.pdf in the preview and you can even navigate nicely using the context menu from pdf to tex and back.

18. January 2014

Linux: get members of a group / get groups of a user

Filed under: Linux — Christopher Kramer @ 00:23

This might sound easy with /etc/group and /etc/passwd, but what if you use libnss-mysql for example and need to try if it works?

So just forget grepping config files. Here are the real commands:

Members of a group:

getent group GROUPNAME

Replace GROUPNAME with the group you want to check.

Groups of a user:

groups USERNAME

Replace USERNAME with the name of the user to check.

 

Checked on Debian, not sure if it works on any Linux/Unix.

23. December 2013

phpLiteAdmin: French localization available for download

Filed under: phpLiteAdmin — Christopher Kramer @ 23:05

I just received a French translation for phpLiteAdmin, the open source web gui for SQLite databases written in PHP.

Thanks a lot to Olivier Briat for his work translating phpLiteAdmin!

As always you find the localization file in the downloads section on google code.

After Arabic, Chinese, English, German, Italian and Russian, French is the seventh language that phpLiteAdmin is localized into. Thanks a lot to all translators. We would be very pleased to see more translations! Doing your own translation is very easy – just have a look at the wiki on how to translate.

11. October 2013

Stupid Spammers posting all their spam stock at once

Filed under: Uncategorized — Tags: — Christopher Kramer @ 14:47

Today I got this spam comment with probably all the possible spam combinations this spammer uses:

spam

This is only the first part, the complete comment is about 5 times as long. I guess it’s not the best approach to give all your beautiful spam away at once. Not only because only a complete fool would not mark this as spam but also because it’s probably the best way to make sure that spam filters will detect all your stuff :D

9. October 2013

Typo3 ts_lastupdate: Change Text

Filed under: Typo3 — Tags: , , , — Christopher Kramer @ 12:38

The Typo3 extension ts_lastupdate comes in handy when you want to automatically display the date when the page has been edited the last time. On a German Typo3 installation, what it displays looks like this:

Letzte Änderung: 09.10.2013

You can configure the date format as described in the documentation. But what I missed was a way to configure the text before the date. I wanted it to say “Letzte Aktualisierung” instead of “Letzte Änderung”. The solution I came up with might be a bit quick and dirty but it surely does the trick:

plugin.tx_tslastupdate_pi1.text.wrap =  <!--|-->Letzte Aktualisierung:

So what I do is wrap the text provided by the extension (or rather language file) in comments and place my text afterwards. If you have multiple languages, you might need to use language conditions.

[globalVar = GP:L = 2]
plugin.tx_tslastupdate_pi1.text.wrap =  <!--|-->Letzte Aktualisierung: 
[globalVar = GP:L = 3]
plugin.tx_tslastupdate_pi1.text.wrap =  <!--|-->Last update: 
[global]

If anybody finds a cleaner solution, please let me know.

26. September 2013

jQuery: check whether an element exists

Filed under: JavaScript — Tags: , , , — Christopher Kramer @ 13:47

In traditional JavaScript, to check if some element exists, you’d have done something like this:

if(document.getElementById('someID'))

Of course this still works but what about using JQuery? So you might try this:

if($('#someID'))

But this will always be true as jQuery always returns an object, no matter whether the selector matched or not.So what you can do is the following:

if($('#someID').length > 0)

This will do the trick. You can even leave out “> 0″:

if($('#someID').length)

The cool thing is you can use this also to check more complex stuff, like whether #someID has an <img> child-element:

if($('#someID img').length)

And this is where jQuery really makes life a lot easier because with traditional JavaScript, this would be a bit lengthy for what it does.

Have fun!

1. September 2013

MySQL: reset a forgotten MySQL root password

Filed under: DBMS,Linux,Security,Server Administration — Christopher Kramer @ 14:37

Just in case you don’t know the password of your MySQL root user anylonger, this is how you can set a new one. Examples for Debian (wheezy) and MySQL 5.5, but should work more or less the same on any linux/unix:

  1. Stop the MySQL server
    service mysql stop
  2. Create a init file:
    touch /etc/mysql/mysql-init
  3. Write the following into this file (adjust the PW):
    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');
  4. Restart MySQL with this init-file:
    mysqld_safe --init-file=/etc/mysql/mysql-init
  5. The new password should work now. Try it:
    mysql -u root -p
  6. Restart MySQL normally:
    service mysql restart
  7. Remove the init-file
    rm /etc/mysql/mysql-init

And you’re done. I hope this helps somebody.

Note: if it does not work, it is most likely because the MySQL process cannot access the init-file (e.g. because of missing access rights). In this case check your (sys)logs for stuff like this:

mysqld: 130901 14:20:30 [ERROR] /usr/sbin/mysqld: File '/root/mysql-init' not found (Errcode: 13)

I had this problem first because I tried creating the init-file in /root where the mysql-process was not able to read it.

11. August 2013

RT Request Tracker: Migrate From SQlite to mySQL

Filed under: DBMS,Linux,Server Administration — Tags: , , , , , , — Christopher Kramer @ 23:07

I lately had to migrate an RT installation (version 4.0.4) from SQLite to MySQL. In case anyone else has to do this, here is a brief description of how it worked out.

  1. Setup a working MySQL server in case you have not already
  2. Create a MySQL user for RT (e.g. rt4)
  3. Configure RT to use MySQL using this username and a dbname (e.g. rt4) of a not yet existing db (See /etc/request-tracker4/RT_SiteConfig.pm and RT_SiteConfig.d/)
    I’d recommend to keep a copy of the SQlite-Config…
  4. Run
    rt-setup-database --action init

    to create a blank RT DB in MySQL. Check if it worked.

  5. Delete all rows from the MySQL DB, only keep the schema.
  6. Create a copy of your SQLite db
    cp rtdb mydbcopy
  7. Open the copy of the db in the sqlite shell
    sqlite3 mydbcopy
  8. For each table in the DB:
    1. Set the Output file to something like this (“Attachments” is the table name)

    .out data_Attachments

    2. Set the mode to insert (“Attachments” is again the table name)

    .mode insert Attachments

    3. Get all the data

    SELECT * FROM Attachments;

    4. Now you have a file with lots of INSERT statements for the Attachments table. Try to run it in mysql:

    mysql -u rt4 -p rt4 < data_Attachments

    (On a linux shell, not the sqlite shell of course. Here the first rt4 is the username and the second the dbname. data_Attachments is the dump file created before)
    5. In case mysql complains some NOT NULL constraints are violated:
    Go back to the sqlite shell and set these cells to the default-value (0):

    UPDATE Attachments SET someColumn=0 WHERE someColumn IS NULL;

    (Only do this on the copy, not the original db ;-) )
    Now recreate the dump and retry to insert this in mysql. Do it with all columns where NOT NULL constraints are violated.

This works table by table, there are no foreign keys that would get in the way. You can also do several tables in one output file, but you might run into problems when NOT NULL constraints are violated by one table. After all your tables are filled with your data, RT should work. Maybe restart Apache.

apache2ctl restart

This worked without problems so far for me. I first tried pumping the whole SQLite dump into MySQL (using this conversion script) but the schema that this ended up in was different, missed indexes and RT only liked it until I restarted Apache (which then refused to start). Better start with a schema created by rt-setup-database, not with one that originates from SQLite.

I hope this is of some help for somebody. Please let me know in case it helped you or if you have any comments or questions.

Older Posts »