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
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
import boto | |
import boto.ec2.elb | |
import boto.ec2.elb.instancestate | |
elb_conn=boto.ec2.elb.ELBConnection(aws_access_key, aws_access_secret) | |
lbs=elb_conn.get_all_load_balancers() | |
for lb in lbs: | |
for instance_info in lb.instances: | |
if instance_info.id == "Your_Instance_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
from boto.ec2 import * | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("access_key", help = "AWS Access Key") | |
parser.add_argument("secret_key", help = "AWS Secret Key") | |
parser.add_argument("--region", help = "AWS Region", default = "us-east-1") | |
parser.add_argument("--all", help = "show not just running instances", action = "store_true") | |
args = parser.parse_args() |
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
0. SSH to server | |
1. Edit jenkins_home/config.xml | |
2. set userSecurity to false: <userSecurity>false</userSecurity> | |
3. delete | |
<authorizationStrategy> and <securityRealm> | |
4. /etc/init.d/bitnami restart |
OlderNewer