July 23, 2013

A good Windows SSH/Telnet Server


http://www.kpym.com/

  • Free, Open source, 
  • works with putty in full color, and full window size
  • and command auto complete works well
  • what else could I ask for?


July 15, 2013

linux dummy interface and renaming

In linux, there is a kernel module called "dummy", which allows you to generate dummy network interfaces such as "dummy0", "dummy1", etc.

1. sudo modprobe dummy numdummies=2
2. now you can do "ifconfig dummy0 192.168.1.124" to give it an IP address.
3. you can also rename the dummy interface with the following command:
        ip link set dummy0 name eth3
you need to "down" the interface before running the command above.

With the combination of dummy interfaces and ability to rename dummy interfaces, you can do a lot of fun things with them.

July 11, 2013

initramfs with boot argument init=/bin/sh

If you use a Linux kernel with initramfs, the boot argument "init=/bin/sh" would not work. The correct one is "rdinit=/bin/sh". Aha. Gotcha.

July 9, 2013

Add new file type to ack-grep

If you use ack as your grep replacement, and would like to add a new file type, do this:

Create a file at ~/.ackrc with the following line (change Ruby to your file type, and .haml,etc to your actual file extension):

--type-add=ruby=.haml,.rake,.rsel

July 1, 2013

How to hide/remove OS field in Bugzilla

This method uses javascript to hide the unwanted fields

1. edit template/en/default/global/header.html.tmpl. Search for "global.js". After the line "[% END %]" add the following lines:

    [% starting_js_urls.push('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js') %]

    [% FOREACH javascript_url = starting_js_urls %]
      [% PROCESS format_js_link %]
    [% END %]
    [% starting_js_urls.push('js/my.js') %]

    [% FOREACH javascript_url = starting_js_urls %]
      [% PROCESS format_js_link %]
    [% END %]

2. create the file js/my.js with the following contents:
$(document).ready(function(){
        $("#os_guess_note").parent().hide();
        $("#field_container_op_sys").parent().hide();
        $("#field_container_rep_platform").parent().hide();
});

This hides three fields: OS, OS comment, and Hardware.

To remove more clutters, use the following js:

$(document).ready(function(){
        $("#os_guess_note").parent().hide();
        $("#field_container_op_sys").parent().hide();
        $("#field_container_rep_platform").parent().hide();
        $("#op_sys").closest("tr").hide();
        $("#bz_url_input_area").closest("tr").hide();
        $("#tag_container").closest("tr").hide();
        $("#dependson").closest("tr").hide();
        $("#blocked_input_area").closest("tr").hide();
        $("#show_dependency_tree_or_graph").closest("tr").hide();
        $("td.bz_section_spacer").closest("tr").hide();
        $(".bz_collapse_expand_comments").closest("td").hide();
        $("div.bz_add_comment").hide();
        $("#xml").hide();

        $("#comment").attr("rows","2");
        $("#attachment_table").hide().before("<button id='tz_bug_edit' style='width:50px'> <b>Edit</b> </button>");
        $("#add_comment").hide();
        $("#tz_bug_edit").prevAll("br").remove();
        $("#tz_bug_edit").click(function(){
                if ($("#attachment_table").is(":visible")){
                        $("#attachment_table").hide();
                        $("#add_comment").hide();
                }else{
                        $("#attachment_table").show();
                        $("#add_comment").show();
                }
                return false;
        });
});
        $("#bz_show_bug_column_1").append($("#bz_show_bug_column_2").html());
        $("#bz_show_bug_column_2").remove();
        $("table.edit_form").css("width","auto").css("float","right").find("th").css("text-align","left");

        $("#changeform").css("min-height","400px");


You can also change skins/standard/global.css to remove hyperlink underline, and change default font:

a {
        text-decoration: none;
}


/* this already exists, just edit it */
body, td, th, input {
    font-family: Verdana, sans-serif;
    font-size: 11pt;
}