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: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: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
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:6aa41055c8871a341b16
'This grain is to retrieve the drive list from /proc/scsi/scsi'
import subprocess
from subprocess import stdout
def get_drives():
grains = {}
grains['drive_list'] = True
execString = ('grep', '-E', '\"TOSHIBA|SEAGATE|ATA|HGST\"', '/proc/scsi/scsi')
You can’t perform that action at this time.