Thanks to visit codestin.com
Credit goes to gist.github.com

Skip to content

Instantly share code, notes, and snippets.

@holygrolli
holygrolli / Installation.md
Created November 28, 2019 14:49 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@holygrolli
holygrolli / img.php
Last active June 15, 2019 14:37
Hacking "Responsify WP" (v1.9.11) plugin to support lazysizes JS, see https://blog.networkchallenge.de/tech/wordpress-divi-speedup/
<?php
class Img extends Create_Responsive_image
{
public $markup;
public $attributes;
function __construct( $id, $settings )
{
parent::__construct( $id, $settings );
$this->set_attributes();
@holygrolli
holygrolli / Jenkinsfile
Created May 15, 2019 01:57
Jenkins declarative scheduled job executed only once
import com.cloudbees.groovy.cps.NonCPS
@NonCPS
def isStartedByTimer(build) {
def buildCauses = build?.getCauses()
boolean isStartedByTimer = false
for (buildCause in buildCauses) {
if ("${buildCause}".contains("hudson.triggers.TimerTrigger\$TimerTriggerCause")) {
isStartedByTimer = true
@holygrolli
holygrolli / docker-compose.yml
Last active September 23, 2018 16:26
Connect to MongoDB (Atlas) behind a corporate firewall, see description at https://blog.networkchallenge.de/post/mongodb_verbindung_hinter_firewall/
version: '2.1'
services:
mongodb:
image: mongo:3.6
mem_limit: 32M
restart: unless-stopped
command: "tail -f /dev/null"
extra_hosts:
- "your-shard-00.gcp.mongodb.net:172.16.238.17"
- "your-shard-01.gcp.mongodb.net:172.16.238.18"
@holygrolli
holygrolli / curl_all.sh
Last active August 19, 2018 11:34
Simply test all website resources for random errors, see description at https://blog.networkchallenge.de/post/website_url_test/
#!/bin/bash
while read LINE; do
echo -n "$(date +%H:%M:%S) "
curl -o /dev/null --silent --progress-bar --head --write-out '%{http_code} %{time_starttransfer} %{url_effective}\n' "$LINE"
done < $1
@holygrolli
holygrolli / gist:8e6209af08a7ce1fc4e55943e330ea4b
Created November 12, 2017 22:48
Create a cross plattform Go patch release
winpty docker run -it --rm golang bash
go get github.com/awslabs/aws-sam-local
cd /usr/src
git clone https://github.com/adulescentulus/aws-sam-local.git
git clone https://github.com/PaulMaddox/aws-sam-local.git additional_patch
cd additional_patch
git checkout BRANCH_FIX
git format-patch -1 HEAD
cd ../aws-sam-local
git apply ../additional_patch/0001-fix.patch