Having a ball playing around with the just-released GoogleCL tool, which offers command line access to Google Calendar, contacts, Docs, Picasa, Blogger, and YouTube. With Python-based GoogleCL installed, you can do things such as list today’s events on your GCal right in the terminal, like so:
$ google calendar today title
Coffee with Michael and Samir
Dozing off
Lunch at Flingers
Instant use case: Add echo “Next 24 hours:”;google calendar today title to your ~/.bash_profile file to see what you’ve got scheduled for the day when you launch a new Terminal window. Some more GoogleCL fun inside.
If you just type google at the command line, you launch an interactive terminal that lets you try all the various commands. In the interactive terminal, type command-name help to see its options, like help calendar.
Each command has several parameters that aren’t immediately apparent. For example, in calendar, you can omit the long and hairy event URL by using the title parameter. You can list events for a particular day using the data parameter (–date 2010-06-16), and you can get events from a particular calendar and by keyword search term.
For example, to see all my trips to Melbourne on my Work calendar, I’d use the command:
$ google calendar list --cal Work --query Melbourne
Remember the beauty of the command line: you can easily chain commands together with the pipe, so you can sed, awk, and grep output to your heart’s content, and then write it to a file if needed, using >. Before I discovered the title parameter on the calendar command, I was planning to use sed to filter out the calendar URLs from the output. (Thanks to lightening-fastsed and awk experts on Twitter, I was prepared to do just that.)
While I’ve mostly only played with calendar, the Docs access is pretty useful, too. With it, you could easily schedule cron’ed backups of your Google Docs, or push data into a new doc on a regular basis. Same deal with Picasa and YouTube. I like the idea of cron’ing a job that backs up my Google contacts to a CSV file on my local computer weekly, too. I don’t see myself ever blogging from the command line, but it’s neat that you can.
When installing I had an issue when running the google command, There was some python errors followed by:
Even as Hollywood continues to pull in huge profits from its existing business model, the lure of even greater riches inspires the relentless pursuit of filesharing-related platforms such as The Pirate Bay, isoHunt and more recently, Newzbin. The studios hope that one day sharing will be crushed and people will have no other choice than to consume media through conventional authorized pay channels.
While that is Hollywood’s prerogative, others are beginning to realize that being able to exercise that level of control is probably a thing of the past and are exploring means to embrace disruptive technologies such as BitTorrrent by embedding them into their creative projects.
One such endeavor is a horror movie set to be released for free later this year by Julian Harvey and Enzo Tedeschi who together form Australia-based Distracted Media.
The Tunnel is a story based on the real-life networks of tunnels under Sydney, Australia. Created decades ago, the tunnels were supposed to be used as a rail network but construction on them was discontinued. Twenty years later they became U.S. General Macarthur’s headquarters during the Second World War but were later abandoned. A few years ago they made the news again when Sydney ran short of water and plans were made to utilize the flooding in the tunnels.
“After much fanfare the proposal mysteriously vanished… and so the story begins…,” tease the filmmakers.
The funding for the film is being handled by the ‘135K project’ – a reference to the 135,000 frames that will be present in the finished 90 minute movie. A freshly launched website invites people to invest directly by buying a single frame of the movie for $1, 25 frames (1 second) for $25 or a minute for $1,500.
“The funding / distribution concept is an extension of something I was a part of on my last film, a feature doco titled Food Matters,” Enzo Tedeschi told TorrentFreak. “We deliberately did not seek out a theatrical release, and instead decided to market directly to our niche audience online with direct-to-DVD and VOD. It was a huge success, and even now 2 years after its first release, we are still breaking into new territories and have sold around 120,000 DVDs.”
No media these days is excluded from becoming available on the Internet, and Enzo’s previous production was no different.
“It just takes a quick Google search to see the endless torrents for that [Food Matters], too. The production company was nowhere near big enough to even try and fight it, so it was accepted that it would happen. So this time around I figured we should try and embrace that huge potential audience and make it a part of our strategy,”
“The Internet was meant to be a tool to connect us. It was meant to break down borders and liberate. Now we have an entire generation who are being labeled criminals for using that tool. But perhaps rather than wasting millions of dollars fighting a losing battle against internet piracy, we should try and find a way to embrace the possibilities that this new world brings.”
An added twist for investors is that one lucky frame-buyer will be selected to receive 1% of the profits from the movie – Enzo is confident that the film will be making money.
“People always ask ‘But how will you make money?’. It’s because they are stuck in a old way of thinking. We’re confident we can turn a profit on this film doing it this way, and I think people will be surprised to see how this works,”
I find that whenever I get a large data file from somewhere (i.e. extract some data from a database, crawl some sites and dump the data in a file) I always need to do just that little bit of extra processing before I can actually use it. This processing is always just non-trivial enough and I do it just uncommonly enough for me to always forget exactly how to go about it. Of course, this is to be expected, if you learn something and want it to stick you have to keep doing it. It’s all part and parcel of how our brain works when it comes tolearning new skills, but that doesn’t make it any less annoying.
Back to our data file, for me I find that I almost always need to do 3 things (amongst others) before doing anything else with my file.
delete the first line (especially when pulling data out of the database)
delete the last line
remove all blank lines
Don’t ask me why but for whatever reason, you always get an extraneous first line and unexpected blank lines (and less often an extraneous last line) no matter how you produce the file .
Anyways, my tool of choice in the matter is bash - it is just too trivial to use anything else (plus I love the simplicity and power of the shell). So, to make sure I never forget again here is the easiest way of doing all the three things above using sed:
sed -e 1d -e ‘$d’ -e ‘/^$/d’ input_file > output_file
Of course since we’re using bash, there should be numerous ways of doing the above.
but it would be silly to try and use it to remove the first and last line (possible though).
If you know of an easier way to do the above three things in a one-liner using bash – do share it.
What are some of the most common (but non-trivial enough) things that you find yourself doing with bash when it comes to pre-processing that large data file?
Back when I did phone support, many moons ago – I did receive some calls like this from people who had unplugged their mouse, or inserted their pre-paid internet card into their floppy drive.
FREE FALL: World champion freediver Guillaume – Does a very special dive at Dean’s Blue Hole, the deepest blue hole in the world filmed entirely on breath held by the french champion, Julie Gautier.
Hi-Tec has come up with a brilliantly successful viral campaign featuring a group of people supposedly running on water. The video suggests the sport is called Liquid Mountaineering and shows a few chaps running on water for several metres at a time before falling in.
So far the video has been viewed over 2.5 million times since it was published at the end of last month (28th April). The giveaway for the video is the huge amount of Hi-Tec branding and the close ups on the Adventure Sport range of Hi-Tec shoes used for the running on water stunts. (The other giveaway is that people can’t run on water).
Hi-Tec also created a fake blog for the Liquid Mountaineering team, go to http://bit.ly/hitecblog to visit the site. The blog shows early attempts at running on water in Gerês, Portugal.
Local news stations in the USA have even been caught out reporting the story is true !. Congrats to the agency involved.
Tonight I was setting up subversion and websvn on a small CentOS VPS and I came across an issue where, after commit to a change my WebSVN interface would break, complaining “svn: Unable to open an ra_local session to URL”. There was also a permission denied error mixed in there, which immediately pointed to file permissions.
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///var/svn-repos/mytestrepo/trunk/testing.txt'
svn: Can't open file '/var/svn-repos/mytestrepo/trunk/testing.txt/format': Permission denied
Basically when I commit to the change, I am overwriting files in my repository, including the permissions of those files. So, In order to get a quick-fix, I simply changed my ssh user’s group to the same group I have setup on the svn-repos directory and adding myself to any secondary groups.
So to add a user to a primary group called “subversion”:
$ useradd -g subversion jake
Then view that user:
$ id jake
Then add user ‘jake’ to any other secondary user groups:
$ usermod -a -G ftp jake
Please note that the user syntax will vary when using Debian, From memory it is along the lines of: groupadd <user> <group>
Code names have been around for a long time. Remember the Manhattan project in the 1940s? That turned out to be the atomic bomb. Thankfully, not all code names hide such sinister projects.
Code names can be about secrecy, but when it comes to software development, it’s usually not so much about secrecy as it is about the convenience of having a name for a specific version of a software. It can be very practical to have a unique identifier for a project to get everyone on the same page and avoid confusion.
So i’ve got an APC40 which is pretty fucking cool for throwing around tracks samples and anything else audio into your mixes. The only thing that could make it better, is adding a touchscreen element to it which is then programable and configurable. The solution for this previously has been the Lemur, However now the iPad is out and is “relatively” cheap for a touchscreen device – We’ve got an even new-er breed of DJ’s forming – The iPad DJ’s.
Sometimes there is a very quick need to determine what user(s) are causing high load to a particular page. Instead of tailing high-speed logs and giving yourself a headache, Throw in a one-lined piped cat command to give you the info you’re after without the foreplay.