Painlessly Remove All Ruby Gems on Windows

0

Posted on : 02-09-2010 | By : tshanky | In : Python/Perl/PHP/Ruby

If you want to uninstall all gems from your local Ruby installation on a Linux, Unix or MacOSX box then you can rely on the standard shell commands like “cut” and “xargs”, to make the process easy and effortless. The command itself is a one liner as follows:

gem list | cut -d" " -f1 | xargs gem uninstall -aIx

Read this post titled — Painlessly Remove All Ruby Gems — to learn the details. If you are on Windows though, the usual “cut” and “xargs” are not available. What are the alternatives then? One old school method may be to write a batch file or a script to do the job. However, that method is both a bit clumsy and verbose for a task that could be achieved through a one liner elsewhere. A smarter option then is to use the Windows PowerShell. Lets see how.

First start a PowerShell instance. If you are on Windows 7, it would simply mean typing “PowerShell” (or even “powershell”) on your program search box and then selecting the “Windows PowerShell” program. Once a session is instantiated, type the usual

gem list

command to list all the installed gems. On my machine the output looks like so:

*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.0, 3.0.0.beta3, 2.3.5)
actionpack (3.0.0, 3.0.0.beta3, 2.3.5)
activemerchant (1.4.1)
activemodel (3.0.0, 3.0.0.beta3)
activerecord (3.0.0, 3.0.0.beta3, 2.3.5)
activerecord-tableless (0.1.0)
activeresource (3.0.0, 3.0.0.beta3, 2.3.5)
activesupport (3.0.0, 3.0.0.beta3, 2.3.5)
addressable (2.1.1)
arel (1.0.1, 0.3.3)
authlogic (2.1.3)
builder (2.1.2)
bundler (1.0.0, 0.9.25)
buzzr (0.2)
calendar_date_select (1.15)
cgi_multipart_eof_fix (2.5.0)
chronic (0.2.3)
compass (0.8.17)
couchrest (0.37)
crack (0.1.7)
data_objects (0.10.1)
dbd-mysql (0.4.3)
dbi (0.4.3)
deprecated (2.0.1)
dm-core (0.10.2)
do_mysql (0.10.1 x86-mswin32-60)
….

To get a list of all installed gems, one unique entry per line, and containing nothing other than the names one can use the “cut” command on a Unix/Linux/MacOSX machine. With PowerShell though

gem list | cut -d" " -f1

doesn’t work but

gem list | %{$_.split(' ')[0]}

does. The $_ passes the current variable value to the “split” command, which uses a delimiter to split a string. In the example above a space is the delimiter. The parts generated out of the splitting are available as members of an array. Accessing the element at the 0th index of this array returns the first element.

Now that we have the names of all the installed gems, we need to iterate over this list and invoke gem uninstall with flags Iax for each of these. The I is for ignore dependency, a is for all matching gems and x is for no confirmation required. In other words running

gem uninstall -Iax activerecord

should uninstall all gems matching the name — “activerecord” — without any required confirmation.  Using xargs it is easy to pass the current value to a command as one iterates over a list. However, running

gem list | cut -d" " -f1 | xargs gem uninstall -aIx

doesn’t get the job done as xargs is unknown to PowerShell. Don’t be disappointed though for PowerShell has a replacement for xargs and its an elegant one. The position of the $_ makes all the difference. So the one liner that removes all ruby gems is:

gem list | %{$_.split(' ')[0]} | %{gem uninstall -Iax $_ }

Isn’t that nice, simple and just a one liner!

Coast to Coast: New York to California

1

Posted on : 13-08-2010 | By : tshanky | In : Beyond Code

Over the last many years I was traveling to California for work and conferences and every time I was there I was very attracted to the entrepreneurial spirit and the love for technology lead innovation in the silicon valley. However, all those years I lived in New York City, a place that probably is among the best places in the world to live in — great diversity, vivacity and vibrancy. So despite all desire I would stay in New York and travel everywhere else required. In the last few weeks though, I finally decided to reverse the structure and decided to move physically to the bay area and travel everywhere else. I am still in the process of the move but you will see me more often in the West Coast now.

From a business standpoint, our venture — Treasury of Ideas — will continue to service clients nationwide and around the globe. We will also continue to host New York centric mentoring sessions and conferences/events, like the Flex Camp Wall Street, the next edition of which is coming soon. In the next few weeks we will post our new office addresses in New York and California. The phone numbers and online addresses remain the same. I will be traveling as always and will be in New York every once a while so will get a chance to connect with old friends in New York. Also, would love to hear from friends and readers in the bay area, so drop me a message when you get a chance!

Purpose Maximization

0

Posted on : 01-06-2010 | By : tshanky | In : mastery, social

Humans are not horses and it takes more than rewards to get the best out of them. In fact, more rewards for complex tasks that requires sophisticated algorithmic thinking leads to poor performance. If you are confused by now, then watch this brilliant animated presentation:

Given that human tasks are increasingly getting complex and automated intelligent applications is the direction, we are all headed to, does it mean large rigid corporates are going to get drained out of talent? On the corollary, does it mean those who run for money essentially don’t care about challenging work? If autonomy and mastery are of paramount importance, is being an entrepreneur or a freelancer a career all smart people need to choose? If smart agile enterprises that engage employees as people and get the best out of them is the way to go, then why isn’t everyone already doing it? Are companies scared things could go out of hand?

Last but not the least, if people like to contribute effectively where they have the freedom and can enjoy challenges for no monetary reward, only because it allows for purpose maximization then why don’t we use that same energy beyond open source software and free encyclopedias to solve some of the pesky world problems that have been around for a few generations?

What do you think?

Come to Flash and the City 2010 in New York, NY

0

Posted on : 01-05-2010 | By : tshanky | In : Public Events / Conferences, RIA -- Flex/AIR/PDF/Ajax

As I have said earlier, I am on a speaking engagement diet for a few months now and am sticking to a fewer number of conferences than I have in the last few years. The place I appear next is in a conference at my home base — New York City. Thanks to Elad Elrom, we have a great Flash conference, appropriately called — “Flash and the City“, right here in our city. Its a conference that has not only attracted a stunning lineup of speakers (including yours truly, just kidding :) ) and includes some of the most relevant topics that would interest any and every Flash developer and architect but is also a conference that promises a lot of fun in the very amazing city. There are city tours, bar hopping events and dinner on the hudson. Doesn’t that sound attractive?

The event is scheduled to take place between May 13 and May 16 at the 3LD Technology Center in downtown Manhattan. You can look-up the schedule to get more details on who speaks on what and when.

My session titled  — “Flash amid the cool and the futuristic web” covers a number of different emerging aspects of the Flash platform that are shaping and will be relevant for the web of the future. So, if you care about the future of the web, do stop by.

See you at Flash and the City!

Speaking at 360 Flex San Jose — March 7-10, 2010

2

Posted on : 09-02-2010 | By : tshanky | In : Public Events / Conferences, RIA -- Flex/AIR/PDF/Ajax

With the beginning of 2010 I have put breaks on my frequent speaking engagements. What I have decided, is to speak at select few events and venues, else for the most part keep to online communication. I will tell everyone about my plans for online sessions in a following post but for now let me talk more about the next event where I appear.

Going by the last few years, by the first week of March I would have spoken at atleast 4 to 5 events. However, this year is different and consciously so! My first event is 360 Flex at San Jose (March 7-10, 2010).  You may ask why 360 Flex and you may want to know what I am talking about at that conference. Let me first attempt to answer the “why” part of the question and then I will talk a bit about what I am presenting on at the conference.

360 Flex is one of the few conferences that is run by and for the developers. Its one big meetup for all those who are part of the Flex community. Its not a stage where companies pretend to demo the future. Its all about great content, friendly experience and immense value for your money. Its a place where even the expert takes a few tips back with him at the end of the conference. So it was not prudent for me to skip this event. Tom and John have been gracious to have me as a speaker for past many 360 events and I have enjoyed each one of them. So when I had to choose a select few, 360 Flex comfortably made the list for all the good reasons I enumerated earlier in this paragraph.

So now that I am going to 360 Flex, what am I going to talk about there. Answer: some regular Flex stuff hidden under a fancy topic! No, just kiding ;) I speak about the new Multi-touch support in Flash Player 10.1 and AIR 2.0. I intend to talk about what this new support means and what it doesn’t and try and corroborate my statements with a few nice examples. It should be a good talk to attend even if you do not intend to build any touch screen applications in the near future. I will try and include a few essentials topics on touch screens and multi-touch as well to bring up to speed all those who haven’t had an exposure to this realm of application development.

If you are coming to 360 Flex, I would love to catch-up. If you haven’t registered yet, then without further adieu just follow this link to register for 360 Flex now.

Please lookup more about 360 Flex at — http://www.360flex.com/. For schedule go to — http://www.360flex.com/schedule/.

Before, I close, if at any time you were anxious why this speaking moritorium then here are my reasons –

  • Every time someone travels from coast to coast in the US, the person emits as much carbon dioxide as a full year of driving a car does. I would like to do my bit and contribute less to the global warming.
  • With the rise in the number of conferences and speakers, many events are becoming re-runs of the same old stuff, which you can easily Google for from the comfort of your home.
  • Its about time I started leveraging online media (especially video). I could reach a far greater number of people and help many more.
  • I am super busy with newer products in the making and customer work. Every time I am out I essentially slip down on my plans. I don’t want to continue to do that.
  • I am very keen on open spaces style events and advanced events as opposed to the 101 sessions. Honestly, 101 sessions are best delivered via online videos. So I think :)

A new year, a new promise!

0

Posted on : 07-01-2010 | By : tshanky | In : Beyond Code

As we enter 2010, its time again to celebrate a new year and the beginning of a new decade. 10 years into the new century we are still far away from frozen humans in suspended animation that Sir Arthur C Clarke wrote about in 2001: A Space Odyssey and again in 2010: Odyssey Two. However, we are deep in the age of socially networked internet that is helping us replace our real self with our online persona. It is a time where so many are so consumed in online stardom that they have stopped worrying about real people, real relationships and sometimes even real jobs! However, much of the new web also holds some great promise, including great new ways to collectively learn to make better decisions and mingle with like and unlike minds.  Hopefully this mingling will extend beyond playing computer games like halo with strangers around the world to understanding alternative viewpoints and a little less bloodshed due to the age old religion based feuds.

May you all have a great New Year and may you have at least a little more exciting things to do for yourself and the world — more than buying lottery tickets using your mobile phone and tweeting to the world that you finished breakfast! That’s not asking for much or is it :)

Next Stop: NFJS Rocky Mountain Software Symposium

0

Posted on : 20-11-2009 | By : tshanky | In : Java and JVM, Public Events / Conferences, RIA -- Flex/AIR/PDF/Ajax

I speak on Flex and Java Integration, Flex and Hibernate and Collaborative real-time RIA this Sunday (November 22, 2009) at the No Fluff Just Stuff (NFJS) Rocky Mountain Software Symposium in Denver, CO. If you are in Denver and coming to the show, I hope to see you there.

Build4Flash @ StackExchange

1

Posted on : 19-11-2009 | By : tshanky | In : RIA -- Flex/AIR/PDF/Ajax

My friends at Farata (Yakov, Victor and Anatole), who are a very accomplished set of authors, developers, mentors, architects and community leaders in the RIA and Java communities, have set up a venue for you to ask all your questions that pertain to the Flash platform. So go to http://built4flash.stackexchange.com/ and ask away everything about Flex, Flash, AIR, Flex and LAMP, Flex and Java, the Flash development community, open source projects in the space and more. Going by their past and current track record, I am sure you will not be disappointed with their great replies and excellent management. Do bear in mind though that the venue is very new. Help grow the community and help yourself by getting your questions answered!

http://built4flash.stackexchange.com/ is a site build on the engine created by Jeff Atwood and Joel Spolsky of the StackOverflow fame.

Flex (Flash) Camp Wall Street Starts Tomorrow

0

Posted on : 16-11-2009 | By : tshanky | In : Public Events / Conferences, RIA -- Flex/AIR/PDF/Ajax

Flex (Flash) Camp Wall Street starts tomorrow (November 16, 2009) in New York City. If you are coming to the event, do stop by to tell us about your exciting adventures in the world of RIA. Enjoy 14 exciting sessions over two days. Meet with the experts in the field. Mingle with the community and don’t forget to hang out in the after session sessions :) If you haven’t registered yet, don’t wait any longer as very few seats remain. Register online now at http://www.flexcampwallstreet.com.

speaker_badge_flash_camp_wall_street

(This cool speaker badge was created by Adam Flater as a draft initial artifact!)

Featured on DZone “Meet the Author” Video Series

0

Posted on : 07-11-2009 | By : tshanky | In : Java and JVM, My Publications, Public Events / Conferences, RIA -- Flex/AIR/PDF/Ajax

Watch me speak on BlazeDS, Flex and Java integration. (Original Post on DZone: Meet the Author – Shashank Tiwari on BlazeDS, Flex & Java Integration).

FireStats icon Powered by FireStats