Java development blog (tips, notes, …)
“First, solve the problem. Then, write the code.” (John Johnson)

    java is cool

    2017-02-02 19:00:00 +0100

    http://www.javais.cool :” There are many resources on news sites and blogs that carry valuable insights for your projects. Some are already well known, some a bit less and together they will keep you on the right track. Here are our favorites:”

    Commit empty folder structure (with git)

    2015-09-05 19:50:00 +0200

    In Git, you can’t commit empty folders, because Git does not actually save folders, only files. You’ll have to create some placeholder file inside those directories, if you actually want them to be “empty”.

    You could create a empty .gitignore file inside each empty folder. I find this confusing, since the goal is to keep the empty directories, not ignore them or some files inside of them.

    With the following script you can create a file named “.gitkeep” inside every empty folder. The filename has no meaning for git, but it makes it purpose clear.

    find . -type d -empty -not -path "./.git/*" -exec touch {}/.gitkeep \;

    AH00992: ajp_read_header: ajp_ilink_receive failed

    2015-06-02 15:31:00 +0200

    Recently I did not receive a response, after calling a webapp. There was no entry/error in the Application log. It was wired.

    Setup: Caller → Apache → Tomcat with Webapp

    After inspecting the apache logs, I found the following entries: “AH00992: ajp_read_header: ajp_ilink_receive failed”. I could not reproduce them, they just happened. As it turn out, my image of “my” setup was wrong:

    Real Setup: Caller → Apache → Firewall → Tomcat with Webapp

    The firewall kept droping the connection. No reason whatsoever. Since I have no controll over the firewall, I modified the timeouts of the http and the application server:

    For Apache HTTP + MOD_PROXY: ProxyPass Directive

    In Tomcat: Just set the “connectionTimeout” in the AJP connector. Source: JK Timeout Attributes -> Connection Pools and Idle Timeouts

    Chrome Extention: WebRTC Block

    2015-02-02 09:36:00 +0100

    Extract:

    “Disable WebRTC in Your Web Browser! WebRTC (Web Real-Time Communication) is an API definition drafted by the World Wide Web Consortium (W3C) that supports browser-to-browser applications for voice calling, video chat, and P2P file sharing without plugins. WebRTC can disclose your Local IP Addresses and making fingerprints of your Media Devices.”

    WebRTC Chrome Extention

    Dell PowerEdge T20 with Xeon E3-1225v3 CPU

    2015-01-18 12:44:00 +0100

    Here’s a blogpost about the DELL T20: Dell PowerEdge T20 with Xeon E3-1225v3 CPU

    Extract: Getting the power consumption with Linux below 15 Watt

    http://www.hardwareluxx.de/community/f101/dell-poweredge-t20-1031138-44.html#post22753991

    http://www.hardwareluxx.de/community/f101/dell-poweredge-t20-1031138-45.html#post22772151

    sudo pacman -S powertop

    Add the file /etc/udev/rules.d/10-local-powersave.rules:

    # PCI runtime power management
    ACTION=="add", SUBSYSTEM=="pci", ATTR{power/control}="auto"
    
    # USB autosuspend
    ACTION=="add", SUBSYSTEM=="usb", ATTR{power/control}="auto"
    ACTION=="add", SUBSYSTEM=="usb", TEST=="power/autosuspend" ATTR{power/autosuspend}="60"
    
    # SATA active link power management
    SUBSYSTEM=="scsi_host", KERNEL=="host*", ATTR{link_power_management_policy}="min_power"

    And run sudo udevadm trigger. Afterwards, cat /sys/class/scsi_host/host0/link_power_management_policy should return min_power.

    echo auto > /sys/bus/pci/devices/0000:00:14.0/power/control

subscribe via RSS