Pages

28 December 2012

raspi at work



I must admit that I am really, really excited about my raspi (raspberry pi). I ordered it three months ago and during all this time I have spent a lot of time thinking about the endless possibilities that such an amazing piece of machinery could offer.
I have installed a lot of applications from the debian archive, perhaps the most outstanding ones are the servers: ssh, ftp, http and gopher.
In the screenshot you can see the result of:
 $ lynx gopher://localhost
and the moment of writing this post.


13 December 2012

My raspi finally arrived!



This came as a complete surprise. Well I ordered it more than three months ago (On September 2nd to be exact) but now after thirteen weeks it is already here.
My surprise is due to the fact that I thought I would be notified by e-mail about the shipping but that didn't happen. Today I got home for lunch and it was there.
At the moment, I am downloading the raspbian (debian based) to boot this wonderful toy.
I'm publishing here one of the pictures I took but I'll upload some more later. One of them goes to my profile.


09 December 2012

Pou 4

Fourth week with Pou. I have reached level 50 (mission accomplished).


 

08 December 2012

Pencil holder

I got this pencil holder today scnr ;)


02 December 2012

multinput (Multiple mouse/keyboard input with xinput)


I have got a dual head main desktop. I always thought it would be nice to be able to use several keyboards and mice working independently. Today I learnt how to easily configure multiple input with xinput only to discover that my settings will always disappear after every reboot or logout.


Well, the logical next step was to write an script to automatically activate multiple input but since I also want to be able to deactivate it at will I wrote two parts "start" and "stop". So the usage goes:
 $ multinput start
or
 $ multinput stop
or
 $ multinput restart
The script can either be run automatically at startup (anacron comes to mind) or manually.
Note: Be warned that this script is for personal use only. Feel free to adapt it to your own needs. I hope you like it and that it is useful for you too.
Here it is:
#!/bin/sh

set -e

# Script for personal use, to set multiple mouse/keyboard input on "odd".
#
# It uses xinput, so read its man page for more info. In order to list your
# devices type "xinput list"

MOUSE2="PIXART USB OPTICAL MOUSE"
KEYBOARD2="AT Translated Set 2 keyboard"

usage ()
{
echo "Type 'multinput start' to use multiple mice/keyboards."
echo "Type 'multinput stop' to stop using multiple mice/keyboards."
}

start ()
{
xinput create-master multinput
xinput reattach "$MOUSE2" "multinput pointer"
xinput reattach "$KEYBOARD2" "multinput keyboard"
} 
# Leave devices floating.    
 stop ()
{
xinput remove-master "multinput pointer"
}

if [ "$1" = "start" ]
    then
        start
        exit 0
elif [ "$1" = "stop" ]
    then
        stop
        exit 0
elif [ "$1" = "restart" ]
    then
        stop
        start
        exit 0
else
        usage
        exit 0
fi

24 November 2012

Screenshot of the week 3

A beautiful screenshot of mrxvt with transparency over X11 forwarding through ssh with two open tabs: mc and tmux



Pou 3

Third week playing with my pou.



08 November 2012

Pou 2

I promised to upload some pictures of my pou as an adult. So here you are. By the way, I named it chuan.






31 October 2012

Pou

Pou is a little alien pet that you have to take care of, feed, clean and play with. It is available as an android app and it turns out to be one of the most highly addictive games ever. I leave here some screenshots playing, eating, sleeping ... If I can keep it alive and it grows older I will publish some more pics.









20 October 2012

Welcome xana



At the moment of writing this post, I'm installing debian sid in my new laptop. Its hostname is xana, this name makes perfect sense because sid is considered the bad boy and so is xana in the Code Lyoko series. I also added it to my profile.
It is a lenovo. I saw it at the computer store and I just couldn't resist. An impressive machine with an excellent price. Besides, I had been meaning to get one of these for a long time.






In order to install it I tried the Beta 3 netinstall 64 bits but it complained that it was unable to read the files from the installation media. I tried the same Beta 3 but for 32 bits and it worked like a breeze. The debian-installer defaults to wheezy so I have only installed the base system and when done, I have edited /etc/apt/sources.list to add:
 deb http://http.debian.net/debian/ sid main contrib non-free
And as usual apt-get update and apt-get dist-upgrade. Everything goes very fast if you have a good internet connection.
Now it has finished upgrading to sid, see? that was fast ;)
The final step for me is:
root@xana:/home/chals# apt-get install xfce4 && apt-get clean
And of course, I'll also have to install and configure other software like for example xfce4-goodies but I will have plenty of time tomorrow. It'll be Sunday and it is raining cats and dogs, so ...
Note: Do not think that I'm cheating because I have already published a picture when the graphical system is still not up and running. I booted the machine first using a debian-live usb stick to see if everything worked out of the box (in case I should need to load any firmware), but I didn't have to worry about that. Everything works just fine.


06 October 2012

Hacker's keyboard for android


Yeah, an absolute must have if you need a real keyboard on your android device. I had been looking for such a keyboard for a long time since I bought my phone. And I tried several of them but none comes closer to Hacker's Keyboard.
Some other keyboards have additional keys like AltTab or Esc but they do not work very well. They are useless, so to speak. This one has them all, function keys and even Pgup and Pgdn. Now I simply can't imagine using my android devices without it. Thank you guys.
Their website is here

27 September 2012

A fantastic shell account at sdf-eu


I have not really written very much about sdf-eu yet. As far as I can remember there is just one post named sdf-eu and a couple of posts named sdf.
Well, probably the reason why I have not written much about it is that I spend a lot of time at it.
It is true. I log into my shell account at sdf-eu every single day. The reasons for doing that are countless and if you want to know more about it you will definitely have to visit sdfeu.org, make an account and see for yourself.
All I can say is that having a shell account at sdf-eu is a fantastic thing to have.
What I do there everyday:
  • Learn from practice and experience about *nix operating systems.
  • Use tmux to have several processes running at the same time.
  • Use irssi proxy to get in touch with computer savvy people.
  • Electronic mail.
  • Use gopher and keep a phlog.
  • ssh into other servers.
  • Bridge connections from my house to my flat.
  • Read and write on the bboard.
  • Create and edit files.
  • Have a mirror of my website.
  • Browse the web, use ftp...
  • And so on and so forth...
The list of things that you can do is not limited to the few examples I have just included here. There are many more things that you can do but it is very difficult to explain it to someone who can not even imagine what this is all about.
I sometimes like to think of sdf-eu as an interactive shared server, but again if you can read my enthusiasm from between the lines you will realize that, even again, it is much more than that. It is like a family :-)
<3 u all guys :-p

16 September 2012

Rubik's mirror cube solved

Today I managed to solve this awesome cube my sister and nephew gave me as a present. It was a real challenge but I succeeded :-p


03 September 2012

RasPi


Yesterday I ordered my first Raspberry Pi. I say my first because ever since I discovered this cute little invention I said I'd (and I intend to) buy two. But for the time being, and also with the idea in mind of running some tests to see how it works and how many things I can do with it, I just bought one.
It is going to be powered by debian. I read there is a debian derivative called Raspbian which was especially designed to work with the RasPi. So I'll have to give it a try. Besides it is the recommended operating system by the Raspberry Pi Foundation.
But to tell you the truth, even though Raspbian might be ok to begin with, I will replace it by a pure debian installation. I do not need the graphical interface provided by Raspbian. I just need a basic debian system with some servers installed.
I intend to use the little RasPi as a micro server of several things, gopher, http, an irc bouncer... but who knows? I still need to see how far one can get with such a tiny machine. To begin with its low power consumption makes it ideal to run 24/7.
The downside is that it costs a little bit more than expected (even though this should be expected) It costs 27€ but once you have paid for the case, the power supply and the expenses you need to spend 52€ (more than that if you have to buy some extra stuff like cables, memory card...) but well, I think it is worth it. The worst thing is having to wait for 13 weeks until the order is processed plus one more week (own estimation) to arrive home.
Note: I'll publish some pictures when I finally get it.

26 August 2012

My live


I have been procrastinating for a couple of weeks but I couldn't wait anymore. Today I created a git repository to store an initial configuration to build a live system based on debian.
The idea sprang from a new feature offered by live-build one of the tools created and maintained by the Debian Live Project.
This config creates a very generic graphical desktop using xfce with some additional packages and a live-installer to install the contents of the live system. It also makes use of the persistence feature to store some files.
And as the description of the repository says, it is yet far from perfect, as it is pretty much unfinished. It is just an exercise to create an update for my live-server which will be available some time soon.
The repository is located at https://gitorious.org/mylive
In order to build the image, you only have to take three really easy steps:
 $ mkdir live-system && cd live-system
 $ lb config --config git://gitorious.org/mylive/mylive.git
 # lb build
More information can be found on the live-manual
Enjoy!

09 August 2012

debootstrap


If you have ever used a unix/linux system you probably know about the chroot command. I have several testing chroot directories in my debian systems but I had never really taken advantage of such a great tool as debootstrap is, at least consciously.

This week I installed sid in a chroot in wheezy and I'm really enjoying the fact that I can play with it as much as I need to without risking breaking things badly.

I heard (on the net) that lxc are even better. I quote:

  described as “chroot on steroids”


I once tried installing a container in wheezy but I didn't succeed, I'll try again at the weekend.

29 July 2012

poic and poo


I published this script I wrote for personal use several weeks ago in my gopher hole concretely in the phlog but I decided to include it here under the scripts tag for an easy reference.

Credits go to Robby for his extraordinary suggestion of:

 "This .po file is 'poo'"

I must confess I'm still laughing at it every time I think about it but hopefully I will not get that message very often.

Here is the script:

(As you can see the usage is:  ~$ poic file.po)


 #!/bin/sh

 # 'poic' stands for Po Integrity Check

 msgfmt --verbose --check --output-file=/dev/null $1

 if [ "$?" -eq "0" ]
 then
      echo ""
      echo "This .po file is 'good': $(echo $1)"
 elif [ "$?" -ne "0" ]
 then
      echo ""
      echo "This .po file is 'poo': $(echo $1)"
 fi


A friend of mine, skizzhg, proposed this alternative version and renamed it to 'poo':
 #!/bin/sh

 if [ "$1" = "" ]; then
    printf '%s\n' " Po Integrity Check"
    printf '%s\n' " No file specified. Usage: poo <file.po>"
 else
   msgfmt --verbose --check --output-file=/dev/null "$1" && \
   { printf "\n This .po file is 'good': $1 \n"; } || \
   { printf "\n This .po file is 'poo': $1 \n"; }
 fi
I think that skizzhg's version is cleverer than mine and also more complete because it includes information about the script and usage notes.
If you think that 'poo' is not a very nice name be aware that it could perfectly stand for "PO Officer" ;-)
Thank you very much skizzhg. You rock!


Another friend proposed this other version. Let's call it poo2 (His suggestion)


 #!/bin/sh

 if [ -z "$1" ]; then
     echo ' Po Integrity Check'
     echo ' No file specified. Usage: poo2 <file.po>'
     exit 1
 fi

 if msgfmt --verbose --check --output-file=/dev/null "$1";then
    status=good 
 else
    status=poo
 fi
 printf "\n This .po file is '%s': %s \n" "$status" "$1"
Thanks :-)

17 June 2012

Sun clock


Today I have visited the biggest sun clock in Europe, even though some say it might be the biggest (one-piece) sun clock in the world. It is possible!!!

It was built in 2010 and It is just an hour trip away from my house (by car) but I had never been there until today. Well it is at least a very curious thing and worth visiting in my opinion.

I hope you like the pics.



12 June 2012

Scrobbling in the free world.


Thanks to retrospectacus' time and great Debian skills and savoir-faire we can now scrobble through libre.fm which means that we can share the music we love and listen to with everyone else in the whole world.

Thank you, you rock (and roll) ;-)

03 June 2012

'pharc wiki' and 'pharc in action' screenshots


This afternoon I have finished pharc's wiki. It is a work in progress but for the time being it is ready for publishing. You can find it here:

Pharc wiki

Perhaps the only thing that is missing there is a series of screenshots showing how pharc works. I'll upload them here first.

First pharc checks to make sure that the working directory exists, otherwise it exits.


Second if the Archive already exists pharc quits to avoid overwriting files.


If there are no posts to archive, it exits.


And finally if successful:




After it's done, if pharc suspects that something didn't go as expected it will print:

~$ Maybe unsuccessful. Please check it out. If things broke badly there is a backup of your gophermap --> gophermap~


You can see the results of pharc in my gopher hole:

gopher://sdf.org:70/1/users/chals/phlog

or browse it on the web through a proxy:

http://gopher.floodgap.com/gopher/gw.litegopher://sdf.org:70/1/users/chals/phlog

13 May 2012

Birthday calendar 2012

It has almost taken half a year to complete but now it is finished, as of Friday.

03 May 2012

09 April 2012

Easter Monday 2012

On Easter Monday we celebrate the equivalent of the Easter Bunny and Eggs thing in the region where I live.

We call it "Mona's day", the mona being a typical cake we prepare for the occasion. Here there's a picture of this year's.

04 April 2012

Git on Dropbox

The idea had been running round in my mind for some time. I move from one computer to the other all the time. Usually up to four different machines in the same day. I can never know or be sure of where I'm gonna be when I need to make a commit to one of the five git repositories I work with.

Ideally I should have all my information centralised in just one single place. This makes it easier to work with certain types of files, but it also makes it easier to have security issues and/or risk of data loss (even if you backup on a regular basis you are never ready for a hard disk crash or any other undesirable occurrence).

So as you can guess I used to have several clones of the repositories and I had to pull several times to keep them up-to-date. Not very handy :-(

I read that some people used their Dropbox folder to have git repositories. And well, as you can imagine I just had to try it... :-)

So far I have just moved my blog's git: chals.branchable.com I made a commit from my laptop and now I'm writing this post and about to commit from my desktop. If it works fine, I'll move all the other repos.

Fingers crossed...and push! :-P


01 April 2012

Fortune

The fortune plugin inserts a fortune cookie into the post:
 
Blast medicine anyway!  We've learned to tie into every organ in the
human body but one.  The brain!  The brain is what life is all about.
        -- McCoy, "The Menagerie", stardate 3012.4

31 March 2012

Branchable 2

In a previous post I showed you why I love Branchable so much. There you could see how using a web browser and some minimal markup (i.e. markdown) you could easily create great posts.

The truth is that I really love Branchable ever since I discovered it. But one of its real powers lies in the fact that it uses git as VCS. This means that you can edit your files locally with your favourite text editor (nano, vim , gedit...) type what you want and then simply commit your changes to the repository. You do not need to use your mouse at all. As you type, you can add the markdown features that you prefer as in the examples below:

Using asterisks ( * ) you put words in italics like this

Using number signs (#) you can emphasize text like # this

this

And many many more. Check this out:

(: - P) turns into :-P

Well if I'm not wrong I promised to show you a bit how it works. I'll take some screenshots.

This is how you add images:

( [ [ !img branchable.png align=center size=400x500 alt=branchable_nano ] ])




This is how you create a tag:

( [ [ !tag screenshots ] ] )

And when you are ready you simply follow the drill:

 $ git add .

 $ git -a -m "Showing how cool branchable is."

 $ git push
 
And there you are! Enjoy!

28 March 2012

IRC Bouncer 2

If I tell you that I have changed my irc bouncer service but however I haven't changed my server you might well think that I'm going nuts. Well, while the latter might still hold very true, I have to tell you that I have been a user of EliteBNC for a couple of months now since they opened for business.

I was very happy with GeekBouncer but since the guys decided to split partnership I decided to stick with the server I had previously been assigned to. It is very stable and reliable so the choice was very easy to make.

EliteBNC's service is excellent, the user support is great and the guys there are awesome. What else can I say?

If you are interested, please take a look at their website:

http://www.elitebnc.net

or join #EliteBNC on Infinity-IRC

Enjoy!

;-)

26 March 2012

Syntax highlight: nano vs. vim

Syntax highlight is of course configurable so that you can use the colours you prefer or like the most. In both nano and vim you have to activate it, otherwise you do not have syntax highlight straight away like you have in other editors such as gedit.

It is not my intention right now to explain how syntax highlight is activated in any of those text editors. I'm just publishing here a screenshot that shows why working with colours enabled is better. On the GUI I always use gedit. On the CLI I use both vim and nano but I think that nano is both easier to use and nicer. This is the syntax highlight I get for po files. I definitely prefer nano's colours.

This will be the screenshot of the week.

11 March 2012

Spongeboblish

For all SpongeBob Squarepants fans out there:

My drinking glass

18 February 2012

Installing Wheezy on my eeepc 701

My eeepc 701 4G has been with me since 2008 each and every single day giving me the best of what it's got. No wonder I love it so much.

I have tested Wheezy on it for a whole week using a custom built debian-live image (without installer). It works flawlessly using full persistence. The only problem is that everytime I turn on the machine I have to reinstall Dropbox because it does not seem to work fine with cow (This is just a wild guess. The problem might be anything else.)

This afternoon I'm going to install Wheezy on a mini sd flash card of 16 GB I bought yesterday using the regular debian installer. The procedure is quite simple.

1.- Wipe grub from the master boot record of the usb stick I'm going to use as installation media. (This is just because I have been playing with siduction on that usb pendrive for a couple of days. It boots the iso using grub.)

  # dd if=/dev/null of=/dev/sdX bs=446 count=1 # X is the device letter
 
2.- Download the debian-testing-i386-netinst.iso (227M) and dd it to the pendrive:

   $ dd if=debian-testing-i386-netinst.iso of=/dev/sdX
 
3.- Boot the eeepc from the usb pendrive. Select expert install and there you go!!!

10 February 2012

New linux counter.

http://counter.li.org/ is going to be replaced by http://linuxcounter.net/ I already transferred my account from one place to the other and updated my machines information. This is the new image signature I got: https://linuxcounter.net/cert/388768.png


In case you can't follow that link for any reason. I upload the image here as well.

07 February 2012

nvlc - ncurses vlc

Last week I discovered nvlc installed on one of my Debian laptops. It was in fact installed in all my Debian boxes. I scratched my head at first because I didn't remember ever having installed it and what is more, I discovered that it isn't even a package. It comes with vlc player.

Well, I played with it for a while just to find out that with nvlc you can do almost everything you do with vlc. It can for instance, write to the framebuffer so you can watch video. What is more, having a curses interface makes it easy to use. It was nice and that was it. However today I thought about a great use that I can give to it.

I'm right now sitting at my eeepc *yumi*, but my music collection is in my main desktop *odd*. From here I ssh into the box and launch *nvlc*. Then I can select the songs I want to listen to, raise the volume and do other things, as if this small netbook were  a remote.

Awesome isn't it?. nvlc, welcome to my pool.

Here is a screenshot:

05 February 2012

Minimal desktop.

This weekend I have been configuring a rather small, relatively minimal desktop using openbox. I have also installed a bunch of applications to work with this gorgeous window manager. Among them: gmrun, wbar, tint2, conky ... I have also set Midori as default browser. In my first tests I installed rox-filer, but since I intend to thoroughly try rox desktop someday I removed rox-filer and I left the good old midnight commander as file manager.

I need to remember (for future reference):
  • Openbox: create .config/openbox/autostart file (nm-applet and all other apps. Launch wbar -pos < top >)
  • Edit wbar /usr/share/wbar/dot.wbar (icons and commands)
  • gmrun: Edit openbox keybindings in .config/openbox/rc.xml

     <keybind key="A-F2">
        <action name="Execute">
        <command>gmrun</command>
         </action>
      </keybind>
    
Here is a screenshot for you to sneak a peek (Screenshot taken with scrot):




29 January 2012

New gpg key.

My current gpg key (hosted on a pgp server) expires tomorrow. I created if for a year because I didn't know if I was going to use it at all or not.

To tell you the truth. I have never used it, at least that I remember. Anyway, I think that having a key is very handy and it does not do any harm. I think I should start using it in my e-mails.

This new key does not expire and it is hosted at

hkp://keys.gnupg.net

You can also find it in my Profile

08 January 2012

pharc v 2.0 released.

Today I released pharc 2.0. pharc is a script that organizes your phlog posts on a yearly basis.

pharc is based on mkphlog written by octotep. The reason for releasing v 2.0 is that mkphlog has been updated to v.0.2 so I needed to adapt my script to the changes.

You can read my phlog post on the release of mkphlog v.0.2 in my phlog here (gopher link)

You can read my phlog post on the release of pharc v.2.0 in my phlog here (gopher link)

pharc is version controlled using git. You can find the script v.2.0 here

If you're interested in the .deb package it is available in two places:

a. In my gopher hole (gopher link)
b. here: pharc 2.0-1 all.deb


The changelog is:
  • Updating for mkphlog v.0.2
  • Adding version number 2.0
  • Adding license (2012)
Enjoy!!!

04 January 2012

To .deb or not to .deb, that's the question...

Hey, what did you expect? I'm a poet, not a coder ;)

This short blog post is just to inform you that I am writing a new tutorial on how to build a .deb package in just five minutes with equivs

03 January 2012

My first .deb

\o/ Today I built my first debian package or .deb

I wrote the source code of the package myself. You can find the main script here. It is a simple script to archive phlog (gopher blog) posts on a yearly basis. I called it pharc which stands for phlog archiver. It is based on the mkphlog script, written by octotep, that I use to build my own phlog

It takes a little bit of work, then

    $ debuild -us -uc

And voilà! you can find the package here:

pharc 1.0-1 all.deb

Important: This package was built for learning purposes only. It has some limitations I am perfectly aware of. Just to name a few:
  • The script assumes that you have a link in your $HOME/gopher to your gopher server. And that all your posts are in directories named $(date +%m-%d-%y)
  • The makefile is ridiculous. It only has seven lines! I wrote it in 25 seconds just to experience quick success. Now if you're really curious I can paste it here or somewhere else.
  • The complete list of files is not available online. They are stored on my server but if you want them you can ask for them. Here is the list:

    pharc_1.0.orig.tar.gz
    pharc_1.0-1_i386.changes
    pharc_1.0-1_i386.build
    pharc_1.0-1_all.deb
    pharc_1.0-1.dsc
    pharc_1.0-1.diff.gz
  • Who uses gopher or keeps a phlog anyway?

01 January 2012

'pharc' a phlog archiver.

I write my phlog using a script called mkphlog. It creates each phlog post in the form of a directory using the following variable: entrydate=date +%m-%d-%y
I started my phlog in October so there were not many posts. However, reaching the end of the year made me realize that I had to devise a way to archive all the posts on a yearly basis. Doing it by hand took me approximately 10 minutes. It basically means copying a bunch of directories into a single directory and editing the gophermaps so that the servers know where to look for files once the links are clicked.
But as you can imagine I am a busy person and I just can't add any more thing to my todo. So I decided to write a script to do the work for me automatically every year. Isn't that fantastic? Well it didn't take long to write a first functional version of the script. However, like all scripts, it was open for improvement.
This afternoon I have improved it a bit and I have committed what I imagine is the final version as of now. You can see it here
By the way, the title of this post is self explanatory enough. I called it pharc which stands for "phlog archiver". It would be very nice that someone tested it and found it useful.