Short how-to:

root@215003:~# mysql -u root -p
Enter password:
mysql> CREATE DATABASE s_db;
mysql> GRANT ALL PRIVILEGES ON s_db.* to 's_user'@'localhost' IDENTIFIED BY '12345678';
mysql> FLUSH PRIVILEGES;
mysql>exit
mysql -u s_user -p s_db < database.sql
<
code>

Hello world c++

email versus wiki
via Email vs Wiki


“I have to say, I’m not a big fan of cloud computing” by Drew Dernavich/ The New Yorker 2.07.2011/

Here it is ( with user name, password, database host and db name ) :
mysql -uuser_name -ppassword -hmysql_host_server_.domain.com -Ddatabase_name < database_commands.sql

Interesting poll in linkedin – results ( as expected ) – Android is first :

Below I put some snapshots from Googl’e chrome release cycle presentation with some comments.
Continue reading ‘Links for January 2011’ »

  • How To: Bulletproof Server Backups with Amazon S – old, but good manual about S3 backup
  • HOW TO: Backup Your Website to Amazon S3 – detailed help about using S3Sync for backup
  • Server Backup with Amazon S3 (Howto) – good manual ( using bash and crontab )
  • List of S3 backup tools
  • For those who like to use Azure instead of AWS :

  • Backup files using CloudBerry
  • The Bermuda Triangle of Productivity - gmail, twitter, facebook

    Guys from EC2 announced micro instances – it costs 2 (two) cents per hour for linux and now it’s will costs less than traditional dedicated hosting with root access – monthly payment for EC2 micro instance will be about 15 USD, and price for root/linux on dedicated hosting will be about 30 USD/month. It’s really good news – you can have 100 boxes cluster just for two usd per hour! Bad thing is that micro instances don’t have their own disk space – EBS only, looks like this best ever use case for this type of instances will be highly-distributed computational grid with all data stored in RAM. And don’t forget that EBS will costs you some money – $0.10 per allocated GB per month Amazon EBS also charges $0.10 per 1 million I/O requests you make to your volume . Fredrick Poller’s already check out micro instances performance by sysbench : Amazon EC2 Micro instance, how fast is it?.

    By unknown reasons Sun JDK was moved to partner repository, so to use sun jdk you need to do this steps

    sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
    sudo apt-get update
    sudo apt-get upgrade

    and then enjoy :

    sudo apt-cache search jdk | grep sun
    sun-java6-source - Sun Java(TM) Development Kit (JDK) 6 source files
    sun-java6-jre - Sun Java(TM) Runtime Environment (JRE) 6 (architecture independent files)
    sun-java6-jdk - Sun Java(TM) Development Kit (JDK) 6
    sun-java6-javadb - Java(TM) DB, Sun Microsystems' distribution of Apache Derby
    sun-java6-demo - Sun Java(TM) Development Kit (JDK) 6 demos and examples
    sun-java6-bin - Sun Java(TM) Runtime Environment (JRE) 6 (architecture dependent files)

    AWS related links :

    You can use sed :

    sed -e 's/\([^\d]*\)/\L\1/' in.txt > out.txt

    or perl inliner :

    perl -ne 'utf8::decode $_; $_ = lc $_; utf8::encode $_; print' in.txt > out.txt
    .
    Both guys works fine for unicode file too.

    Using telnet in bash scripts to automate some stuff ? It’s really easy, here’s an example to tell “hello world” on telnet server :

    req="hello world"
    server="my_server 1234"
    val=`( echo open ${server}
    sleep 3
    echo "${req}"
    sleep 1 ) | telnet`
    echo $val

    Okay, we have text file with list of urls and want to have firefox’s screenshots from this pages and also we need to have this screenshots in some normalized resolution ( like all images should be in 300×400 – thumbnails ). First of all you need to install Command line print Firefox add-on. Then create some simple script which will run firefox with needed url, print screenshot and close ( in my case via kill – may be it’s too brutal ) firefox in cycle. It may look like this ( url_list.txt – file with urls – each url on its own line :-)), after running this script you will have many *.png files which is screenshots for ulrs – 0.png – for first url in urls_list.txt, 1.png for second and so on.

    #!/bin/bash
    id=0
    while read line
    do
    firefox -print $line -printmode png -printdelay 10 -printfile ${id}.png
    ps ax | grep firefox | awk '{ print $1 }' | xargs kill -9 ;
    id=$[$id+1]
    done < urls_list.txt

    And now then we have screenshots ( all this guys are in different resolution in common ) then we need to normalize them – to create thumbnails for all images in 300×400 resolution – convert helps!

    for f in *.png;
    do
    convert -thumbnail 300x400! ${f} thumb_${f}
    done

    And we have many thumb_*.pn with 300×400 resolution all. A little note – using resolution without ! sign will work in another way – resize will be processed proportionally with using resize only for one dimension ( bigger one ).

    GIT

    Subversion ( svn )

    Hash tables :

  • Network Applications of Bloom Filters: A Survey – by Andrei Brodery and Michael Mitzenmacherz
  • Coding bloom filters
  • General Purpose Hash Function Algorithms
  • IP-Lookup with a Blooming Tree Array: A New Lookup
  • Algorithm for High Performance Routers
  • C++ Q/A :

  • Bjarne Stroustrup’s C++ Style and Technique FAQ
  • Cloud computing is a term that originally meant elastic on demand computing but is now a term applied elastically by marketdroids to any form of virtualisation.
    This is part of the transition from 2009’s vBullshit to BaaS, Bullshit as a Service.

    via chapmancentral.demon.co.uk

    SaaS bullshit PaaS bullshit bingo