Monday, July 17, 2017

Chrome does not save passwords anymore

I had a problem that chrome stopped saving me a passwords. I'm using chrome on OS X. Everything is turned on that needs to be turned on and I get asked should chrome save me a password, but password is never saved.
I tried to uninstall chrome, to install it again, to reset settings, etc, but nothing fixed the problem.

Key step is, when you uninstall chrome to delete following folder:
 ~/Library/Application Support/Google/Chrome.


Friday, March 03, 2017

Script iterm2 to open several ssh tabs

Save this like mysqcript.app:
tell application "iTerm2"
  tell current window
    
    create tab with default profile command "ssh myuser@111.111.111.111 -i my.pem"
    select last tab
    tell the current session
      write text "#web 1;"
    end tell
    
    create tab with default profile command "ssh myuser@111.111.111.112 -i my.pem"
    select last tab
    tell the current session
      write text "#web 2;"
    end tell
    
    create tab with default profile command "ssh myuser@111.111.111.113 -i my.pem"
    select last tab
    tell the current session
      write text "#worker 1;"
    end tell
  
  end tell
end tell

And run it as:
osascript mysqcript.app

Tuesday, February 21, 2017

Friday, August 12, 2016

GUI for Zookeeper

I created tool in python 2.7. It is self hosted web application and it allows you to view, add and delete node, and you can modify node data.
Tool and instruction how to install it can be found at
github.com/mijalko/zookeeper_browser

Monday, May 18, 2015

Mysql backup using alias

This alias will create database backup with current date in filename:

alias dbbck='mysqldump -u myusername -pmypassword mydatabase > mijalkodb_$(date +"%Y_%m_%d").sql'

Add this to your .bashrc 

Tuesday, April 07, 2015

Strange osx shortcuts

Remander for me:


  • To maximize window press shift and double click on title bar
  • Blocked ssh connection: Enter  ~  .

Wednesday, December 10, 2014


Cloud Design Patterns: Prescriptive Architecture Guidance for Cloud Applications

http://msdn.microsoft.com/en-us/library/dn568099.aspx

Friday, August 15, 2014

Ubuntu tasks in separate terminals

On my current project I need to open few terminals (5 and more) and start different processes. For example, I need to open terminal, change current dir, start ruby application. On second terminal I open virtual env start python script etc...

I had a problem also with finding right terminal window when I needed.
So I created scripts that open all my terminals and give them appropriate names

terminal1.sh :

#!/bin/bash
source '/home/dev/.bashrc'
echo -ne '\033]0;Web server\007'
cd '/home/dev/src/proj1'
source '/home/dev/src/venv/bin/activate'
bash /home/dev/src/proj1/start_web_server.sh


To start all terminals I neede one more script

#!/bin/bash

gnome-terminal --window-with-profile=dev --working-directory='/home/dev/' -e 'bash --rcfile /home/dev/scripts/terminal1.sh'
gnome-terminal --window-with-profile=dev --working-directory='/home/dev/' -e 'bash --rcfile /home/dev/scripts/terminal2.sh'
gnome-terminal --window-with-profile=dev --working-directory='/home/dev/' -e 'bash --rcfile /home/dev/scripts/terminal3.sh'

Wednesday, February 12, 2014

Thursday, October 03, 2013

HttpSelfHostServer and maximum concurrent connections

To set up maximum concurrent connections for HttpSelfHostServer you need to tweak following properties:

  • In HttpSelfHostConfiguration set MaxConcurrentRequests (this is not enough, continue reading)
  • System.Net.ServicePointManager.DefaultConnectionLimit
  • ThreadPool.SetMinThreads

Monday, December 10, 2012

Google Apps Alternative

Don't be evil company is not so good anymore. There is no Google apps for free anymore (this was good application for families domain names).

Check domains.live.com as an alternative.

And please post your experiences here.

Tuesday, September 04, 2012

Python script for deleting VM using Nova API

This is sample python script that delete virtual machines, keys and security groups where security group has a same name as keypair



import os, sys, time
from pprint import pprint
from novaclient.v1_1 import client

nt = client.Client("username", "pwd", "test", "http://192.168.0.155:1111/v1.1/", service_type="compute")
a = nt.servers.list()
for s in a:
        print s.name + " | "  + s.key_name  + " | " + str(s.addresses)
        varDelete = raw_input("Delete machine, keys and groups (y/n): ")
        if varDelete == "y":

                print "deleting"
                print
                print "checking if there is an IP for release"

                for nets in s.addresses:
                        pprint (s.addresses[nets])
                        for a in s.addresses[nets]:
                                address = str(a["addr"])
                                print "checking address " + address
                                existInFloating=[checked for checked in nt.floating_ips.list() if checked.ip == address]
                                if len(existInFloating) > 0:
                                        print "exist"
                                        s.remove_floating_ip(address)
                                        existInFloating[0].delete()
                                        print "ip address released"
                                else:
                                        print "not exist"

                nt.servers.delete(s)

                keyname = s.key_name
                if keyname != "":
                        print "deleting keyname and group: " + keyname
                        selectedKeyPairs = [k for k in nt.keypairs.list() if k.name == keyname]
                        if len(selectedKeyPairs) > 0:
                                selectedKeyPairs[0].delete()

                        selectedGroups = [k for k in nt.security_groups.list() if k.name == keyname]
                        if len(selectedGroups) > 0:
                                time.sleep(5)
                                selectedGroups[0].delete()

                print "deleted"
        else:
                print "skipping"



Print all object attributes in python

In case of lack of documentation for some API you may need, for example, list of attributes for some object. You can do that using:


from pprint import pprint
pprint (vars(myobject))


or...



pprint (dir(obj))


or....


import inspect
inspect.getmembers(obj, predicate=inspect.ismethod)


Sunday, September 02, 2012

Universal Android Remote Control

Beta version of AndroRemoteControl application for Android is a live and can be found here: http://goo.gl/oywzP

More info soon.