Why Tmux is Better

I used to use screen. Now I use tmux from time to time. I also use extensively the tmuxinator which allows me to create many different tmux panes, with different command running in each one.

Personally I’m not really sure that tmux is so much better then screen.  I think it’s worth to know both.

So, tmux has a better codebase and has (nearly, more on that later) all the features screen has – but chances are high that you are not interested in the code at all, so why should you care? Because tmux has a lot of features that screen has always been missing.
link

Copy and Paste in Console

This is a great example of why you should not copy any text from a website, and paste it to a console.

I tried that once, and learned that this kind of copy and paste can be really destructive. Since then I always open a gedit window, copy from web, paste to the editor window, check the text, and copy it from the window. That’s a little bit longer, but I really like the data on my disk.

Protecting a Laptop from Simple and Sophisticated Attacks

A week ago in Poland was quite funny case when someone bought a new iPad. When he got back home and turned it on, he noticed that it is fully configured for someone else. In fact it was a used laptop, the previous client bought it, but after a couple of days replaced it with a better one. He returned the older to the shop with all the data, passwords and logins inside. When the new client contacted him, he asked him politely to log out of all the opened application.

A worth reading list of things you can do to make your data secure. Usually data stored in a laptop are worth much more than the laptop itself, unfortunately people usually take care of the laptop, not the data.

So, keep your data safe. When someone steals your laptop, he should just have the hardware, not the data.

My most likely adversary is the common thief. If my laptop is stolen, I want a chance to recover it, that doesn’t involve relying solely on the police. Although the laptop came with Windows 7 installed, I had no intention of using it; Ubuntu is my current operating system of choice for laptops/desktops. Rather than wiping Windows 7, I’ve left it as a honeypot operating system.

Quite nice list of things to do

Speeding Up Generating Data in Postgres

I had this stupid idea for quite a long time. PostgreSQL has the COPY command. It is really fast and it is the best way to load CSV like file to the database. So I had an idea: what about not creating an SQL query from an ORM object, but instead generate a CSV file, and load it using the COPY? Of course it doesn’t mean creating the whole huge file, and loading this later. You can always just generate one CSV row, and load it using a pipe to the psql process.

I described the idea at the End Point’s Blog, and it seems that it can speed up loading things even 5 times.

A Very Nice Summary of the Best Haskell Features

Learning Haskell is hard, but it is really profitable. Haskell is not another boring functional thing. Yea, I know, you can write functional code in Python too. Haskell is just different.

The main great thing about Haskell is that it is so different from the rest of the languages I use, that it really affects the code I write, and the way I think about writing and structuring programs.

Below is a very nice summary of why Haskell is worth using.

Haskell gets static typing right

Statically typed languages are often seen as a relic of the past – old and clunky. Looking at languages such as C and Java, we’re used to writing down a lot of information in a program that just declares certain variables to be of certain types. And what do we get in return? Not all that much. Yes, granted, some errors are caught at compile time. But the price is high: we’ve cluttered up the code with noisy declarations. Often, code has to be duplicated or written in a more complicated way, just to satisfy the type checker. And then, we still have a significant risk of run-time type errors, because type casting is common-place and can fail at unexpected moments.

So it isn’t a big surprise that dynamically typed languages are now very fashionable. They promise to achieve much more in less time, simply by getting rid of static type checking.

However, I want to argue that we shouldn’t be too keen on giving up the advantages of static types, and instead start using programming languages that get static typing right. Many functional languages such as Scala, F#, OCaml and in particular Haskell are examples of programming languages with strong static type systems that try not to get in the way, but instead guide and help the programmer.

Haskell gets static typing right.

How Not To Build Community

I’ve been working on a Postgres patch. I’ve created that, there were many errors of course. Some of them were made due to my bad knowledge of the Postgres internals; some because of not knowing some internal Postgres conventions; some just because I made an error.

That’s why I asked a lot of questions, and that patch had almost ten versions. I couldn’t do anything with that if the more experienced people wouldn’t help me. When I asked a question, they just answered me. When I made a mistake, they just informed me, showed me the problem, described it and showed some examples of how this should be done.

Yea, this is the way it should be done. This way I really like those people, and I will be working on some more things for the Postgres project. I think it will attract more and more people who wouldn’t be afraid of showing there not too perfect patches.

On the other hand they could react like Linus did. I’m sure that if a new commiter would get such a welcome reply, then he would never show up again. Instead of saying ‘goodbye’, he will be looking for some other community. This could be a huge loss for the project.

Postgres as NoSQL Database With Validation

I’ve written a blog post about PostgreSQL used as NoSQL database with serious data consistency checks. To my big surprise, this simple blog post has drawn huge attention, and has been cited in many places.

This is a kind of another reason why I’m getting back to my idea of writing a book. I stopped thinking about that, as many things are too simple and too obvious for me, so I think they are not worth writing about. The above blog post is also about some obvious things, but I see that many people are interested in that.

I need to rethink my book ideas. Any help is wellcomed.

thinking, databases, security, programming and other IT something