Impossible is nothing

Increment all serial numbers at once for bind

Increment all serial numbers at once in a named/bind dns zone file.
Just run the script in the current directory /etc/bind/namedb and all serial numbers will be incremented by one.


Dir.glob("*.db") do |file_name|
  new_zone = [] do |file|
    while (line = file.gets)
        if line =~ /Serial/
          line =~ /(\s*?)(\d+)(\s*?)(;.*)/
          serial = $2.to_i
          serial += 1
          puts "#{file_name} serial line:  #{$1} #{$2} #{$3} #{$4} -> #{$1}#{serial}#{$3}#{$4}"
          line = "#{$1}#{serial}#{$3}#{$4}"
        new_zone << line
  new_zone << "\n", "w") do |new_file|

Benchmark memcached for reading different variables

require 'benchmark'
require 'ostruct'
Rails.logger.level = 1
n = 100000 do |x|"10 variables") do
    a, b, c, d, e, f, g, e, h, m = [1, 2, 3, 4, 5, '6', '7', '8', '9', '10']
    Rails.cache.write('a', a)
    Rails.cache.write('b', b)
    Rails.cache.write('c', c)
    Rails.cache.write('d', d)
    Rails.cache.write('e', e)
    Rails.cache.write('f', f)
    Rails.cache.write('g', g)
    Rails.cache.write('e', e)
    Rails.cache.write('h', h)
    Rails.cache.write('m', m)

    n.times do
      a ='a')
      b ='b')
      c ='c')
      d ='d')
      e ='e')
      f ='f')
      g ='g')
      e ='e')
      h ='h')
      m ='m')
  end"hash with 10 variables") do
    hash = {
      'a' => 1,
      'b' => 2,
      'c' => 3,
      'd' => 4,
      'e' => 5,
      'f' => '6',
      'g' => '7',
      'e' => '8',
      'h' => '9',
      'm' => '10'
    Rails.cache.write('hash', hash)

    n.times do
      hash ='hash')

  end"array with 10 variables") do
    array = [
      ['a', 1],
      ['b', 2],
      ['c', 3],
      ['d', 4],
      ['e', 5],
      ['f', '6'],
      ['g', '7'],
      ['e', '8'],
      ['h', '9'],
      ['m', '10'],
    Rails.cache.write('array', array)

    n.times do
      array ='array')



user system total real
10 variables 42.670000 8.200000 50.870000 ( 52.095375)
hash with 10 variables 6.390000 0.810000 7.200000 ( 7.303731)
array with 10 variables 6.350000 0.820000 7.170000 ( 7.279306)

Opel Zafira 2007 reset InSP

- Натисни бутон А
- Задръж А докато се появи надписа за сервиз
- Продължавай да държиш бутона
- Натисни спирачка и дай контакт
- InSP ще се появи на екранчето
- След 10 сек. новият интервал ще се покаже
- Пусни А, спирачката и махни контакта

- Натисни бутон А- Задръж А докато се появи надписа за сервиз- Продължавай да държиш бутона- Натисни спирачка и дай контакт- InSP ще се появи на екранчето- След 10 сек. новият интервал ще се покаже- Пусни А, спирачката и махни контакта ban ip list

If you have a lot of requests you can use this list of IP address to ban with iptables the entire (almost) set of machines

You have to secure your dns server.


If you plan to use activeadmin you have to be warned that  by using active admin you are supporting two back ends – yours and the one for active admin.
So if you have time to work for someone else go with active admin. else just do it your self.
Don’t use it!
There is one rumor that nothing starting with active* was good product. ActiveDirectory for ActiveX…. I was wondering are there exceptions ActiveSupport, ActiveRecord….

Jailbrake iphone 4 with ios7

I am the jailbreaking because I feel that my device is my responsibility and I have all rights on it. I don’t wish some company to restrict me what to do or not to do.

My initial setup was iphone 4 with ios 4.1.something.
I used itunes to upgrade to ios 7.1.2
then I used pangu to jailbrake but while installing cydia I lost all icons on my iphone.

Again I used itunes to reinstall ios 7.1.2 but then I use several times the reset/delete/restore options in the iphone settings menu.

Then I followed the steps and everthing was OK.

When cydia was installed I installed

to access the iphone over usb you need APPLE FILE CONDUIT “2” – is newer than afc2add – I am testing it right now..
AppSync Unified – you need this to install unsinged ipa files.

Simple, right? I took me 2 nights to do all those stupid things in order to have MY phone MINE!

last time it took me again 2 nights those 4 nights are a lot of lost money and I wish apple to pay for them.

Here is the list of the programs that I use
Activator – shortcuts
PasswordPilot – inserts your apple password automatically

Tried but not using

Nice liste of more apps

Under linux I use this command to install ipa files.
ideviceinstaller -i /home/guda/Documents/iphone/ipa/openmaps.ipa
This comes from

You have to enable to access to your filesystem, maybe apt-get re-install fuse
here here here

List of domains that do url shortening – – – – – – – –












Replacement for tilda guake or other not working solutions

This script will activate gnome-terminal when you press INSERT (the key right to backspace) and will hide it when pressed again.

Using this script is better than tilda or guake or whatever because you can resize the terminal. You can clean the terminal and have all goods you have in normal terminal.

To install it under lubuntu/lxde open ~/config/openbox/lubuntu-rc.xml and add

Here is the code for the


#TERMINAL_ID=`$XDO  search --name Terminal | /usr/bin/tail -1`

raise_or_fall () {
  TERMINAL_ID=$($XDO search --class gnome-terminal | /usr/bin/tail -1)
  CURRENT_WINDOW_ID=`$XDO getwindowfocus`

  WIDS=`$XDO search --onlyvisible --class gnome-terminal`

  if [ "$CURRENT_WINDOW_ID" -eq "$WIDS" ]
    # zenity --question --text="down"
    $XDO windowminimize $TERMINAL_ID
    # zenity --question --text="up"
    # $XDO windowraise $TERMINAL_ID
    # $XDO windowfocus --sync $TERMINAL_ID
     $XDO windowactivate $TERMINAL_ID

if `ps aux | grep "[g]nome-terminal" > /dev/null`
  gnome-terminal &

Dental Master Pro

Изглежда програмата Dental Master Pro работи и на Windows 7 ULT SP1-64bit и Windows 8-64bit

Просто трябва да зададете опцията за съвместост с Windows XP SP3 на изпълнимият файл и сте готови.

Благодарностите отиват при Д-р Роси Колева.

Working with Rails as a designer

Installing Rails

You have to install first ruby, rubygems, git, bundle, rails

Installing ruby

Preferable way is to install it with normal user via rvm. I am not an expert in mac so probably you need to install xcode from your disks/Internet. Then use rvm

Here is a one of the many tutorials

here are other ways for installing ruby taken from Ruby on Rails for Designers

Installing rubygems

Download, extract and run ruby setup.rb

more reading here

Checkout the project

One SCM is git. install it

Then checkout it

git clone ssh://

Starting Rails project

go to the project folder you have checkout already.

cd uppstart

rvm will ask you if you trust the version of ruby specified in the project. Please agree and install it if you don’t have it.

installing is done by

rvm install ruby-what-ever-version

then you have to install bundle. This is done by doing

gem install bundler

After you have install bundler you will have the bundle command available. Bundler will try to install all the project dependencies. do this by typing


if you don’t have errors you will be almost ready to run the application.

check in config/database.yml and prepare the database specified in the development section

cat config/database.yml

If you see in development sqlite3 as an adapter then just type

rake db:setup

start the application by running

rails s

check the app by navigating to http://localhost:3000


All views are located under app.

Files starting with underscore are partials which are reused in multiple places.


Assets could be in several places.


If you want to add your own file include it under the




Do not add css/javascript directly in those files.

Deploying the application

Put your ssh keys on the server. This should be done once.

Then you have to put your changes on the remote repository. This is done by doing

First we need to get any remote changes by doing.

git pull
git commit -a

Then we can add our new files and commit the changed files/folders.

add the new files with

git add filename_or_folder

then commit all with a message

git commit -a -m "nice message what was changed"
git push

Finally From the application folder run

cap deploy