Skip to content

Instantly share code, notes, and snippets.

@dalenunns
dalenunns / SAResources.md
Last active June 19, 2024 16:17
List of SA Resources
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
# Function to calculate the WPS checksum of a 7 digit number
def wps_checksum(pin):
accum = 0
while pin>0:
accum += 3 * (pin % 10);
pin /= 10;
accum += pin % 10;
pin /= 10;
return (10 - accum % 10) % 10
@j-keck
j-keck / ubuntu: disable dhcp from dnsmasq-base
Created July 5, 2014 06:26
how to disable dhcp server (dnsmasq-base) on ubuntu
dnsmasq from package 'dnsmasq-base' starts with a (from libvirt) generated configuration: /var/lib/libvirt/dnsmasq/default.conf.
this configuration file is not directly editable because it gets overwritten from libvirt.
there is no possibility to set 'no-dhcp-interface=eth0' per 'libvirt'.
# ###########################################################
# deactivate dhcp in dnsmasq per libvirt
# dnsmasq listen on port 53 (dns) and 67 (dhcp)
j@ubuntu:~$ sudo netstat -taupen | grep -E ':53|:67'
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 0 9817 1218/dnsmasq
# Dockerfile snippets that are useful to me. Many bits obtained from others.
FROM ubuntu:14.04
MAINTAINER Andrew Mac <zerlgi@gmail.com>
RUN echo 'Acquire::http::Proxy "http://172.17.42.1:3142"; ' > /etc/apt/apt.conf
RUN echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" > /etc/apt/sources.list
RUN echo "deb http://archive.ubuntu.com/ubuntu trusty-security main universe" >> /etc/apt/sources.list
#RUN echo "deb http://archive.ubuntu.com/ubuntu trusty-updates main universe" >> /etc/apt/sources.list
RUN apt-get -qq update
@P7h
P7h / jdk_download.sh
Last active May 21, 2024 02:10
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@p120ph37
p120ph37 / VIPAccess.exp
Created January 2, 2014 01:34
Command-line implementation of Symantec's "VIP Access" token application on OSX. This will read from the same secret key and produce the same time-based one-time-passwords as the GUI application, but with output that can be captured and used in scripts. This can be useful for things like automating two-factor AnyConnect VPN logins through openco…
#!/usr/bin/expect -f
#
# VIPAccess.exp
#
# Command-line emulation of Symantec's VIP Access software token.
# Usage:
# ./VIPAccess.exp [v]
# If the "v" argument (or any argument) is specified, verbose output
# will be produced on stderr. The OTP value will be output on stdout.
#
@PiiXiieeS
PiiXiieeS / Backup-Trello-Board.sh
Last active October 15, 2016 18:25
This shell script allow to save automatically a Trello board with authentication by KEY and private TOKEN saving the resulting .json file into a backup file automatically named with the current date.
curl 'https://api.trello.com/1/boards/S4ydUkil?key=[KEY]&token=[TOKEN]&actions=all&actions_limit=1000&cards=all&lists=all&members=all&member_fields=all&checklists=all&fields=all' > backup.`date +\%Y-\%m-\%d`.json
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@henrik-muehe
henrik-muehe / Dockerfile
Created August 5, 2013 11:47
Allows installing the ubuntu "fuse" package without creating any devices. Used to install packages on docker which require fuse but do not actively use it.
...
# Fake a fuse install
RUN apt-get install libfuse2
RUN cd /tmp ; apt-get download fuse
RUN cd /tmp ; dpkg-deb -x fuse_* .
RUN cd /tmp ; dpkg-deb -e fuse_*
RUN cd /tmp ; rm fuse_*.deb
RUN cd /tmp ; echo -en '#!/bin/bash\nexit 0\n' > DEBIAN/postinst
RUN cd /tmp ; dpkg-deb -b . /fuse.deb