This file contains hidden or 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
| Ping from my docker image. first it doesnt work, then it does. | |
| root@2ed081d6465f:/# ping 192.168.0.106 | |
| PING 192.168.0.106 (192.168.0.106) 56(84) bytes of data. | |
| From 192.168.0.6 icmp_seq=1 Destination Host Unreachable | |
| ## | |
| # 192.168.0.6 is not even a machine on the network! | |
| ## | |
| ^C |
This file contains hidden or 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
| #Chooses a Race and changes the stats according to the race chosen | |
| print "What race would you like to play as?\n 1: Human \n 2: Dwarf \n 3: Elf \n 4: Gnome \n 5: Half-Elf \n 6: Half-Orc \n 7: Halfling" | |
| race = int(raw_input()) | |
| if (race == 1): | |
| print "Hello Human." | |
| racename = "Human" | |
| elif (race == 2): | |
| print "Hello, Dwarf." |
This file contains hidden or 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
| def stats(): | |
| stat = random.randint (4,24) | |
| return stat | |
| stre= stats() | |
| print "Strength:", stre | |
| dex= stats() | |
| print "Dexterity:", dex | |
| con= stats() | |
| print "Constitution:", con |
This file contains hidden or 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
| # .bashrc | |
| # Source global definitions | |
| if [ -f /etc/bashrc ]; then | |
| . /etc/bashrc | |
| fi | |
| # User specific aliases and functions | |
| #I like to know the load when I login. | |
| echo "Load: $(uptime | awk -F ":" '{print $NF}')" |
This file contains hidden or 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
| #Get Fedora cloud image | |
| wget http://download.fedoraproject.org/pub/fedora/linux/updates/20/Images/x86_64/Fedora-x86_64-20-20140407-sda.qcow2 | |
| #Set a root password so that you can modify your image | |
| sudo yum install libguestfs-tools | |
| sudo libguestfs-test-tool | |
| sudo virt-sysprep -a Fedora-x86_64-20-20140407-sda.qcow2 --root-password password:SomePassword | |
| #start modified image in kvm and connect via console: |
This file contains hidden or 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
| Fedora | Ubuntu | |
| checking build system type... x86_64-unknown-linux-gnu checking build system type... x86_64-unknown-linux-gnu | |
| checking host system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu | |
| checking for gcc... gcc checking for gcc... gcc | |
| checking whether the C compiler works... yes checking whether the C compiler works... yes | |
| checking for C compiler default output file name... a.out checking for C compiler default output file name... a.out | |
| checking for suffix of executables... checking for suffix of executables... | |
| checking whether we are cross compiling... no checking whether we are cross compiling... no | |
| checking for suffix of object files... o checking for suffix of object files... o | |
| checking whether we are using the GNU C compiler... yes checking whether |
This file contains hidden or 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 | |
| usage () { | |
| cat << EOF | |
| Description: Add $hostid to Foo --> Bar tree | |
| To Get trees do sudo php /var/lib/cacti/cli/add_tree.php --list-trees | |
| To Dig into the parent tree sudo php /var/lib/cacti/cli/add_tree.php --list-nodes --tree-id=8 | |
| Usage: "$0" x | |
| EOF |
This file contains hidden or 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 | |
| usage () { | |
| cat << EOF | |
| Description: Add Graphs for $hostid | |
| Graphs added: | |
| 53 Host MIB - Uptime | |
| 4 ucd/net - CPU Usage | |
| 38 ucd/net - Interrupts/Context Switches |
This file contains hidden or 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 | |
| usage () { | |
| cat << EOF | |
| Description: pass the variables for description ip password privpass to add a host to cacti | |
| Example: | |
| ./$0 jenkins020 jenkins020.foo.org secret privpass | |
| EOF | |
| exit 1 | |
| } |
This file contains hidden or 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 | |
| # BEGIN CRON DAILY ## | |
| bind_server=foo.bar.com | |
| if ssh root@$bind_server 'rndc dumpdb -zones' | |
| then | |
| scp -q root@$bind_server:/var/cache/bind/named_dump.db /tmp/ | |
| grep -v '^;' /tmp/named_dump.db|awk {'print $1'}|grep -v 'IN-ADDR'|sed s/\.$//|tr '[A-Z]' '[a-z]'|egrep -v '^[1-9]'|egrep -v '^\*'|sort|uniq > ~/.ssh_hosts | |
| awk '{print $1" <--> "$5}' /tmp/named_dump.db | grep -vE '(nse|;|ARPA)' | tr '[A-Z]' '[a-z]'|sed -e 's/. / /' -e 's/ -/ /' -e 's/\.$//' > ~/.ssh_hosts_ips |