• autokana – jQuery plugin

    autokana – jQuery plugin

    Autokana is a jQuery plugin that automatically converts latin (roumaji) to kana (hiragana / katakana) using the auto-correct principle (keep in mind that it’s not suitable for converting copy/pasted but only typed-in text). You can check out how it works at autokana example page.

    You can also download the plugin (including a simple usage example) from github and use it for free.

    To use it, you will have to add the following somewhere at the beginning of your body tag:

    1
    2
    3
    4
    5
    6
    7
    <script type="text/javascript">
       // bind events when document is ready
       $(document).ready(function() {
          // attach auto-kana plugin with default options
          $("#kana_text_box").autokana();
       });
    </script>

    After that add the input box itself wherever you need it (make sure to use the same ID in the above part and in the input field itself):

    1
    2
    3
    4
    5
    6
    7
    <input id="kana_text_box" type="text" />
    <script type="text/javascript">
       // this part will clear and set focus on the input field on refresh
       // feel free to remove that part if you don't need it
       document.getElementById("kana_text_box").value="";
       document.getElementById("kana_text_box").focus();
    </script>

    If you have any suggestions or bug reports, feel free to leave a comment.

  • Mapping Japanese kana characters (hiragana/katakana) for use in programming

    Mapping Japanese kana characters (hiragana/katakana) for use in programming

    When I started working on Zanzou, I had to find a way to somehow map the whole kana so I could later use it in my webapp. I simply used 2D array to accomplish this. It’s no nuclear science but to save you the trouble of copying and pasting all the symbols into a single file yourself (I think it actually took me around an hour to do it :D), here is my kana.js file (note that if if you open the file itself in the browser, it will most probably display some strange characters instead of proper UTF-8 encoded kana symbols but when you open the file in your text editor, it should be usable and displayed just fine).

    I divided it into 4 major groups (arrays): monographs, digraphs, monographs with diacritics and digraphs with diacritics. Each array element (representing sound) consists of 3 subelements (roumaji record, and hiragana and katakana symbols).

    With some minor modifications, this could easily be used in any other programming language. Just make sure if you edit the file to save it in UTF-8.

    Hope it helps, がんばって!

  • cmik.fm at build.last.fm + source at github

    cmik.fm at build.last.fm + source at github

    cmik.fm made it into build.last.fm a few days ago, and not only that, but last.fm team rewarded me with a jolly good one year of free last.fm subscription as well, yaaay! thanks last.fm!

    I also decided to release the source-code for cmik.fm under GPL3 over at github for anyone interested (not that I see a good reason for anyone to look at it, but it just feels good to leave it out there). heh :D

  • Github “Permission denied (publickey).” fix

    Github “Permission denied (publickey).” fix

    Over at github troubleshooting page, there is some info about this issue, but since I haven’t used this way of authentication (public key) previously it took me a while to figure out why exactly I kept getting this message and why I failed to establish a connection with github. The thing is, I generated an RSA key-pair with a name different from the default “id_rsa” and because of that the ssh-agent did not have the key in its cache (thus I could not authenticate).

    To fix this, you can either use the default “id_rsa” for your key name (in which case it will be in ssh-agent’s cache automatically) or use “ssh-add your_key” command to add it to the cache.

    If you did the same funky key-naming thing as I did, I hope this helps and takes away your headache! =D

  • How to fix Ctrl-Tab behavior in Kate?

    Kate has tabs turned off by default (at least that’s what you get with vanilla Kate package from Arch Linux repositories) and even when you turn them on, they act kinda funky because Kate switches between tabs by name order, rather than by opening order so what happens is that Ctrl-Tab starts jumping between your tabs instead of going from one to another, from left to right. That was quite confusing to me, and I wanted to change that behavior to what I’m already used to in browsers, GEdit, Pidgin, whatever… Finding a solution (a very well camouflaged one for that matter, thank you) to this situation was rather… unexpected.

    To turn tabs on (if they’re not turned on by default in your distro) you will first have to go to Settings -> Configure Kate -> Plugins and turn on either “Tab Bar” or “Multiline Tab Bar”. Try both and then decide which one suits you better. After that you will have to set up the shortcut for switching between tabs. To do that, go to Settings -> Configure Shortcuts and set the shortcut for Forward to Ctrl-Tab. You could as well set up alternate shortcuts: Alt+1 for Back and Alt+2 for Forward. You will be able to toggle tabs in both directions then easily.

    To fix the tab switching behavior (ordering), open the Documents column from the File System Browser (if you have it turned off, turn it on under plugins), right-click on it and choose Opening Order from Sort By in the drop-down menu.

    That’s it, enjoy!

  • Automating Risu report dumping

    Here is a small bash script to automate Risu reporting. It’s not the most elegant thing out there, but it gets the job done. You will have to make Risu config file beforehand and put it in the same folder with this script and all the Nessus scans you’ve got. The script will pipe all the scans into Risu, create pdf reports for you and dump them into the same folder.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    #!/bin/bash
    # perhaps you will have to set custom Risu path
    #risu="/var/lib/gems/1.9.1/bin/risu"
    nessus_logs=()

    $risu --create-tables

    for file in $(ls *.nessus);
    do
       nessus_logs=("${nessus_logs[@]}" $file)
    done

    $risu ${nessus_logs[@]}
    echo -e "\n"

    echo "Dumping findings_summary.pdf"
    $risu -t findings_summary -o "findings_summary.pdf"

    echo "Dumping findings_summary_with_pluginid.pdf"
    $risu -t findings_summary_with_pluginid -o "findings_summary_with_pluginid.pdf"

    echo "Dumping exec_summary.pdf"
    $risu -t exec_summary -o "exec_summary.pdf"

    echo "Dumping cover_sheet.pdf"
    $risu -t cover_sheet -o "cover_sheet.pdf"

    echo "Dumping pci_compliance.pdf"
    $risu -t pci_compliance -o "pci_compliance.pdf"

    echo "Dumping ms_update_summary.pdf"
    $risu -t ms_update_summary -o "ms_update_summary.pdf"

    echo "Dumping graphs.pdf"
    $risu -t graphs -o "graphs.pdf"

    echo "Dumping technical_findings.pdf"
    $risu -t technical_findings -o "technical_findings.pdf"

    echo "Dumping finding_statistics.pdf"
    $risu -t finding_statistics -o "finding_statistics.pdf"

    echo "Dumping assets.pdf"
    $risu -t assets -o "assets.pdf"

    echo "Dumping exec_summary_detailed.pdf"
    $risu -t exec_summary_detailed -o "exec_summary_detailed.pdf"

    echo "Dumping host_summary.pdf"
    $risu -t host_summary -o "host_summary.pdf"

    echo "Dumping findings_host.pdf"
    $risu -t findings_host -o "findings_host.pdf"

    echo "Dumping ms_patch_summary.pdf"
    $risu -t ms_patch_summary -o "ms_patch_summary.pdf"

    echo "Dumping template.pdf"
    $risu -t template -o "template.pdf"

    echo -e "\n"
    $risu --drop-tables
Back to top