Engineering -> Interpersonal -> World domination :)

Link: Nice article on large-scale SaaS systems
stairs
stairs_jumper

sort -R is not that random
stairs
stairs_jumper
Wow:) As guys pointed out, using sort -R is not random - it sorts on hash value. 
Tags:

Hadoop VM for running stuff from Windows host
stairs
stairs_jumper
Geeky version
1. http://virtualboxes.org/images/ubuntu/
1.b. Create a user with the name matching the one from your host machine
2. http://hadoop.apache.org/docs/r1.0.4/single_node_setup.html

Detailed version
Read more...Collapse )

Recipe: Online storage capacity expansion with LVM
stairs
stairs_jumper
  Sometimes we need to add a bit more capacity to an existing FS by plugging in an additional storage unit. At first I thought this won't be of much use, my world of VMs and abstractions benefits from the thing from time to time.
lvm
  As LVM adds 3 abstraction layers, we're now given a greater flexibility: a single device may be shared across a number of file systems, as well as a number of them may share a single device.

So how we usually perform that:

  • Check additional device is visible




    fdisk -l



    Disk /dev/sda: 8589 MB, 8589934592 bytes
    255 heads, 63 sectors/track, 1044 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          13      104391   83  Linux
    /dev/sda2              14        1044     8281507+  8e  Linux LVM
    
    Disk /dev/sdX: 1099.5 GB, 1099511627776 bytes
    255 heads, 63 sectors/track, 133674 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
    


  • Trigger scan if you don't see a device
    echo "- - -" > /sys/class/scsi_host/host0/scan
    
    


  • Enter a named screen session(and storage changes) to make the session survive network outages:
    screen -R lvm
    
    


  • Create LVM physical volume




    pvcreate /dev/sdbX




    Physical volume "/dev/sdX" successfully created


  • Make that space available to volume group your interested in








    vgextend VolGroup00 /dev/sdX




    Volume group "VolGroup00" successfully extended


  • Extend LVM volume




    lvextend -L 1000GB /dev/VolGroup00/LogVol00




    Extending logical volume LogVol00 to 1000.00 GB
    Logical volume LogVol00 successfully resized


  • Online FS resize(may take a while)




    resize2fs /dev/VolGroup00/LogVol00




    Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required
    Performing an on-line resize of /dev/VolGroup00/LogVol00 to 262144000 (4k) blocks.
    


  • Profit!

Tags: ,

Resolve on read
stairs
stairs_jumper
doh  Always hated starting each and every module, block and piece of code with endless if statements ensuring and patching data to a more or less consistent state. Well, seems that's the only way to get proper view of data in a distributed environment. I gave up :)

P.S. Ah, don't forget about idempotency.

What to do if you rooted your Anrdoid phone(LG P500) and managed to wipe out home app?
stairs
stairs_jumper
Now I know how cool the phone without the phone app is(in my case just a blank screen). And I see lots of people on the internet asking about LG Home.apk to restore that. They recommend installs via a 10-step procedures starting from calling your phone. There is a simpler way, though:
1. Relax
2. Go to the market site and install Live Home )
3. Wait a bit and your phone will be back to usable

Inheritance: An OOP sin
stairs
stairs_jumper
Chatting with functional programming evangelists is always fun - I first understood that while trying to explain to Roman hat for Dependency Injection is used. As a result, learned much about OOP sins %) One of them I would agree about now, after passage of just a single year is inheritance:
  1. Ever spotted 32 lines of consecutive code lines split across 4x7 functions overriding superclass behavior with NO CLEAR ORDER?:)
  2. Ever tried refactor out unnecessary aspects of a pack of tests extending a superclass with JUST EVERYTHING available?:)
  3. Ever wondered around hierarchy of 12 classes with the depth of 3 trying to discover that single bit of runtime behaviour?:)
If you answered 'yes' at least once - welcome to the club :) If no - bookmark the page, soon you will ;)
Tags:

Java: puzzle
stairs
stairs_jumper
And again syntactically correct constructs rob us of our spare time:)
if(noEventHappened && isSomethingRequired());
{
  aCodeThatWillRunAlways();
}
Mind the semicolon ;)
Tags: ,

Morning hack: preventing a teabag label from falling into your paper cup
stairs
stairs_jumper
cup
   The trick is to stick the label into the gap formed by the edge - enjoy :)

Hystrix by Netflix - fault tolerance now made easy?:)
stairs
stairs_jumper
soa-5-isolation-focused-640   
  Good news for everyone exposed to distributed / fault tolerant nature of programming experiences(i.e. virtually everyone). Now principles distilled by the Release It! re cooked as a neat Java lib.
  Obvsiously dropping that on to your classpass won't fix the things magically:) Though I believe, even reading about the thing may be highly beneficial. Enjoy.

You are viewing stairs_jumper