Linux, programming, computers and life

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!

, , , , , ,

November 16, 2008

proud eee owner :)

Filed under: life

Thanks to my fiance, I’m now Eee 1000 owner. It’s so cute, i like it a lot :) . The question, what Linux distributive should i install there?
I have Arch on my desktop, and i love it, but I’d like to get something ready for Eee out of the box. Currently, the best solution looks Ubuntu Eee, but i’ll probably look for more options.

, , ,

November 8, 2008

overflow in shell script

Filed under: CLI, programming, linux

Overflow in shell script… while it sounds strange, it actually happened to me :) . I have a script which does recoding of mp3 files in order to reduce bitrate and space those files take. I tried to be smart and first detect the bitrate in order to avoid redundant recoding. Well, my script actually worked for a long time, but then it refused to recode file with bitrate 256 ;) .
It was my fault of course. In order to determine the bitrate, i used the following ash function:
# function to determine bitrate:
# expects a file as parameter
determine_birate() {
    if [ -z “$1″ ]
    then
        return 0 # invalid
    fi
   
    if [[ “${MP3INFO}” == “” ]]
    then
        return 1 # invalid
    fi

    return `”${MP3INFO}” -p “%r” “$1″`
}

MP3INFO is an application i use in order to read mp3 files meta data. Well, when the bitrate was 256 i got 0 returned, i guess bash has some limit of 1 byte somewhere :) . My quick fix was (and now it works great):
# function to determine bitrate:
# expects a file as parameter
determine_birate() {
    if [ -z “$1″ ]
    then
        return 0 # invalid
    fi
   
    if [[ “${MP3INFO}” == “” ]]
    then
        return 1 # invalid
    fi

    echo `”${MP3INFO}” -p “%r” “$1″`
}
….
CURRENT_BITRATE=`determine_birate “$file”`

, , , ,

October 23, 2008

synergy2 is incredible

Filed under: life

At work, i have both laptop (sadly running Windows XP) and Linux station which is used for development. I got tired of working with 2 mice and 2 keyboards, and the hardware switch wasn’t available. And then, a friend suggested to use synergy2.
It’s so simple to use, it’s incredible. And it just works. It allows you to use one keyboard and mouse for several computers. Keyboard focus just follows mouse focus. I have now one virtual screen which i constructed from my workstation and laptop screens.
In order to make it work, i needed only  to create small configuration file and run server application on Linux and client on Windows. Here’s that file, it’s self-explanatory:

section: screens
  station_name:
  laptop_name:
end

section: links
  station_name:
    left = laptop_name
  laptop_name:
    right = station_name
end

,

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