Default to Incognito

Feed : Intertwingly
Published on : 2012-02-04 17:22:13

Patch for /usr/share/applications/google-chrome.desktop:

108c108
< Exec=/opt/google/chrome/google-chrome %U
---
> Exec=/opt/google/chrome/google-chrome %U --incognito
114c114
< X-Ayatana-Desktop-Shortcuts=NewWindow;NewIncognito
---
> X-Ayatana-Desktop-Shortcuts=NewIncognito;NewWindow

Read more »

Wunderbar

Feed : Intertwingly
Published on : 2012-02-02 09:22:12
W

Clearly if you want to develop a real web application, you need a router, a templating language, ability to separate out your model, view, and controller, scalability, and much more.

However, at times this is both too much, and yet not enough.  I find that I write a lot of scripts that do report generation, execution of shell commands, and the like, and in many cases would like to present a richer output than plain text: things like tables, fonts, and most importantly hypertext links.  I don’t want to worry too much about DOCTYPEs, charsets, and escaping, but instead on structure, style, and content.

I’ve been extracting some of the common logic from these scripts out into a library, and recently have started refactoring that library.  Yesterday, I focused on the HTML generation parts.

What I settled on was to define all methods that start with a low line character will generate a HTML tag.  As with builder on which this library is based, these tags can have text content and attributes.  Tags can also be nested.  Logic can be freely intermixed.

Here’s an example using the library.  The example will personally greet you if you provide your name.  If no name is provided, a form is provided which enables you to provide one.

#!/usr/bin/ruby1.9.1
require 'wunderbar'

Wunderbar.html do
  _head do
    _title 'Greeter'
    _style %{
      input {display: block; margin: 2em}
    }
  end

  _body? do
    if $param.name
      _p "Hello #{$param.name}!"
    else
      _form method: 'post' do
        _p 'Please enter your name:'
        _input name: 'name'
        _input type: 'submit'
      end
    end
  end
end

Here’s example output from that script:

<!DOCTYPE html>

  
    
    Greeter
    
      input {display: block; margin: 2em}
    
  
  
    

Please enter your name:

As you can see, by default it takes care of indenting and generation of HTML.  It even knows which tags support explicit close tags and which ones do not.  Not shown in this example, but these default behaviors can be overridden by adding an exclamation mark at the end of the method name.  An example would be something like:

_p! { _ "Hello "; _span $param.name, class: 'name'; _ '!' }

An underbar which is not followed by a name generates text.  Example output:

Hello Sam!

The span can be styled using css.

If your web server is set up to execute CGI scripts, deployment is as easy as copying the script into the appropriate directory.

Read more »

Port Forwarding

Feed : Intertwingly
Published on : 2012-01-23 10:22:10

Problem: I’m not always at the machine that is VPN’ed into work.

Solution: place the following into /etc/network/if-up.d/sametime-forwarder:

#!/bin/sh
#
# redirect Sametime's port 1533 to messaging.ibm.com
#
echo 1 > /proc/sys/net/ipv4/ip_forward # turns on forwarding
iptables -F -t nat # Flush existing translation tables
iptables -t nat -A PREROUTING -p tcp --dport 1533 -j DNAT --to 9.17.136.77:1533
iptables -t nat -A POSTROUTING -j MASQUERADE

Read more »

AWDwR updated for Rails 3.2

Feed : Intertwingly
Published on : 2012-01-20 13:22:11
P P

David Heinemeier Hansson: there’s a brand new 3.2-compatible version of Agile Web Development with Rails.

This time, the release of Rails 3.2 and the release of the eBook were coordinated.

Read more »

The President’s challenge

Feed : Intertwingly
Published on : 2012-01-17 11:22:11
SOPA

Nat Torkington: Don’t wait for the time machine, because we’re never going to invent something that returns you to 1965 when copying was hard and you could treat the customer’s convenience with contempt.

Take action.

Read more »

Bootstrapping Debian Unstable

Feed : Intertwingly
Published on : 2012-01-04 15:22:14

It turns out that the following is all it takes to install Debian Unstable in a chroot jail under Ubuntu, and then to log into that jail as root:

apt-get install debootstrap schroot
mkdir /tmp/unstable
debootstrap unstable /tmp/unstable
chroot /tmp/unstable

There are a few things that need cleaning up, however, starting with locales:

apt-get install locales
dpkg-reconfigure locales

Once there, select en_US.UTF-8 UTF-8 both to be installed, and as the default locale.

The following will eliminate a number of other warnings you may see:

echo "none /dev/pts devpts defaults 0 0" >> /etc/fstab
mount /dev/pts

Next add a user, and enable that user to log in via sudo

adduser rubys
apt-get install sudo
echo "rubys     ALL=(ALL:ALL) ALL" > /etc/sudoers.d/rubys
chmod 440 /etc/sudoers.d/rubys

Note: visudo can be used as an alternative.  For reasons I don’t understand, usermod -a -G sudo rubys did not have the desired effect.

One final bit of configuration before logging out as root: define some text that will show up in the prompt and window title area:

echo wheezy > /etc/debian_chroot

Back on your “host” operating system, add the following to /etc/schroot/schroot.conf:

[unstable]
description=Debian wheezy/sid (unstable)
directory=/tmp/unstable
root-users=rubys
aliases=wheezy,default

At this point, you should be able to “log in” to your chroot jail with the following command:

schroot

Read more »

Ubuntu vs Ruby

Feed : Intertwingly
Published on : 2011-12-24 16:22:10

If Ubuntu 12.04 if a LTS release, and Ruby 1.8.7 goes out of support in June of 2013, then why is the default still 1.8.7?

Ruby 1.9.2 was released in 2010. Ruby 1.9.3 was released in October of this year.

Read more »

Experience with Git

Feed : Intertwingly
Published on : 2011-11-24 07:22:10

The git vs svn permathread seems to have reignited at the ASF, and I thought I would describe some of my actual experiences with git in the hopes that it will help anchor the discussion.

The context: I’m co-author of a book on Rails.  I have a vested interest in the scenarios described in that book continuing to work, so I wrote a few tests that I run against various combinations of Book editions, Rails releases, and Ruby versions.

From time to time, a test fails.  One of the first things I typically do is run git bisect.  All I need to do is to identify a good version, a bad version, and a test to run.  Even if the test takes 2 minutes and there are 30 or so revisions between the good and bad points, I get an answer in about 10 minutes without needing to be further involved in determining where the problem is.

I mention it to a developer, and the first thing he does is place a comment on the the actual commit.

The next thing I do is build a smaller test case.  I have a scenario that fails.  I know a revision that it passes on.  I whittle down the scenario to one that continue to fail with the same symptoms and passes on the known good revision.  I post a comment on the same commit.

At this point, I have a small test and a commit that fails.  I may not know the full Rails codebase, but the commit page shows what changed and I can make an educated guess as to what the problem is.  I post my patch for all to see.  I request that this patch be pulled.  Within minutes it is, and the pull request is closed.

Can all of this be done using svn and JIRA?  Absolutely.  I’ve used svn log, diff, and patch plenty of times.  But compare that experience to going to a web page showing a list of commits, running git bisect, pushing a patch for all to see, and then clicking on pull request.

Are any of these features absolutely necessary?  Well, no.  I’m even aware that pieces are available like svn-bisect.  But I can see how people that have gotten used to having everything integrated and at their fingertips feel like they are taking a step huge backwards when they migrate to an environment that doesn’t.

Read more »

Building Dart

Feed : Intertwingly
Published on : 2011-10-10 16:22:16

Trying to follow the PreparingYourMachine instructions.

First impression:

# source install-build-deps.sh 
Only Ubuntu 10.04 (lucid) through 11.04 (natty) are currently supported

... I was trying using 11.10, which is still in beta.  Understandable.

Second impression:

Suggested packages:
  apache2-doc apache2-suexec apache2-suexec-custom bison-doc dh-make krb5-doc
  php-pear libasound2-doc cairo-perf-utils libcairo2-doc libcurl3-dbg
  libgcrypt11-doc libglib2.0-doc python-subunit gnutls-doc gnutls-bin
  guile-gnutls krb5-user libgtk2.0-doc libpango1.0-doc imagemagick sqlite3-doc
  php5-suhosin libmail-box-perl alien rpm-i18n ri ruby-dev ruby1.8-examples
  ri1.8 subversion-tools db4.8-util xserver-xfree86 xserver xfs
The following NEW packages will be installed:
  apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common bison
  cabextract comerr-dev curl debhelper elfutils firefox-locale-fr flex gperf
  html2text krb5-multidev language-pack-fr language-pack-fr-base
  libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap libasm1 libasound2-dev libatk1.0-dbg libatk1.0-dev
  libavahi-client-dev libavahi-common-dev libbz2-dev libc6-dbg
  libcairo-script-interpreter2 libcairo2-dbg libcairo2-dev libcups2-dev
  libcurl3 libcurl4-gnutls-dev libdbus-1-dev libdbus-glib-1-dev libdrm-dev
  libdw1 libelf-dev libexpat1-dev libfontconfig1-dbg libfontconfig1-dev
  libfreetype6-dev libgconf2-dev libgcrypt11-dev libgdk-pixbuf2.0-dev
  libgl1-mesa-dev libglib2.0-0-dbg libglib2.0-dev libglu1-mesa-dev
  libgnome-keyring-dev libgnutls-dev libgpg-error-dev libgssrpc4
  libgtk2.0-0-dbg libgtk2.0-dev libice-dev libidl-dev libidn11-dev
  libjpeg62-dev libkadm5clnt-mit7 libkadm5srv-mit7 libkdb5-4 libkms1
  libkrb5-dev libldap2-dev libmail-sendmail-perl libnspr4-dbg libnspr4-dev
  libnss3-dbg libnss3-dev liborbit2-dev libpam0g-dev libpango1.0-0-dbg
  libpango1.0-dev libpcre3-dbg libpcrecpp0 libpixman-1-0-dbg libpixman-1-dev
  libpng12-dev libpthread-stubs0 libpthread-stubs0-dev libpulse-dev
  libreadline5 librpm1 librpmbuild1 librpmio1 libruby1.8 libsctp-dev libsctp1
  libsm-dev libsqlite3-0-dbg libsqlite3-dev libssl-dev libsvn1
  libsys-hostname-long-perl libtasn1-3-dev libx11-6-dbg libx11-dev libxau-dev
  libxau6-dbg libxcb-render0-dev libxcb-shm0-dev libxcb1-dbg libxcb1-dev
  libxcomposite-dev libxcomposite1-dbg libxcursor-dev libxcursor1-dbg
  libxdamage-dev libxdamage1-dbg libxdmcp-dev libxdmcp6-dbg libxext-dev
  libxext6-dbg libxfixes-dev libxfixes3-dbg libxft-dev libxi-dev libxi6-dbg
  libxinerama-dev libxinerama1-dbg libxml2-dev libxrandr-dev libxrandr2-dbg
  libxrender-dev libxrender1-dbg libxslt1-dev libxss-dev libxt-dev libxtst-dev
  libxtst6-dbg lksctp-tools m4 mesa-common-dev orbit2 php5-cgi php5-cli
  php5-common po-debconf python-dev python2.7-dev rpm rpm-common rpm2cpio ruby
  ruby1.8 subversion ttf-bengali-fonts ttf-devanagari-fonts ttf-gujarati-fonts
  ttf-indic-fonts ttf-kannada-fonts ttf-kochi-gothic ttf-kochi-mincho
  ttf-malayalam-fonts ttf-mscorefonts-installer ttf-oriya-fonts
  ttf-sazanami-mincho ttf-tamil-fonts ttf-telugu-fonts wdiff
  x11proto-composite-dev x11proto-core-dev x11proto-damage-dev
  x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev
  x11proto-record-dev x11proto-render-dev x11proto-scrnsaver-dev
  x11proto-xext-dev x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev
  zlib1g-dbg zlib1g-dev

Whoa... that’s a lot of stuff.  Presumably most of that stuff is only needed to build chrome, and dash only needs a small portion of that.

Third impression:

Gold is a new linker that links Chrome 5x faster than GNU ld.

Wow.  Replacing the linker is clearly hard-core stuff.

Fourth impression:

*******************************************************************************
* WARNING: Can't download DumpRenderTree! This is required to test client apps.
* You need to do a one-time configuration step to access Google Storage.
* Please run this command and follow the instructions:
*     third_party/gsutil/20110627/gsutil config
*
* NOTE: When prompted you can leave "project-id" blank. Just hit enter.
*******************************************************************************

OK, this is starting to **** me off.  They need my Google identity in order to simply build a compiler?  Grr.

Fifth impression:

Please navigate your browser to http://code.google.com/apis/console,
then click "Services" on the left side panel and ensure you have Storage
activated, then click "Storage" on the left side panel and find the "x-goog-project-id" on that page.
What is your project-id?

I don’t see a left side panel or “Services” anywhere on the page.  Stuck for now.  Will move onto other tasks and come back later.

I wonder how many people who are diss’ing Dart on Twitter and elsewhere have actually tried the language?

Read more »

Building Dash

Feed : Intertwingly
Published on : 2011-10-10 14:22:29

Trying to follow the PreparingYourMachine instructions.

First impression:

# source install-build-deps.sh 
Only Ubuntu 10.04 (lucid) through 11.04 (natty) are currently supported

... I was trying using 11.10, which is still in beta.  Understandable.

Second impression:

Suggested packages:
  apache2-doc apache2-suexec apache2-suexec-custom bison-doc dh-make krb5-doc
  php-pear libasound2-doc cairo-perf-utils libcairo2-doc libcurl3-dbg
  libgcrypt11-doc libglib2.0-doc python-subunit gnutls-doc gnutls-bin
  guile-gnutls krb5-user libgtk2.0-doc libpango1.0-doc imagemagick sqlite3-doc
  php5-suhosin libmail-box-perl alien rpm-i18n ri ruby-dev ruby1.8-examples
  ri1.8 subversion-tools db4.8-util xserver-xfree86 xserver xfs
The following NEW packages will be installed:
  apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common bison
  cabextract comerr-dev curl debhelper elfutils firefox-locale-fr flex gperf
  html2text krb5-multidev language-pack-fr language-pack-fr-base
  libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap libasm1 libasound2-dev libatk1.0-dbg libatk1.0-dev
  libavahi-client-dev libavahi-common-dev libbz2-dev libc6-dbg
  libcairo-script-interpreter2 libcairo2-dbg libcairo2-dev libcups2-dev
  libcurl3 libcurl4-gnutls-dev libdbus-1-dev libdbus-glib-1-dev libdrm-dev
  libdw1 libelf-dev libexpat1-dev libfontconfig1-dbg libfontconfig1-dev
  libfreetype6-dev libgconf2-dev libgcrypt11-dev libgdk-pixbuf2.0-dev
  libgl1-mesa-dev libglib2.0-0-dbg libglib2.0-dev libglu1-mesa-dev
  libgnome-keyring-dev libgnutls-dev libgpg-error-dev libgssrpc4
  libgtk2.0-0-dbg libgtk2.0-dev libice-dev libidl-dev libidn11-dev
  libjpeg62-dev libkadm5clnt-mit7 libkadm5srv-mit7 libkdb5-4 libkms1
  libkrb5-dev libldap2-dev libmail-sendmail-perl libnspr4-dbg libnspr4-dev
  libnss3-dbg libnss3-dev liborbit2-dev libpam0g-dev libpango1.0-0-dbg
  libpango1.0-dev libpcre3-dbg libpcrecpp0 libpixman-1-0-dbg libpixman-1-dev
  libpng12-dev libpthread-stubs0 libpthread-stubs0-dev libpulse-dev
  libreadline5 librpm1 librpmbuild1 librpmio1 libruby1.8 libsctp-dev libsctp1
  libsm-dev libsqlite3-0-dbg libsqlite3-dev libssl-dev libsvn1
  libsys-hostname-long-perl libtasn1-3-dev libx11-6-dbg libx11-dev libxau-dev
  libxau6-dbg libxcb-render0-dev libxcb-shm0-dev libxcb1-dbg libxcb1-dev
  libxcomposite-dev libxcomposite1-dbg libxcursor-dev libxcursor1-dbg
  libxdamage-dev libxdamage1-dbg libxdmcp-dev libxdmcp6-dbg libxext-dev
  libxext6-dbg libxfixes-dev libxfixes3-dbg libxft-dev libxi-dev libxi6-dbg
  libxinerama-dev libxinerama1-dbg libxml2-dev libxrandr-dev libxrandr2-dbg
  libxrender-dev libxrender1-dbg libxslt1-dev libxss-dev libxt-dev libxtst-dev
  libxtst6-dbg lksctp-tools m4 mesa-common-dev orbit2 php5-cgi php5-cli
  php5-common po-debconf python-dev python2.7-dev rpm rpm-common rpm2cpio ruby
  ruby1.8 subversion ttf-bengali-fonts ttf-devanagari-fonts ttf-gujarati-fonts
  ttf-indic-fonts ttf-kannada-fonts ttf-kochi-gothic ttf-kochi-mincho
  ttf-malayalam-fonts ttf-mscorefonts-installer ttf-oriya-fonts
  ttf-sazanami-mincho ttf-tamil-fonts ttf-telugu-fonts wdiff
  x11proto-composite-dev x11proto-core-dev x11proto-damage-dev
  x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev
  x11proto-record-dev x11proto-render-dev x11proto-scrnsaver-dev
  x11proto-xext-dev x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev
  zlib1g-dbg zlib1g-dev

Whoa... that’s a lot of stuff.  Presumably most of that stuff is only needed to build chrome, and dash only needs a small portion of that.

Third impression:

Gold is a new linker that links Chrome 5x faster than GNU ld.

Wow.  Replacing the linker is clearly hard-core stuff.

Fourth impression:

*******************************************************************************
* WARNING: Can't download DumpRenderTree! This is required to test client apps.
* You need to do a one-time configuration step to access Google Storage.
* Please run this command and follow the instructions:
*     third_party/gsutil/20110627/gsutil config
*
* NOTE: When prompted you can leave "project-id" blank. Just hit enter.
*******************************************************************************

OK, this is starting to **** me off.  They need my Google identity in order to simply build a compiler?  Grr.

Fifth impression:

Please navigate your browser to http://code.google.com/apis/console,
then click "Services" on the left side panel and ensure you have Storage
activated, then click "Storage" on the left side panel and find the "x-goog-project-id" on that page.
What is your project-id?

I don’t see a left side panel or “Services” anywhere on the page.  Stuck for now.  Will move onto other tasks and come back later.

I wonder how many people who are diss’ing Dash on Twitter and elsewhere have actually tried the language?

Read more »

1 2 3 4 5 6 » [6]
Unless otherwise specified, contents of this site are copyright by the contributors and available under the
Creative Commons Attribution 3.0. Contributors should be attributed by full name or nickname.