Gudasoft

Impossible is nothing

Zaffira B headlight bulb change

The cables should point to the engine (at least on the right headlight). Then turn clockwize, until the curved top points the top

How slow is to do dynamic extend vs “native”

require 'benchmark'

module Gamer
  def foo
  end
end

class Pesho
  def foo
  end
end

class Gosho

end

class Maria
  include Gamer
end

Rails.logger.level = 1
n = 100000

Benchmark.bm do |x|
  x.report("without extend") do
    n.times do
      Pesho.new.foo
    end
  end

  x.report("with extend") do
    n.times do
      Gosho.new.extend(Gamer).foo
    end
  end

  x.report("with extend") do
    n.times do
      Maria.new.foo
    end
  end

end

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 http://www.lovemediasoft.com/article/bg/jailbreak-ios-7-1-x-pangu-1-1-windows.html 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.
FlipControlCenter

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
OpenSSH
PasswordPilot – inserts your apple password automatically
killbackground8

Tried but not using
vShare
AppCake
LocallApStore
iFile

Nice liste of more apps http://www.islamadel.com/en/notes/8-iphone/14-iphone-apps-and-settings

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

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

0rz.tw

1url.com

2.gp

3.ly

7.ly

a.gg

adf.ly

alturl.com

amzn.to

atu.ca

azc.cc – bit.ly

bcool.bz – bit.ly

bit.ly

chilp.it

cl.ly

clck.ru

cli.gs

cort.as

crks.me – bit.ly

cutt.us

digbig.com

doiop.com

easyurl.net

fbshare.me

firsturl.de

firsturl.net

go.ign.com – bit.ly

go.usa.gov

goo.gl

blankrefer.com

hurl.me

ilix.in

is.gd

ix.lt

j.mp – bit.ly

korta.nu

l9k.net

liip.to

linkbun.ch

merky.de

migre.me

miniurl.com

minu.me

myurl.in

nsfw.in

nutshellurl.com

nxy.in

ow.ly

ptiturl.com

ri.ms

rww.tw – bit.ly

safe.mn

shorl.com

shorturl.comalturl.com

shrt.fr

smsh.me

sp2.ro

tw.gs

0l.ro

2u.lc

3le.ru

888.hn

b54.in

cut.by

dft.ba

durl.me

joi.nu

lxcurl.com

mcaf.ee

rod.gs

s.coop

surl.me

tiny.cc

tinyurl.com

surl.co.uk

to.ly

twt.fi

ux.nu

v.gd

va.mu

vai.la

x.co

x.nu

ta.gd

tgr.ph – bit.ly

tiny.pl

tinylink.in

togoto.us

ur1.ca

url.ie

urls.im – bit.ly

urlshorteningservicefortwitter.com

x.vu

xrl.us

xurl.es

yep.it

zi.ma

.ws

.ws

.ws

.ws

.ws

.ws

.ws

.ws

.ws

.ws

.ws

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

https://gist.github.com/gudata/4065ad9bb1fd6d82933b

Here is the code for the riseterminal.sh

#/bin/bash
XDO=/usr/bin/xdotool

#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" ]
  then
    # zenity --question --text="down"
    $XDO windowminimize $TERMINAL_ID
  else
    # zenity --question --text="up"
    # $XDO windowraise $TERMINAL_ID
    # $XDO windowfocus --sync $TERMINAL_ID
     $XDO windowactivate $TERMINAL_ID
  fi
}

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

Automation

Know who you are going to meet – https://charlieapp.com/dashboard
https://ifttt.com – :)

https://zapier.com/

http://www.boomeranggmail.com/ – nice features to gmail

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.


#!/usr/bin/ruby

Dir.glob("*.db") do |file_name|
  new_zone = []
  File.open(file_name) do |file|
    while (line = file.gets)
        line.chomp!
        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}"
        end
        new_zone << line
    end
  end
  new_zone << "\n"

  File.open(file_name, "w") do |new_file|
    new_file.write(new_zone.join("\n"));
  end
end

Benchmark memcached for reading different variables

require 'benchmark'
require 'ostruct'
Rails.logger.level = 1
n = 100000

Benchmark.bm do |x|
  x.report("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 = Rails.cache.read('a')
      b = Rails.cache.read('b')
      c = Rails.cache.read('c')
      d = Rails.cache.read('d')
      e = Rails.cache.read('e')
      f = Rails.cache.read('f')
      g = Rails.cache.read('g')
      e = Rails.cache.read('e')
      h = Rails.cache.read('h')
      m = Rails.cache.read('m')
    end
  end

  x.report("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 = Rails.cache.read('hash')
    end 

  end

  x.report("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 = Rails.cache.read('array')
    end 

  end

end

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 сек. новият интервал ще се покаже- Пусни А, спирачката и махни контакта

1rip.com 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

http://pastie.org/8102773

You have to secure your dns server.