Skip to content

Instantly share code, notes, and snippets.

View bgulla's full-sized avatar
🦃
fast and loose is still fast.

Brandon bgulla

🦃
fast and loose is still fast.
  • Virginia
View GitHub Profile
#!/usr/bin/python
import time
import random
import statsd
counter_name = 'db1'
wait_s = 1
while 1:
c = statsd.StatsClient('localhost', 8125)
random_count = random.randrange(1, 100)
print 'Count=(%d)' % random_count
@bgulla
bgulla / installXFCECentos7.sh
Last active August 29, 2015 14:23
Install XFCE4 on centos7 server
yum install xorg-x11-fonts-Type1 xorg-x11-fonts-misc
yum install -y https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
#https://www.howtoforge.com/vnc-server-installation-on-centos-7
#http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html
mkdir ~/.ssh
chmod 700 ~/.ssh
#https://www.howtoforge.com/vnc-server-installation-on-centos-7
>>>[google-chrome]
name=google-chrome
#!/bin/sh
### BEGIN INIT INFO
# Provides: dockercompose
# Required-Start: $docker
# Required-Stop: $docker
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Docker Services
### END INIT INFO
@bgulla
bgulla / sshconfig
Created August 7, 2015 18:57
SSH ProxyCommand JumpHost
Host *.dsm
LocalForward 5001 localhost:5001
ProxyCommand ssh -q -W $(basename %h .dsm):%p username@<jump_hostname>
@bgulla
bgulla / python_simple_webserver.py
Created August 25, 2015 19:00
Python Webserver that serves up a flat HTML file.
#!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from time import gmtime, strftime
import sys,random,socket
PORT_NUMBER = 8000
HOSTNAME = socket.gethostname()
if len(sys.argv) > 1:
@bgulla
bgulla / backup.sh
Last active September 8, 2015 18:19
Generic Backup Script
#!/bin/bash
######################################################
# Generic backup script to pull a file from a remote
# server and rename it with a date suffix.
######################################################
REMOTE_USER='pi'
REMOTE_HOST='bar'
REMOTE_FILEPATH='/home/pi'
REMOTE_FILE='backup.tgz'
@bgulla
bgulla / gist:cddf6a829da9efea775c
Created December 4, 2015 15:09
Sample yarn-site.xml for Apache Incubator Myriad ResourceManager Docker
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@bgulla
bgulla / myriad-config-default.yml
Created December 4, 2015 15:10
Sample myriad-config-defauly.yml for Apache Incubator Myriad ResourceManager Docker
##
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@bgulla
bgulla / bbb_boot_service_instructions.md
Created January 26, 2016 18:27 — forked from tstellanova/bbb_boot_service_instructions.md
How to setup a service to automatically run a python script when the BeagleBone Black (BBB) reboots. These instructions allow you to setup a python script to automatically start when the BeagleBone (running Angstrom linux with systemd) restarts.

Creating a service to startup at BeagleBone Black boot time:

  • Create a shell script such as /usr/bin/myFancyBash.sh:

      #!/bin/bash
    
      # this could be any runnable code or shell script, really
      /usr/bin/myFancyPython.py 
    

Note that the first line is critical.

#!/usr/bin/python
from prettytable import PrettyTable
table = PrettyTable()
def btod(n):
return int(n,2)
hex1="0x62"
hex2="0x12"
multiplier = bin(int(hex1,0))