Debian - Files / Directories listings

List files by sizes

Bash

Variables

  • No spaces between the variable name and the value to be assigned
DATE_STRING=$(date +"%Y-%m-%d.%0k.%M.%S")

TestNG - Ant build using TestNG-XSLT

Ant build using TestNG-XSLT

<!-- 
  Example for TestNG-XSLT
    Run this target only after TestNG had generated the xml resutl file(i.e. testng_output/testng-results.xml).
    Change TestNG-XSLT stylesheet path accordingly(i.e. lib/testng-xslt-0.6.2/src/main/resources/testng-results.xsl).
-->
<target name="testng_nice_report">
  <mkdir dir="testng_nice_report"/>
  <xslt in="testng_output/testng-results.xml" 
        style="lib/testng-xslt-0.6.2/src/main/resources/testng-results.xsl"
        out="testng_nice_report/index.html">

TestNG - Ant build file for TestNG

Sample Ant build file to run TestNG

<?xml version="1.0" encoding="UTF-8"?>
<!--

Debian - Adobe Flash Player

Install Flash Player for Firefox

  1. Download the linux version of Flash from http://www.adobe.com.
  2. Decompress the file downloaded
    tar -xvzf install_flash_player_9_linux.tar.gz
  3. Copy libflashplayer.so to /usr/lib/mozilla-firefox/plugins/ folder.
    cp libflashplayer.so /usr/lib/mozilla-firefox/plugins/
  4. Restart Firefox.


Install Flash Player for Opera

    Debian - Time

    Time Zone

    Time zone is stored in /etc/timezone file. Running /usr/bin/tzselect will help you find your time zone but doesn't update your system.

    Setting Time Zone on system wide

    run tzconfig

    UTC

    Once you've set your timezone you might wish to change the UTC setting, upon Debian machines you can find that in the /etc/default/rcS file. Although changing this will require a reboot. I think, hwclock --systohc --utc command (in case UTC=yes) could be used instead of reboot.

    NTP

    Debian - BASH Prompt Customization

    Customization of the the Bash terminal line

    Add the following codes in ~/.bashrc. Every time you open a Bash terminal, the first line will show HH:MM:SS@hostname:workingDirectory # .

    Debian - Network Configuration

    Manually configure network in Debian

    If you are manually setting a static IP address in Debian, you have to edit /etc/network/interfaces. For example, if you want to change your eth0 interface to use a static IP address instead of dynamic IP address , change the following settings accordingly.

    #iface eth0 inet dhcp #Comment this line out with the pound(#) key. It was your dhcp setting(dynamic IP address).
     
    # Add the following lines below in /etc/network/interfaces.

    Debian - mplayer

    Usage

    CakePHP - User Model::saveAll() to save hasMany association

    In view

    <?php
      echo $form->create('Phone', array('action'=>'save'));
     
      for($i=0; $i<3; $i++)
      {
        echo $form->input('Phone.'.$i.'.number');                                                                                      
      }
      echo $form->submit('Save');
      echo $form->end();
    ?>  

    Here is how the Controller see the phone data after users filled the fileds and clicked on the Save button :

    [PhoneNumber] => Array
      (
        [0] => Array
          (
              [id] => 1
              [phone_number] => (123)456-7569
          )
     
        [1] => Array

    Pages

    Subscribe to OpenWritings.net RSS