From bit to a heart beat

insane innovations from a sane insanity

Mon Sep 28

Adding your .emacs to Mercurial / Git

Having my favorite .emacs settings available, in the tip of my “hg clone” command is precious. No more backups and no more “oh no, I have an older version in my usb stick”. And it’s easy!

First of all, you need a mercurial server. Or an account at http://bitbucket.org/. Of course the same procedure stands for git.

Then you create a new repository (let’s call it my-emacs).

After that, you must move/rename your .emacs.d/ directory to .emacs.d-old/ and clone your repository.

cd ~

mv .emacs.d/ .emacs.d-old

rm -R .emacs.d/

hg clone https://yourname@bitbucket.org/yourname/my-emacs .emacs.d

the last line is available for copy-past on bitbucket.

Then you copy all your files to the .emacs.d which is now under version control

cp .emacs.d-old/ .emacs.d -R

Now the only thing is missing is adding your .emacs file. There are two ways. One is creating a init.el and the other one is having a .emacs file that loads another one dot-emacs.el which is in your version-controlled .emacs.d/

So,

cp .emacs .emacs.d/dot-emacs.el

The .emacs which is outside of .emacs.d (thus not under version control, should have this line:

(load “~/.emacs.d/dot-emacs.el”)

And you are ready! If you need to ignore a directory (which is inside .emacs.d/) just create a .hgignore file inside .emacs.d/ and add the name of the directory or any other files (google “hg ignore”):

ignore-dir/

Finally commit everything and push them to server.

cd .emacs.d

hg add *

hg commit -m “First commit”

hg push

Enjoy!

Comments (View)
Sat Sep 19

First review - Karmic Ubuntu Moblin Remix

No one has posted a review of the upcoming Ubuntu remix, so here we go!

First of all, I installed it via usb-creator on a 64gb USB (you need more than 1gb usb for installation via usb - even a 2gb will do) with no problem at all.

The boot stage is identical to the Ubuntu 9.10 and way slower than Moblin’s boot stage (+10secs). After that, the environment seems the same, but now we have the Ubuntu wallpaper and many Ubuntu programs (OpenOffice, Empathy, Synaptic package manager, etc).

The network still has the same bugs as the Moblin has (can’t save password and I couldn’t connect to wifi) and the main problem is that every time you run a program, it doesn’t seem very integrated into the Moblin UI, so when you close the application, a white screen welcomes you. After that you have to click the menu bar and return to whatever you were doing.

Another thing is that whenever you are starting a program you have to decide whether you want a new space or you want to squeeze it to an old one (the dialog stays for about 3 secs).

Definitely not a production-ready image (it’s called “development iso” for a reason) but I think that in order to utilize the Moblin v2 UI, many application must be rewritten or replaced.

You can check the images in better quality and some more here

Comments (View)
Wed Sep 16

Ubuntu Moblin Remix is out!

It seems that I am the first one the found that Canonical released an iso image of Ubuntu Moblin Remix (UMR), four months after the official announcement that Moblin v2 will be supported and a couple of months after the announcement that they are working on Ubuntu Moblin Remix. That means that the sexy interface of Moblin v2, will be included at the ubuntu repositories (and it will be supported by Canonical).

Pics/videos are coming along with a full review!

Comments (View)
Thu Aug 27

How to setup Emacs 23.1 and slime for Ubuntu

After searching and patching around this is what you have to do:

First, install emacs23 (emacs-snapshot) from here https://launchpad.net/~ubuntu-elisp/+archive/ppa. Choose your distro, add the entries to your sources.list, install and you have emacs 23.1.

Now, add slime and sbcl from ubuntu repositories and add this to your .emacs file:

;; Lisp
(setq inferior-lisp-program “sbcl”)
(add-to-list ‘load-path “/usr/share/emacs/site-lisp/slime”)
(require ‘slime)
(slime-setup ‘(slime-fancy))

and happy hacking!

Comments (View)
Mon Aug 24

OpenShare :: The First OpenSource Ad network!

This started as a project for a company that wanted an ultra fast advertising server to use for their “ring of sites”. After the project finished, I kept thinking that the OpenSource community could benefit from a “Banner Exchange” service that is free, fast and reliable. So, I started hacking one in web2py running on Google App Engine (no, it has nothing to do with the previous one I’ve built) and after a couple of days (you can tell from the design) it is done.

I think that OpenSource projects, blogs, N.G.Os, forums etc, can benefit from a non-profit ring of sites that could help them increase their hits/clicks.

If you have an OpenSource project, blog, NGO, forum, portal, whatever that is free, you are more than welcome to join OpenShare!

Enjoy!

http://openshare.emotionull.com/

Comments (View)
Sat Jul 18

Using your mobile as a Bluetooth modem for Ubuntu (10 simple steps!)

I have free GPRS on my mobile and sometimes I just need my daily dose of Internet even when I am at places with no Internet connection (island / mountain). I know there are many good solutions but sadly many of them are missing some important stuff. So, here is my take:

1. Download bluez-passkey-gnome

$ sudo apt-get install bluez-passkey-gnome

2. Run bluetooth-applet (you’ll see why in the next step)

$ sudo bluetooth-applet &

3. Pair you mobile with your Ubuntu

There is no need to enable your Bluetooth on your phone (will be automatically enabled later) but is vital to make your phone visible (at least for the time being). Also, enable your bluetooth on your Ubuntu. If you don’t know how, google around. There are many guides (it’s reeealy easy and probably is already enabled along with your wireless connection).

Find the “Paired Devices” screen on your phone’s menu and select “New paired device” and select your Ubuntu. Then you’ll be asked for a password (put whatever you like). At the same time, a dialog will popup from your Ubuntu, asking for the same password. After that, congrats, your phone and your Ubuntu are paired :D

There is no need to create a pin file inside the bluetooth directory (in case you where reading other tutorials). Bluetooth-applet handles everything.

4. Search for your phone from Ubuntu

$ hcitool scan
Scanning …
xx:xx:xx:xx:xx:xx My phone

The xx:xx:xx:xx:xx:xx your phone’s “id”. Will use it at the next steps.

4. Find the correct channel for Dial-Up networking (usually is channel 2)

$ sdptool browser xx:xx:xx:xx:xx:xx

Search for the Dial-Up networking and then check the number of channel.

5. Modify the file: /etc/bluetooth/rfcomm.conf

rfcomm0 {
# # Automatically bind the device at startup
bind yes;
#
# # Bluetooth address of the device
device xx:xx:xx:xx:xx:xx;
#
# # RFCOMM channel for the connection
channel 2;
#
# # Description of the connection
comment “My phone”;
}

Add your mobile’s “id” and the channel and you are set.

6. Restart bluetooth services

$ sudo /etc/init.d/bluetooth restart

7. Connect to the phone

$ rfcomm connect 0

There is another way to connect to your phone (using the id) but as long as you’ve done step 5, you are set :D

If it works, you should see

Press CTRL-C for hangup

8. Connection settings

You need to put these files (search for your provider). The examples below are for Vodafone Greece (I couldn’t find it anywhere online). If you can’t find yours online, you can either call them OR check the setting from your mobile (Internet Settings, connections, something like that). You should see something like this:

Name of access point: wapkarta.vodafone.gr

Write that down. We are gonna need it.

Update: These setting usually a proxy for your browser. Google around for the proxy or a better access point.

Now,  create a file :

$ sudo nano /etc/ppp/peers/vodafone

and paste this (they might be different for your provider! Google around!)

# from www.hingston.demon.co.uk/mike/nokia6680.html 
noauth
#change this if you move the path to your connect script
connect "/usr/sbin/chat -v -f /etc/chatscripts/vodafone-connect"
#change this if you move the path to your disconnect script
disconnect "/usr/sbin/chat -v -f /etc/chatscripts/vodafone-disconnect"
#I found that I needed this to remove problems with loopback on connecting
silent
#remove this if you don't want lots of information going to /var/log/messages
debug
#this is the device specified in your rfcomm.conf file
/dev/rfcomm0
#speed at which to connect - might be worth trying higher...
115200
#this is needed so that a default route is added to your routing table
defaultroute
#this is needed so that you pick up Orange's DNS settings
usepeerdns

Next,

$ sudo nano /etc/chatscripts/vodafone-connect

and paste this BUT put your access point (again, this is for Vodafone Greece)

#from www.hingston.demon.co.uk/mike/nokia6680.html
TIMEOUT 5
ECHO ON
ABORT '\nBUSY\r'
ABORT '\nERROR\r'
ABORT '\nNO ANSWER\r'
ABORT '\nNO CARRIER\r'
ABORT '\nNO DIALTONE\r'
ABORT '\nRINGING\r\n\r\nRINGING\r'
'' \rAT
TIMEOUT 12

OK ATE1
#here's the magic bit!
#OK 'AT+cgdcont=1,"IP","wapkarta.vodafone.gr"'
# We found a better one that doesn't need a proxy and allows even ssh!
OK 'AT+cgdcont=1,"IP","webkarta.vodafone.gr"'
OK ATD*99***1#

and finally,

$ sudo nano /etc/chatscripts/vodafone-disconnect

# from www.hingston.demon.co.uk/mike/nokia6680.html
ABORT "BUSY"
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "\nSending break to the modem\n"
"" "\K"
"" "\K"
"" "\K"
"" "+++ATH"
"" "+++ATH"
"" "+++ATH"
SAY "\nPDP context detached\n"

9. Let’s connect!

First, check if the connection to your mobile is still up (step 7). If you don’t see

Press CTRL-C for hangup

connect to your phone again.

Now, the big monent!

$ sudo pon vodafone

starts the connection and you are online!

$ sudo poff vodafone

bring the connection down :P

10. Troubleshooting

Check /var/log/messages for problem when “calling your phone”.

If everything goes well you should see:

Jul 17 22:46:33 trinity pppd[9401]: PAP authentication succeeded
Jul 17 22:46:35 trinity pppd[9401]: local  IP address 10.2.116.125
Jul 17 22:46:35 trinity pppd[9401]: remote IP address 10.4.4.4
Jul 17 22:46:35 trinity pppd[9401]: primary   DNS address 210.239.17.10
Jul 17 22:46:35 trinity pppd[9401]: secondary DNS address 210.239.17.11

PS: Forget SSH unless you are ready for some tunneling

Also check this (great tutorial which I borrowed MANY stuff) http://www.lynchconsulting.com.au/blog/index.cfm/2006/12/11/Nokia-N73-Bluetooth-modem-with-Ubuntu-Linux-Howto

Comments (View)
Tue Jun 30

Erlang Factory and RainUp Project - Phase I

All I can say is: I am AMAZED by the Erlang community! Sadly here in Greece there isn’t an active Erlang community (but if your are interested in starting one, give me tweet at jonromero) even though there are some crazy Erlang projects (tidier/HiPE/Dialyzer) and some crazy researchers/developers.

All the presentations were inspiring (and most of them uplifting) but what was very strange was the bonding of the community. Guys (and girls) with great knowledge about distributed systems, hacking and expertise in the their field, were easy not only to be approached but also give share thoughts, business directions and discuss about everything (ranging from new BEAM features to “I love summer in Greece”). And of course Joe Armstrong is not only a great scientist but a VERY funny, inspiring and open-hearted person. We had great discussions with him during Speaker’s dinner (where he was ecstatic about us trying to run thousand of nodes for our project) but also bought us some beers the last day where we chilling out after the conference. What a great guy!

O’Reilly was there with 35% discount with books for Clojure, Python, Ruby, Software architecture and of course the Erlang Programming and Programming Erlang (with signatures of Joe Armstrong, Francesco Cesarini and Simon Thompson).

After having a GREAT time at the Erlang Factory and meeting with a lot of interesting and fun-to-be around people, it’s time to continue working on RainUp. We’ve uploaded some info here and you can download our presentation slides here (soon the video will be available from the erlang-factory.com ).

For our first phase we need to find some really interesting problems to start working on, so if you have any interesting algorithms please send us an email at contact@rainup.org.

We have some servers to start working on but we are still interested in more computing power (there is along way to infinity), so if you have a datacenter to spare or money to help us fund the whole thing, send us an email at contact@rainup.org

Comments (View)
Thu Jun 11

A quick hack for random numbers in Erlang

It seems that you can’t get random numbers in Erlang when you are in different processes. I am building a distributed Monte Carlo simulation and I wanted two random numbers for the x and y (of the dart). So, the only way to do it (if you want it to run in a cluster) is this (at least that’s what I’ve found).

{Seed1, Seed2, Seed3} = erlang:now(),
X = random:uniform(),
random:seed(Seed1, Seed2, Seed3),
Y = random:uniform().

Any suggestions / better implementations?

Comments (View)
Fri Apr 10
Awesomeness : Looking at your own code after a couple of days and thinking: “f*ck, I wish I could code like that By me
Comments (View)
Tue Mar 17

Between Erlang/Reia/LFE with Joe Armstrong - Erlang’s creator (or Building the Biggest Cloud ever!)

I love Erlang but for a couple of months I was wondering whether using LFE or Reia could speed up development (so other developers could jump in easily on an OpenSource project I am working on - read on for more about the project). Even though that Erlang is very powerful, it’s syntax is a deal-breaker for a lot of people. So, I thought that bringing developers from the world of lisp and Ruby/Python and showing them a similar (in syntax at least!) language could trick them make them give Erlang a shot. Boy, I was wrong…

Trying to write Erlang using the philosophy of other languages is like writing Lisp using a php mentality. Or better trying to eat spaggeti with a spoon. It just doesn’t feel right. You have to try Erlang, feel it’s core power and then try adding a layer on top of it. Writing software that communicates with it’s parts and expands easily, feels natural in Erlang. And a familiar syntax won’t save you from having to think in functional programming ways. Bottom line: Learn Erlang/Haskell and then try Reia/LFE to put some syntactic sugar. Sure that would bring many developers to the project…

But then, what’s the point of trying to move more languages to BEAM (Erlang’s VM)? I emailed Joe Armstrong (the creator of Erlang) about whether investing time and building your whole framework around a language wrapper is a sane thing to do. And here is his answer about LFE:

It depends on what you want to do - LFE is Roberts hobby project,Erlang has a entire Ericsson group supporting it. Erlang is battle tested in many industrial projects - If it’s a hobby project, then choose whichever you like if you want long-term support - go for Erlang.

And about Reia:

Same. Erlang OTP here to stay and supported by dozens of people and companies the others are hobby projects. (( I’m not being derogatory here - hobby projects are fine - but they have an uncertain future))
/Joe

That’s the result I came about, enhanced by the recent syntactic changes in Reia. These languages do a GREAT job in trying to bring more people to Erlang but I don’t think that you can use them without knowing Erlang (and I know that’s not their purpose but many feel that if you learn Reia there is no need to learn Erlang).

Of course, both Reia and LFE are very cool projects but I really wonder if they can survive the test of time and offer a nice alternative to Erlang (so they can pave the way for more languages in BEAM).

UPDATE: For those still reading:

How all this started?

We are planning (me and Jim ) to build the biggest cloud computing project man has ever seen and use it for scientific reasons (something like seti@home but BIGGER), that will fully utilize Erlang’s power and let it run on Clouds (Amazon / Mosso /…) and we are even thinking about trying to squeeze Erlang inside GPU and try a GPU cloud. It will be OpenSource, it’s called RainUp and  we already made a small presentation at mediacamp2 here in Greece. We’ll upload more info in a couple of days and some demos. So, as you can understand, choosing the correct language is crucial for our project. If you are an Erlang hacker or Cloud expert or just wanna help, send an email at: contact[at]rainup.org.

Thanks for reading and I’d love to hear your opinions here or at twitter.

Comments (View)