Debian/Ubunto notes

How to save and installed packges

$ dpkg --get-selections > /backup/installed-software.log

# dpkg --set-selections < /backup/installed-software.log

Now your list is imported use dselect or other tools to install the package.
# dselect

Select ‘i‘ for install the software.

Upgrade Debian


cat /etc/debian_version

Fix the W: There are no public key available for the following key IDs:


apt-key update

gpg –keyserver –recv-keys XXXXXXXXXXXXXXXX
apt-key add /root/.gnupg/pubring.gpg
apt-get update

debian tracd initscript

Trac startup script.

Continue reading

Back to the crack scene

I have cracked one bulgarian software for window

Continue reading

Bulgarian stopwords

I want to start such a list so I will become maintain a Bulgarian list here which I will use for my website

As a base source I will use this list here

Please submit your suggestions.

Note: I have removed a lot of words from the starting list.

 Continue reading

Javascript in the

Wow. What a nice idea.

Note: if you want to make the test.html to work checkout and test on http://… it is some beta but it works great only in Firefox

Thumbnail for a webpage

My colegue bl8cki is real fan of making screenshots from web browsers. Those days he tries the python solution. And today he surprised all with one very nice firefox plugin

With this plugin you can use firefox with some command line parameters to make screenshots.

Here is how we will use it

  1. start the xvfb
    mkdir /tmp/tmpfbdir
    Xvfb :1 -ac -screen 0 1600x1200x24  -fbdir /tmp/tmpfbdir

  2. run the firefox
    firefox-2 --display=:1 --no-xshm -height 1024 -width 768 -savepng

Windows solutions h


Multiplatform – I cant manage to compile it:



Another Linux/Ubuntu way:

aptitude install xvfb  xfs xfonts-scalable xfonts-100dpi libgl1-mesa-dri  subversion libqt4-webkit libqt4-dev g++
svn co
cd cutycapt/CutyCapt
xvfb-run --server-args="-screen 0, 1024x768x24" ./CutyCapt --url= --out=example.png
xvfb-run --server-args="-screen 0, 1024x768x24" ./CutyCapt --url= --out=example.html --out-format=html

Random images helper for Rails

Here is how to make random images generation for your website.

First you must put your images in a folder /public/images/random_images or what ever.

Second you put images there and mark the filenames with a prefix, which image to which section will be visible on.

index_bottom_1.jpg -> for the index page on the bottom :)

index_bottom_2.jpg -> for the index page on the bottom

featured_art_1.jpg -> some panel.

featured_art_2.jpg -> some panel.

and so on…

Paste this method in your base controller. This method will be called to make list for a specific image folder and “filter” the images that are supposed to be showed in the different regions in @variables.

  before_filter :init_random_images
  protected # :) be carefull for this if you copy paste
  def init_random_images
    # collect some static images
    web_root = "images/imagestorage/random_images"

    all_images = Dir["#{RAILS_ROOT}/public/#{web_root}/*.jpg"]

    @random_head_images = []
    @random_indexbtm = []
    @random_featured = []
    @random_sales = []
    @random_services = []
    @random_framing = []
    @random_artistcollection = []
    all_images.each do |f|
      if File.stat(f).file?
        @random_head_images << ("/#{web_root}/" + File.basename(f)) if f =~ /head_images_/
        @random_indexbtm << ("/#{web_root}/" + File.basename(f)) if f =~ /indexbtm_/
        @random_featured << ("/#{web_root}/" + File.basename(f)) if f =~ /featured_/
        @random_sales << ("/#{web_root}/" + File.basename(f)) if f =~ /sales_/
        @random_services << ("/#{web_root}/" + File.basename(f)) if f =~ /services_/
        @random_framing << ("/#{web_root}/" + File.basename(f)) if f =~ /framing_/
        @random_artistcollection << ("/#{web_root}/" + File.basename(f)) if f =~ /artistcollection_/

Then paste this as a helper or in the base controller, to use it in your views. The method will give you from the images array, count number of images.

  helper_method :get_random_image
  def get_random_image(images, count)
    requested_images = []
    images_copy = images.clone
    [images_copy.size, count].min.times do
      index = rand(images_copy.size)
      requested_images << images_copy[index]

here is an example how to use it.

<div id="static_logo" style="background:url(<%= get_random_image(@random_sales, 1) %>) no-repeat scroll left top;">

Future optimization

Put some caching, not to make


on every request.

10x Bl8cki to the nice code optimizations :)

Vim vim vim

I cant live without vim. Today is the day I understand this and have install vim on my home windows:) I hope that no one will start it accidently.

Ok. Here i will keep track of the commands that I use in vim.

configuring vim and nice screenshots tutorial

Here is more on the topic

  • Open many files in tabs:  vim -p file*
  • Search & Replace:  %s/something/nothing/g
  • cntrl-space in vim is: cntr-n /  cntrl-p
    load words from all pl/pm files: ctags *.p?
  • windows: :split / :vsplit
    cntr-w – switch
  • tabs:
  • set tabstop=2
    set autoindent
    << >>  size is controller:


Keyboard Shortcuts:

do – Get changes from other window into the current window.

dp – Put the changes from current window into the other window.

]c – Jump to the next change.

[c – Jump to the previous change.

Ctrl W + Ctrl W – Switch to the other split window.

Copy checkboxes from one form to another with Prototype

I have a case where the user must select items from a basket and use them with different forms.

Some items in this form
  • Item:
  • Item:
  • Item:
  • Item:
Another form here
(I will create here hidden fields from the the checkboxes in the first box)

I will show you how to use the checked boxes from the first form with the submit action in the second form

It would be easy if the form could be one – less support.

I am starting with those two forms

  • Helper form – Form with checkboxes
  • Action form – the form that will do the real action based on the selected items in the helper form

Here is how it looks the helper form. All the checkboxes are tagged with the class=”selectable”. Here is rails example but you can implement it pure html.

<%= check_box_tag('selected[]', true, image.selected?, :class=>"selectable") %>

Then we can select all the checkboxes with this javascript.

var make_to_hidden = $$('input.selectable');

Put on your action form an id so we can access it easy in this case:

<form id="mail_form" onsubmit="import_selected_basket()"> ... </form>

Lets add those checkboxes from the first form to the real action form with this javascript function

      function import_selected_basket() {
          var make_to_hidden = $$('input.selectable');
          make_to_hidden.each(function(item) {
              if (item.checked) {
                var new_item = new Element('input', { 'type': 'hidden', name:, value: item.value })

Rails conf 2008/6/2

Its aways nice to know whats going on in rails field

Whats new for me was flog:


Some more video links

© 2020 Gudasoft

Theme by Anders NorénUp ↑