This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# resizes the window to full height and 50% width and moves into upper right corner | |
#define the height in px of the top system-bar: | |
TOPMARGIN=27 | |
#sum in px of all horizontal borders: | |
RIGHTMARGIN=10 | |
# get width of screen and height of screen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Script that will be invoked when invoke-command will be executed | |
$script = [scriptblock]::create("get-host | |
hostname") | |
$node = "1.12.3.4" | |
#UserName that will deploy it | |
$username = "username" | |
$pw = "password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint | |
from boto import ec2 | |
#You need to give access keys and key secret too.. | |
ec2conn=ec2.connect_to_region('us-west-1') | |
#A reservation corresponds to a command to start instances. You can see what instances are associated with a reservation: | |
#Here reservation is like group of instance which can be started and stopped instantly as group | |
reservations=ec2conn.get_all_instances() | |
for reservation in reservations: | |
instance=reservation.instances |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from fabric.api import * | |
# from fabric.colors import green as _green, yellow as _yellow | |
from boto.ec2.connection import EC2Connection | |
import time | |
# def start_machine(ami='ami-d7a18dbe'): | |
'''Launch a single instance of the provided ami''' | |
aws_access_key_id = 'Cf7...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint | |
from boto import ec2 | |
ec2conn=ec2.connect_to_region('us-east-1') | |
reservations=ec2conn.get_all_instances() | |
for reservation in reservations: | |
#type is <resultset>, a modified version of python LIST | |
resultset=reservation.instances | |
#Get instance object | |
instance=resultset[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from boto import route53 | |
import os | |
r53=route53.connect_to_region(region_name='us-east-1') | |
all_zones = r53.get_all_hosted_zones() | |
hosted_zones = all_zones['ListHostedZonesResponse']['HostedZones'] | |
for hosted_zone in hosted_zones: | |
zone_id = hosted_zone['Id'] | |
print os.path.basename(zone_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Map d to nothing, because I accidently press 'd' at-times. | |
nnoremap d <nop> | |
" Press 'q' to delete current tab | |
noremap q :bdelete<CR> | |
" Move tab left/right(Sometimes I do stupid things) | |
noremap J :tabmove -1<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Execute this line in command prompt | |
gconftool-2 --set /apps/guake/general/use_vte_titles --type boolean false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$instances = (Get-ec2instance -region us-east-1 ).Instances | |
$servers = @() | |
foreach( $instance in $instances) { | |
$ipAddrs+=$instance.PrivateIpAddress | |
} | |
foreach ($ip in $ipAddrs) { | |
write-host $ip | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint | |
from boto import ec2 | |
def main(): | |
ec2conn=ec2.connect_to_region('us-east-1') | |
reservations=ec2conn.get_all_instances(filters={"tag:tag_name": "value",'instance-state-name' : 'running'}}) | |
output=[] | |
for reservation in reservations: |
OlderNewer