Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# parse echo command using Perl with
# many calls to the "${RANDOM}" internal bash function
# redirect command to a bash session
bash<<<$(
perl -e '
print "echo ";
print "\$\{RANDOM\}"'x40
)
#!/bin/bash
# controlling a screen session from the terminal
screen_name="fab_session_${RANDOM}" # Generate unique screen session name
screen -S ${screen_name} -d -m # Open detached screen session
# Send commands to the screen session
screen -S ${screen_name} -p 0 -X stuff "echo \'hello world\!\'^M"
screen -S ${screen_name} -p 0 -X stuff "echo -n \'Still here, \!\'^M"
screen -S ${screen_name} -p 0 -X stuff "echo -n \' Still selling real fake doors\!\'^M"
@classmember
classmember / MegaPy.py
Created August 11, 2017 15:07
MegaPy - MegaCLI wrapper
#!/usr/bin/env python
'''
MegaPy - MegaCLI wrapper
'''
import os
import subprocess
import argparse
# import sh
__version__ = 'MegaPy v.1'
#!/usr/bin/python
'''
MegaPy - MegaCLI wrapper
The Python wrapper is an attempt to make RAID management easier
for the MegaRAID line of RAID devices.
MegaRAID and MegaCLI are currently supported by Broadcom.
LSI Documentation on MegaCLI:
#!/usr/bin/python
'''
MegaPy - MegaCLI wrapper
'''
import sh
import os
import subprocess
import argparse
__version__ = 'MegaPy v.1'