Linux, programming, computers and life

July 27, 2010

i finally got redirections in bash :)

Filed under: CLI, programming, linux

After all, redirections in bash are not that complicated:

dd if=000000000001eaaa.txt of=/dev/null bs=64 count=20 1>&2 2> dd.txt


Will do the following:
  • 1>&2 - redirect stdout to stderr (’&‘ is needed, otherwise ‘2‘ will be considered as file name)
  • 2>dd.txt - redirect stderr (which now contains stdout) to the file. 
Taken from this article. BTW, i’m not sure i really got it all fully and correctly :(

, , ,

May 27, 2010

Development for windows is so painfull..

Filed under: CLI, programming, c++, python

My task was simple - to create a script (mostly paths and file manipulations) for a friend. Hour or two of coding, and it was ready. I did it in python. Now, in linux - it’s easy - everybody has python installed and the script is regular executable file, same as emacs/evolution/firefox/etc.

But on windows… now i need the friend to install python. I thought it’s too much to ask and googled for compiler from python to exe. I found some stuff, but nothing that could pack the interpreter and the script in one executable (did i google enough?).

Then i decided to port it to C++. 2 hours of work, and the code finally compiles using boost and bloodshed c++ (kudos to their package manager which allowed me to install boost easily). But wait… it doesn’t link with some strange warning (which i google and i understand that the issue is boost is built with different compiler version).

OK, let’s install older boost, port the code, another hour - and then start to debug and understand that the most innocent and safe line causes core dump. C++ goes down the trash, uninstalled.

Next idea was to code in scheme and compile it, i learned scheme in the university some day long time ago, but that was difficult too. PLT-Scheme compiled some test program into executable that did nothing. Gambit-C did the trick but it did not contain several functions such as “sort” and debugging was more than painful (and i needed it, after all last time i touched scheme was around 10 years ago). Well, scheme went down the trash too.

Then i wanted to do it in haskell, but, i had no courage to do it :( .

Last idea was to use IronPython or Jython and compile them, and i even tried with IronPython,but i gave up after some tries.

Resolution: i hate to develop on windows and i’ll ask my friend to install python!

, , , ,

July 23, 2009

List of applications i use in Windows

Filed under: life

While my home computer runs ArchLinux, and my personal laptop runs Ubuntu, my work laptop has Windows XP installed. Here’s the list of apps i’m using there (those that i installed, not part of the corporate applications). Not surprisingly, they a all free software.

Launchy - great launcher
HandBrake - video and audio encoder
Vim - ’nuff said
Firefox - you all know what is it
TortoiseCVS - convenient CVS frontend
7-Zip - archive manager
Synergy - kayboard and mouse sharing
Smplayer - media player
MyPhoneExplorer - SE mobile phone management
UsefulUtils Disks Studio - burner
InfraRecorder - burner
WinSCP - scp for windows
Putty - telnet/ssh/… u name it

Any other alternatives i should try?

,

June 4, 2009

WinScp and putty integration

Filed under: internet

WinScp is an free scp replacement if you are using Windows. Putty is a free ssh replacement on Windows. Both allow you to save sessions for easy connecting to servers by session name instead of by IP.

Well, guess what, you can import all the saved sessions from Putty to WinScp. Here’s how. And it works!

, , ,

May 5, 2009

getting file system size in linux

Filed under: programming, linux

A reminder to myself, statvfs allows you yo get an information about a mount point, it’s probably what df uses.

, ,

April 13, 2009

getting amount of total/free memory in linux

Filed under: programming, linux

While you can always parse /proc/meminfo, there’s system call sysinfo which does the trick.

, ,

March 17, 2009

volatile methods in C++

Filed under: programming, c++

Wow, a feature of C++ i did not know, ‘volatile’ methods. Well, i’d say extremely rare one, but still.

March 9, 2009

sorting by certain columns in a file

Filed under: CLI, linux

I always knew that ’sort’ command has ‘-k N’ flag which tells to sort based on columns N,…. I just recently find out that this flag is even more versatile, and it can be used as ‘-k N,M’ which will sort based on columns N,…,M. As usuall, it’s in the man page, but i always missed it so far :) .

, ,

February 23, 2009

Shoelaces are not trivial

Filed under: life

Being almost 25 i discovered i do not know how to tie my shoelaces. If your laces come undone frequently, here’s something that will help you. Besides, there’re a LOT of different knots, i adopted that one.

December 2, 2008

Where are Linux distros for Eee?

Filed under: life, linux

I’m disappointed by choice of Linux distributions for my EeePc (called pingu). I installed Ubuntu EEE there which works, however, because of specifically built kernel, i cannot find/compile modules for VirtualBox which i really need. It looks like main stream distributions are Mandriva (which is supposed to work, but i personally don’t like it), EeeDora & Ubuntu EEE. There are a lot of smaller distros which all work partly on the Eee and require tweaking in order to make them usuable.
While i use ArchLinux at home, it’s too much work to install it on the Eee and maintain it working, i’d like to have something more stable and less attention requiring.

I do not intend to whine about open source software quality and choice, because i very much appreciate the choice, freedom of it and free time that a lot of people devte to it. I’m looking for advice.
What are you using on your Eee ;) ?

Update: ubuntu eee (temporary name) 8.10 will be released 1.1.09. Extremely exciting news!

, , , , , ,

Get free blog up and running in minutes with Blogsome
Theme designed by Gary Rogers