Skip to content

Instantly share code, notes, and snippets.

View sgnn7's full-sized avatar
🤔
ǝʌᴉʇɔǝdsɹǝd ɹnoʎ ǝƃuɐɥƆ

Srdjan Grubor sgnn7

🤔
ǝʌᴉʇɔǝdsɹǝd ɹnoʎ ǝƃuɐɥƆ
View GitHub Profile
@sgnn7
sgnn7 / apt-get
Last active October 7, 2020 15:40
sudo apt-get install pidgin bumblebee byobu chromium-browser vim dconf-editor dkms fail2ban \
john smartmontools wavemon iftop htop iotop w3m vpnc vpnc-scripts vpnc \
encfs network-manager-vpnc network-manager-vpnc-gnome devscripts dpkg \
wavemon git gitk gitg git-extras openjdk-8-jre openjdk-8-jdk \
openjdk-7-jre openjdk-7-jdk openjdk-6-jre openjdk-6-jdk exuberant-ctags \
ppa-purge zenmap irssi playonlinux dos2unix autoconf automake intltool \
gimp arpwatch audacity osc traceroute quilt python3-setuptools ansible \
vim-rails vim-scripts vim-syntax-gtk vim-python-jedi vim-gtk vim-gnome
@sgnn7
sgnn7 / transfer_speed_benchmark.sh
Created October 1, 2015 20:27
Script to test file transfer speeds between two machines (in this case a Linux host and Netgear NAS
#!/bin/bash -e
if [ $# -ne 4 ]; then
echo "Usage: $0 <target device> <target file> <username> <password>"
exit 1
fi
# Requires packages:
# nfs-common
# mbuffer
@sgnn7
sgnn7 / sketch_vu.ino
Last active October 23, 2015 03:25
Arduino VU meter
#define RED 0
#define GREEN 1
#define BLUE 2
#define VOLUME_DEAD_ZONE 34
#define MIN_VOLUME 40
#define MAX_VOLUME 460
#define CENTER_VOLUME ((MAX_VOLUME + MIN_VOLUME) / 2)
@sgnn7
sgnn7 / enable_mongo.sh
Created December 22, 2015 23:06
Mongodb 3.2 on Ubuntu 15.10
echo '[Unit]
Description=High-performance, schema-free document-oriented database
After=syslog.target network.target
[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod -f /etc/mongod.conf
[Install]
@sgnn7
sgnn7 / .gitignore
Last active January 25, 2016 23:00
Build mesos.deb with Docker
*.deb
build/
(12:59:23 PM) JohnO: sgnn7 connect from where?
(12:59:41 PM) JohnO: I use mesos-dns often times, are you saying from within the app?
(01:01:13 PM) sgnn7: JohnO: yeah from within the app. host has localhost:<port> on HAproxy going to the right place but the question is accessing that from the app itself
(01:01:40 PM) JohnO: Ah, there is a PORTS variable in Marathon to know how to access it on the host itself
(01:01:51 PM) sgnn7: it's bridged networking though
(01:01:53 PM) JohnO: then you can use the $HOST:$PORT variables
(01:01:56 PM) JohnO: ya
(01:02:09 PM) JohnO: so that would allow the container to connect to the ports external port (I think)
(01:02:39 PM) sgnn7: sadly for our service discovery we're trying to avoid putting in env var resolution but I did find that as well
(01:02:40 PM) cheus left the room (quit: Ping timeout: 260 seconds).
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 4.2.0-19-generic Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
@sgnn7
sgnn7 / setup_ansible.sh
Created April 11, 2016 16:03
Apply custom patches to ansible
#!/bin/bash -e
echo WARNING! This script will add various junk to your
echo WARNING! machine so it is best to run it in a VM!
echo Fetching latest ansible
prerequisites="git \
python \
python-boto \
APP_NAME=foobar
TASK_INDEX=0
LOG_TYPE=stderr # or stdout
MARATHON_HOST="marathon.host.local"
SCHEME=https
MARATHON_TASK_URI="$SCHEME://$MARATHON_HOST/v2/apps/$APP_NAME?embed=app.tasks"
app_info=$(curl "$MARATHON_TASK_URI")
app_task=$(echo ${app_info} | jq -r ".app.tasks[$TASK_INDEX]")
@sgnn7
sgnn7 / haproxy_cluster_vars.conf
Created June 15, 2016 14:19
Seamless haproxy on marathon-lb w/ systemd
# /etc/systemd/system/haproxy.service.d/haproxy_cluster_vars.conf
[Service]
Environment="PIDFILE=/run/haproxy.pid"
Environment="HAPROXY_SOCKET=/var/run/haproxy/socket"
# Get rid of the socket on start/stop
ExecStartPre=/bin/bash -c "rm -f $HAPROXY_SOCKET"
ExecStopPost=/bin/bash -c "rm -f $HAPROXY_SOCKET"
# XXX: Do seamless reloads