Skip to content

Instantly share code, notes, and snippets.

View lcerezo's full-sized avatar

Luis E. Cerezo lcerezo

View GitHub Profile
'''
Modular Input Script
Copyright (C) 2012 Splunk, Inc.
All Rights Reserved
'''
import sys,logging,os,time,re,threading
import xml.dom.minidom

all_about_contexts_1

Objective:

  • What is the file context of the /home/vagrant/.bash_profile file?
  • What is the file context of the /etc/passwd file?
  • How are these file contexts stored specifically?
[vagrant@selinuxgame ~]$ ls -Z .bash_profile 
unconfined_u:object_r:user_home_t:s0 .bash_profile
Thanks to @darrel for this
_____
| |
| PC1 |
|_____|
|
|
_____ _____
| | | |
| SW1 |---| SW2 |
# -----------------------------------------------------------------------------
# this provisions a centos 7 box, a centos 6 box, and a switch and runs ansible to test them.
# -----------------------------------------------------------------------------
Vagrant.configure(2) do |config|
# because vagrant seems to try to use the same flipping key everywhere.
config.ssh.insert_key = false
# don't update VitrualBox GuestAdditions -- Because it's slow. and mildly annoying on switches.
config.vbguest.auto_update = false
# el 6 box

Keybase proof

I hereby claim:

  • I am lcerezo on github.
  • I am lcerezo (https://keybase.io/lcerezo) on keybase.
  • I have a public key ASB0vTvx1LKIFPVDrH7FfgQ1iwk8kyG1qrpl4Bxyb5pFUQo

To claim this, I am signing this object:

@lcerezo
lcerezo / gist:2e9825e0ea813879d726
Created March 18, 2015 01:53
python method to create sha512 hash suitable for /etc/shadow
hostname[~]$ python
Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import crypt
>>> print crypt.crypt('My Magical passW0Rd!!',crypt.mksalt(crypt.METHOD_SHA512))
$6$zyMqrghWfTymk7Ya$vACFM/VMV8Dc3OyPMIsGD83GY54/wXhBezRJgoWhN1kez7b5NDuNAGE1EUtOrtlNFR4GoYFnDh8cEWjYm1okl.
>>>