Skip to content

Instantly share code, notes, and snippets.

Mo Ali AkhterAli

Block or report user

Report or block AkhterAli

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:8c5a67a1556aeccbf85702e6ce5dc736
$users = ['david.gonzales', 'akhter.ali', 'sierah.nguon']
$users.each |String $users| {
user { $users:
ensure => 'present',
gid => '500',
password_hash => '!!',
uid => '500',
shell => '/bin/bash'}
}
View some script
#FILE: hostname.list
hostname.domain.com
hostname2.domain.com
hostname3.domain.com
# shell script
for a in `cat hostname hostname.list` do ssh user@$a "yum remove datadog"`; done
View gist:96aa00edd2568d1a81d0bd6c1fb88993
{
"AlarmName": "breitling_Breitling-Daylight_UnHealthyHostCount Alarm",
"AlarmDescription": "Breitling-Daylight_UnHealthyHostCount Alarm",
"AWSAccountId": "271794010589",
"NewStateValue": "ALARM",
"NewStateReason": "Threshold Crossed: 1 datapoint (0.0) was not greater than the threshold (0.0).",
"StateChangeTime": "2016-07-06T15:36:41.406+0000",
"Region": "US East - N. Virginia",
"OldStateValue": "OK",
"Trigger": {
View gist:9b82118567f8eabe9f71
Pillar
file
users/dev_accounts.sls
company_dev_accounts:
user.1:
username: user.1
fullname: user 1
shell: /bin/bash
home: /home/user.1
uid: 10000
View gist:08dbe5f0036ade5bd112
{% for args in pillar.get('service_accounts:teamcity', {}).items() %}
{{ args['user'] }}:
user.present:
- home: {{ args['home'] }}
- shell: {{ args['shell'] }}
- uid: {{ args['uid'] }}
- groups: {{ args['groups'] }}
- fullname: {{ args['fullname'] }}
ssh_auth.present:
- user: {{ args['user'] }}
View gist:9667f7c3133271914d60
#!/usr/bin/env python
from boto3 import Session
from boto3 import client
import urllib
instance_id = urllib.urlopen('http://169.254.169.254/latest/meta-data/instance-id/').read()
def Register_To_ELB(*args):
print('my arg {0}'.format(args)
View gist:2f94670f530dc25e3b4f
[DEV root@build22.dev salt-master]# docker run -itd salt-master:latest /bin/bash
bbf3d9b9aa7ab2248cbdc7c1a6d56798d3075f9df449e3941e7f97244b002371
[DEV root@build22.dev salt-master]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bbf3d9b9aa7a salt-master:latest "/bin/bash" 8 seconds ago Up 7 seconds dreamy_banach
9c8da598d4bd salt-master:latest "/bin/sh -c salt-mast" About a minute ago Up About a minute salt4
da8f6540f936 salt-master "/bin/sh -c salt-mast" 2 minutes ago Up 2 minutes salt3
4b311c57b7c8 salt-master "/bin/sh -c salt-mast" 3 minutes ago Up 3 minutes salt2
c3f6286f076c salt-master "/bin/sh -c salt-mast" 14 minutes ago Up 14 minutes salt
ec97c3fcdf1e salt-mi
View gist:0ab76f6badb312495186
__author__ = 'Akhter Ali'
__date__ = '08/12/15'
__version__ = '0.1.0'
try:
import salt.cloud
CLOUDIMPORTED = True
print('salt.cloud successfully imported')
except ImportError:
CLOUDIMPORTED = False
View gist:a00bdc36669df5f1cc55
akhterpod01.dev.aws.resonatedigital.net:
The minion function caused an exception: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 1020, in _thread_return
return_data = func(*args, **kwargs)
File "/var/cache/salt/minion/extmods/modules/checkhighstate_test.py", line 37, in destroy
client.destroy(names=[minion_name])
File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 361, in destroy
mapper.destroy(names)
File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1064, in destroy
', '.join(names)
View gist:e5ffca005c1c36edd8ec
__author__ = 'Akhter Ali'
__date__ = '08/12/15'
__version__ = '0.1.0'
try:
import salt.cloud
CLOUDIMPORTED = True
print('salt.cloud successfully imported')
except ImportError:
CLOUDIMPORTED = False
You can’t perform that action at this time.