Skip to content

Instantly share code, notes, and snippets.

View Sarke's full-sized avatar

Peter Stalman Sarke

View GitHub Profile
@scyto
scyto / docker-swarm-architecture.md
Last active May 8, 2024 23:39
My Docker Swarm Architecture
@ottokruse
ottokruse / aws-console
Last active March 14, 2024 10:36
Python script to launch the AWS console in your webbrowser, using a presigned URL generated from your AWS CLI credentials
#!/usr/bin/env python3
"""
Usage:
- Save this script somewhere on your path (e.g. `vi /usr/local/bin/aws-console && chmod +x /usr/local/bin/aws-console`)
- Make AWS credentials available in one of the usual places where boto3 can find them (~/.aws/credentials, env var, etc.)
- Excute the script: `aws-console --profile myprofile`
- :tada: Your browser opens and you are signed in into the AWS console
"""
@jakkn
jakkn / cascading_autobuilds.md
Last active February 28, 2021 21:41
Cascading autobuilds on Docker Hub
@zerowebcorp
zerowebcorp / docker-swarm-auto-rebalance.sh
Created December 10, 2017 17:08
Docker Swarm automatically rebalance when new worker node joins
FILE=/tmp/worker.nodes
touch ${FILE} || exit
for node in `docker node ls --filter role=worker -q`; do
if grep -Fxq "${node}" ${FILE}
then
echo "This node ${node} already exists"
else
echo "This node ${node} joined recently, so rebalance"
for service in `docker service ls -q`; do
{{-- Define all our servers --}}
@servers(['staging' => '', 'production' => ''])
@setup
{{-- The timezone your servers run in --}}
$timezone = 'Europe/Amsterdam';
{{-- The base path where your deployments are sitting --}}
$path = '/var/www/site.com/htdocs';
@amirkdv
amirkdv / php_mdb.rst
Last active August 25, 2023 13:14
How to handle MS Access MDB files in Linux with PHP5 PDO and ODBC

To be able to use PHP5 PDO with MS Access mdb files the following is required (the same applies for the PHP4 style of using odbc_X except for the obviously PDO specific requirements):

PHP ODBC module

In Linux this is achieved by intalling the php5-odbc package:

@bramus
bramus / myservice
Created November 11, 2013 11:23
Running a PHP script as a service/daemon using `start-stop-daemon`
#! /bin/sh
# Installation
# - Move this to /etc/init.d/myservice
# - chmod +x this
#
# Starting and stopping
# - Start: `service myservice start` or `/etc/init.d/myservice start`
# - Stop: `service myservice stop` or `/etc/init.d/myservice stop`
@satooshi
satooshi / DirectoryStructure
Last active September 26, 2021 20:03
Directory structure of Domain Driven Design application with Symfony2, Doctrine2.
sf2-ddd
├── app
├── bin
├── build
├── lib
├── src
│   └── __VendorPrefix
│   ├── Application
│   │   └── __DomainNameBundle
│   │   ├── Command
@leoromanovsky
leoromanovsky / extract_sql.pl
Created March 11, 2012 06:59
Extract SQL tables from database dump
#!/usr/bin/perl -w
##############################################################################
##
## Written by: Jared Cheney <jared.cheney@gmail.com>
##
## Original Template written by:
## Brandon Zehm <caspian@dotconf.net> and Jared Cheney <elph@leph.net>
##
## License:
##