Using Adium wiht 2 factor autentication and google apps aka Gsuit

Using google talk inside gmail windows sucks for me.
So I installed adium in my macbook and start to configure it.
But login never succeed with my actual password my company enforces two factor autentication and adium dosen’t fave that feature so.
You have to generate an application password in:

https://security.google.com/settings/u/1/security/apppasswords

Create new password and select custom and in the app name choose ‘GoogleTalk/Pidgin’

Use the password you generated in Adium and you are in.

Publicado en Uncategorized | Deja un comentario

Listing all your AWS instances

Using boto I write a script to list all instances in all geographic regions.

The main motivation behind this is that in the amazon web console there is no a way (as far as I know) to list all the resouorces trespassing geographic regions.

Also added pretty table module to output data in a more redable way.

I’ve used the main tags that I use and the geographics where I have resource to organize perhaps you can use yours or none.

import boto.ec2
from prettytable import PrettyTable
regions = ["us-east-1", "us-west-2", "eu-west-1"]
table = PrettyTable()
table.field_names = ["region", "name", "id", "role", "state", "public-ip"]
for r in regions:
    conn=boto.ec2.connect_to_region(r)
    reservations = conn.get_all_instances()
    print ("Processing *****", r, "*****")
        for res in reservations:
            for inst in res.instances:
                if 'role' in inst.tags:
                    table.add_row([r, inst.tags['Name'], inst.tags['role'],, inst.id, inst.state, inst.ip_address])
                elif 'Name' in inst.tags:
                    table.add_row([r, inst.tags['Name'],"none", inst.id, inst.state, inst.ip_address])
                else:
                    table.add_row([r, "none", "none", inst.id, inst.state, inst.ip_address])
print(table)

 

Publicado en Uncategorized | Deja un comentario

Making an aws instance route packets

 

After hours of banging my head against the wall, setting up a vyos router to connect the amazon instances with my collocation sites through a IPSec VPN.

Finnaly a stackoverflow answer saves me once again, pointing that in order to an aws instance to route packets you have to check the option disable source destination check in networking options.

EC2_Management_Console_and_agente-de-amazon-laboratorio-1

 

Publicado en Uncategorized | Deja un comentario

Running a custom script after windows instance spinout in aws

I need to configure an app everytime I spinout an image in aws.

The script is a simple powershell script to change an app config in xml.

I fin the option to use the –user-data at image launch but the ec2configservice keeps disabling the option to handle user data everytime I create a new ami.

So I come up with to scripts one to enable hande user data in the config of the ec2config service.

And my powershell at instance launch time.

 

Publicado en Uncategorized | Deja un comentario

First things to do with a windows server.

If you have no other chance than interact with a windows servers and you feel at home with *nix systems.

The first things to do are:

  1. Use chocolatey to install packages, chocolatey is the missing package manager for window is a nice project and the list of available packages is pretty big after enabling chocolatey with a simple script, you can install packages using:
    choco install package name.
  2. Stay close to power shell power shell is a nice programming language to automate tasks in windows the more you stay in power shell the less you will have to deal with windows GUI and thats nice.
Publicado en Uncategorized | Deja un comentario

ipsec vpn between vyatta / vyos behind dynamic IP address

The solution is simple create a record in a dynamic DNS provider, and  client program in the router update the record whenever the wan address changes.

This is the configuration for a peer configured with a dynamic dns client in a home router.

vyatta@vpnfw# show vpn ipsec site-to-site peer host.dynamic-dns.net

authentication {
     id localfw
     mode pre-shared-secret
     pre-shared-secret ohcaicheeW7Moe9Ieshooph6tojoh2mu
     remote-id control
 }

 default-esp-group ESP-KERIO
 ike-group IKE-KERIO
 
local-address 127.0.0.1
 tunnel 1 {
     local {
         prefix 172.21.133.0/24
     }
     remote {
         prefix 192.168.133.0/24
     }
 }
Publicado en Uncategorized | Deja un comentario

How to run a process on specific CPU cores on Linux

In modern operating systems theres a feature called processor affinity or CPU pinning.

This feature allows to bind a process to a particular CPU core(s).

In Linux you can pin a process to a particular CPU core(s) using taskset a command line tool to retrive or set processor affinity.

‘man taskset’ to get all the details.

While taskset bonds the specific process to a particular core or set of cores that does not warranties that the CPU not be used by other processes.

If you want to reserve a particular CPU to a particular process you have to add a kernel parameter to isolate the core(s) so the kernel will not use that core(s) to shcedulle any regular process.

The kernel parameter is “isolcpus=<CPU_ID>”

 

 

Publicado en Uncategorized | Etiquetado , , | Deja un comentario