Search This Blog

January 25, 2011

Run SQL in Unix Shell

While reading the book - Agile Web Development with Rails, Third Edition - I have come across a section where the authors show how to run a SQL against a sqlite3 database. Want to know where in that book you can find it? Go purchase the book and find it yourself :P

Now back to my business of curiosity - I wanted to know how do I do this in every other databases that I have used so for. This blog post is a record of that endeavor. This should be very handy mainly for the Rails developers.

Unix, SQL and SQlite3

linux_prompt$ sqlite3 db_file_name.sqlite3 "SELECT * FROM my_db_table"

linux_prompt$ sqlite3 db/development.sqlite3 "SELECT count(*) from schema_migrations"

linux_prompt$ sqlite3 db/development.sqlite3 <<EOF
> SELECT * FROM users; --where 'users' is a table in my development.sqlite3 DB 
> SELECT * FROM schema_migrations; --where 'schema_migrations' is a table in my development.sqlite3 DB
>EOF


Unix, SQL and MySQL

linux_prompt$ export username="dbuser"
linux_prompt$ export password="dbpassword"
linux_prompt$ export db="mydatabase"

linux_prompt$ mysql -u "$username" -p "$password" "$db" <<EOF
> SELECT * FROM users; --where 'users' is a table in my development.sqlite3 DB 
> SELECT * FROM schema_migrations; --where 'schema_migrations' is a table in my development.sqlite3 DB
>EOF

linux_prompt$ mysql -u "$username" -p "$password" <<EOF
> use $db
> SELECT * FROM users; --where 'users' is a table in my development.sqlite3 DB 
> SELECT * FROM schema_migrations; --where 'schema_migrations' is a table in my development.sqlite3 DB
>EOF


Unix, SQL and Oracle

linux_prompt$ export username="dbuser"
linux_prompt$ export password="dbpassword"
linux_prompt$ export db="mydatabase"

linux_prompt$ sqlplus -S $username/$password <<EOF
> SELECT * FROM users; --where 'users' is a table in my development.sqlite3 DB 
> SELECT * FROM schema_migrations; --where 'schema_migrations' is a table in my development.sqlite3 DB
> exit; --command to exit sqlplus environment
>EOF

linux_prompt$ sqlplus -S $username/$password @sql_script_file.sql

January 24, 2011

Tech Conferences

An endeavor to list all the technology conferences so that people can take a quick look at the list and plan at the beginning of the year to decide on what conference to attend.

1. GOTO (formerly JAOO)
    Web: http://gotocon.com/
    When: August, October - every year
    JAOO is a world class conference that covers the latest developments across the software landscape.
The format includes 3 conference days and 3 training days with 80+presentations and 20+ training sessions. With 21 tracks, JAOO highlights a broad range of topics that are top of mind for today's professional development community. JAOO speakers are software experts, authors and practitioners who have made significant strides in the world of software and are setting the stage for the future developments in the industry.


2. QCon
    Web: http://qconferences.com/    
    When: QCon runs 5 times a year in London, San Francisco, Tokyo, Beijing, and Sao Paulo.
    QCon is a practitioner-driven conference designed for team leads, architects, and project management and is organized by the community, for the community. The result is a high quality conference experience where a tremendous amount of attention and investment has gone into having the best content on the most important topics presented by the leaders in the community, staged in an intimate environment with the best food and comforts needed to support as much learning and networking as possible. It boasts of always having awesome speakers!

3. HTML5Live
    Web: http://html5live.org/
    When: Every November
    HTML5 Live is designed for enterprise web application developers and architects.  The HTML5 Live program dives into areas of Browser Support, Architecture, Communication, Mobile and Web Applications. Its speakers are industry thought leaders from companies driving the HTML5 standard along with practitioners deploying real-world case studies.

4. YOW! (Australia Developers Conference)
    Web: http://www.yowconference.com.au/
    When: November/December every year
    The YOW! Australia Developer Conference offers outstanding opportunities to learn more about the latest practices, technologies and methods and for building innovative software solutions! Don't miss this opportunity to hear and meet international software experts and network with the other talented developers in Australia.

5. RubyConf
    Web: http://rubyconf.org/
    When: Every November
    RubyConf is the official International Ruby Conference. Founded in 2001, RubyConf has provided an annual venue for the ever-growing Ruby community to meet face to face to share, collaborate, and socialize.

6. MountainWest RubyConf
    Web: http://mtnwestrubyconf.org/
    When: Every March
    MWRC is a two-day single-track conference. Come rub elbows with some of the smartest Rubyists in the world. All for just $100.

7. Red Dirt Ruby Conf
    Web: http://reddirtrubyconf.com/
    When: April every year
    A quality conference where you can expeience big daddies of the Open-Sourced world. You'll see no word describing about the event in the web site. It just shouts loud of who is going to do some presentations. Interesting!

8. Lone Star Ruby Conference
    Web: http://www.lonestarrubyconf.com/
    When: Every August/September
    The Lone Star Ruby Conference is operated under the Lone Star Ruby Foundation, an Austin, TX based non-profit organization designed for the sole purpose of promoting and educating the public about the Ruby programming language.

9. JavaOne
    Web: http://www.oracle.com/us/javaonedevelop/index.html
    When: Every October
    avaOne is an annual conference inaugurated in 1996 by Sun Microsystems to discuss Java technologies, primarily among Java developers. JavaOne is held in San Francisco, California typically running from Monday to Thursday. Technical sessions on a variety of topics are held during the day. In the evening, Birds of a Feather (BOF) sessions are held. BOF sessions allow people to focus in on a particular aspect of Java technology. With Oracle taking over Sun, one can expect very many changes, I guess.

10. No Fluff Just Stuff
     Web: http://www.nofluffjuststuff.com/home/main
     When: Every month some where or other in the world.
     The No Fluff Just Stuff Software Symposium Series is designed to cover the latest in trends, best practices, and newest developments in Enterprise Java, Java/Groovy, ESB/SOA, Ajax, Web Services, Agility, and Architecture. Our commitment is to provide the very best in terms of speaker quality and overall conference experience. One of the key points of the "No Fluff, Just Stuff" Java Symposium Series is the high level of interaction between speaker and attendees at each conference. NFJS structure removes the barrier between speakers/attendees by having speakers attend other sessions and have breakfast/lunch with attendees thereby creating an informal atmosphere where people can come together and discuss issues and learn from each other. NFJS offers a consistent presence in each region the symposium is offered in by hosting a annual event in each city that becomes part of the NFJS tour.

11. Splash (includes OOPSLA)
      Web: http://splashcon.org/
      When: Every October
      PLASH's mission is to engage software innovators from all walks of life -- developers, academics and undeclared -- in conversations about bettering software. Bettering software involves new ideas about programming languages, tools, conceptual models, and methodologies that can cope with, evolve, and leverage, the complex software-intensive socio-technical system of systems that has emerged in front of our eyes during the past decades. Bettering software requires a deep understanding of the nature of these systems, an understanding that rides on the trends of the moment, but that goes well beyond. These are the topics of SPLASH.

12. Codemash
      Web: http://www.codemash.org/
      When: Every month
      CodeMash is a unique event that will educate developers on current practices, methodologies and technology trends in variety of platforms and development languages such as Java, .NET, Ruby and PHP.

13. OSCON (O'Reilly's Open Source CONvention)
      Web: http://www.oscon.com/
      When: Every July
      The O’Reilly Open Source Convention, is the crossroads of all things open source. It assembles the best, brightest, and most interesting people to explore what’s new and champions open source adoption across the computing industry. And now that open source has now become fully integrated into the corporate environment, OSCON helps to define, maintain, and extend the identity of what it means to be open source.

[More to come...]

References:
2. ThoughtWorks internal mailing lists

The conferences listed above are purely for quick reference or planning purpose only. The time and location of event could change year after year. I'm absolutely not connected with any of the above conference committee in any manner. In case of any error, please do post  your comments and I shall duly make the changes as it should be.

Also please do feel free to point to the link of any other conferences that you believe is worth attending.