Ethereum Denominations

Ethereum has a metric system of denominations used as units of ether. Denominations are named after the family name of seminal figures playing a role in evolution of computer science and crypto-economics.

UnitNameWei value
weiwei1
Kweibabbage1e3 (Thousands)
Mweilovelace1e6 (Million)
Gweishannon1e9 (Billion)
microetherszabo1e12 (Trillion)
millietherfinney1e15 (Quadrillion)
etherether1e18 (Quintillion)
Ethereum Denominations

What packages are installed/available in my python?

Often times, I need to know what modules are currently installed and available in my python VM. Here are two commands for this…

1. run “help(‘modules’)” within your python interpreter.

This will list all the modules including the standard packages that comes with Python

2. If you need to know only the modules installed by you then you can use the pip for this.

Run “pip freeze” on your command prompt to list all the packages installed by you.

What packages are installed/available in my python?

Personal wiki: wikidpad

I started using wiki at work and over the years it became one of the tool that i daily use. I started to use wiki personally for myself to capture design thoughts, todos, planning items and organizing all my files (importing into wiki folder) with some context descriptions making it a mashup or portal. I use wikidpad and dropbox to sync this with all my machines (mac and windows). This is DIY alternative to Evernote or Things. I don’t want my unencrypted data on cloud. In fact it is very easy to turn this tool into whatever you want as a personal doc portal/GTD/planner etc., Installing on mac is pain and more pain if you are on 64 bit. This is because it is based on wxPython which is based on Carbon for mac and they are supported only for 32 bit.

Here are some of my tips to install on mac and is based on the shell script provided by them.

1. Python 2.6 (comes with mac and is enabled by default as 64 bit if your kernel is 64).
2. Install wxPython 2.8 for 2.6. Just use the dmg.
3. Download the WikidPad source and copy into your preferred location. Like in my case ~/tools/
4. Create a shell script that does the following…
1. set the python to run in 32 bit mode for that session using “export VERSIONER_PYTHON_PREFER_32_BIT=yes”.
2. cd to the directory of the Wikidpad source.
3. start WikidPad: python WikidPad.py

Use the shell script to start wikidpad and create wiki files under dropbox sync directories so that it is synced to all your machines. The nice thing is that the wiki creates a .lock file and warns if you accidentally edit the same wiki from two places.

Note: If you by default run on the 32 bit python then just follow the steps for users which will avoid all the above steps and create you a nice app. I guess they use py2app for this.

Personal wiki: wikidpad

Rock mongo

Among the list of admin guis available, i happened to pick this Rock mongo as it had many features compared to others. See below for details on installing this in ubuntu server…

Pre-requisites

1. Apt-get php5, php mod lib5 for apache2.
2. Apt-get php-pear (to get PECL) and php-dev.
3. sudo pecl install phpmongo.
4. Restart apache.

Installation

1. Follow the steps here. All it involves is download a zip and extract to a folder.
2. Now configure Apache to create a php app using the above the folder.
3. If required change the config.php to set the mongo server information like port, user name and password.

Rock mongo really rocks.

Rock mongo

Installing mongodb on ubuntu server

See here for detailed instructions.The steps can be summarized at high level as below…

1. Add the 10gen server to the software repo list.
2. Add the 10gen GPG key via apt-key to trust and verify the 10gen repo server.

Note: if for some reason you have firewall issues to retrieve the key then you can save the GPG key into a file and import using apt-key. see here

Installing mongodb on ubuntu server

Sql to Django queryset cheatsheet

Sql QuerySet Notes
SELECT count(*) FROM fruit Fruits.objects.count() table count
SELECT count(*) FROM fruit WHERE name=’Orange’ Fruits.objects.filter(name__exact=’Orange’).count() count with filter
SELECT * FROM fruit WHERE color is NULL Fruits.objects.get(color__isnull=True) filter by null
SELECT * FROM fruit WHERE color is NOT NULL Fruits.objects.get(color__isnull=False) filter by null
SELECT * FROM fruit WHERE name=’Apple’ Fruits.objects.get(name__exact=’Apple’) case sensitive
SELECT * FROM fruit WHERE lower(name)=lower(‘Apple’) Fruits.objects.get(name__iexact=’Apple’) case in-sensitive
SELECT * FROM fruit WHERE name LIKE ‘App%’ Fruits.objects.filter(name__startswith=’App’) case sensitive LIKE
SELECT * FROM fruit WHERE upper(name) LIKE ‘APP%’ Fruits.objects.filter(name__istartswith=’app’) case in-sensitive LIKE
SELECT * FROM fruit WHERE name LIKE ‘%pp%’ Fruits.objects.filter(name__contains=’pp’) case sensitive LIKE
SELECT * FROM fruit WHERE lower(name) LIKE ‘%pp%’ Fruits.objects.filter(name__icontains=’pp’) case in-sensitive LIKE
SELECT * FROM fruit WHERE name LIKE ‘%ple’ Fruits.objects.filter(name__endswith=’ple’) case sensitive LIKE
SELECT * FROM fruit WHERE lower(name) LIKE ‘%ple’ Fruits.objects.filter(name__iendswith=’ple’) case in-sensitive LIKE
SELECT * FROM fruit WHERE weight > 2 Fruits.objects.get(weight__gt=2) greater than
SELECT * FROM fruit WHERE weight >= 2 Fruits.objects.get(weight__gte=2) greater than or equal-to
SELECT * FROM fruit WHERE weight < 2 Fruits.objects.get(weight__lt=2) less than
SELECT * FROM fruit WHERE weight <= 2 Fruits.objects.get(weight__lte=2) less than or equal-to
Sql to Django queryset cheatsheet