Skip to content

Instantly share code, notes, and snippets.

View barakm's full-sized avatar

Barak Merimovich barakm

View GitHub Profile
@barakm
barakm / encode_fast.sh
Created June 11, 2021 12:33
Command line to re-encode mp3 files with faster playback using ffmpeg
for f in *.mp3; do ffmpeg -i "$f" -filter:a "atempo=2" fast/"$f"; done
#/bin/bash
# script to set up a Kind Kubernetes on local machine, configured with no authentication and dashboard with TLS disabled.
# Download this script to an empty directory, and execute with
#
# chmod +x kind_always_allow_with_dashboard.sh; ./kind_always_allow_with_dashboard.sh
echo Installing components
brew install kind kubectl helm
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
@barakm
barakm / kind-config-always-allow.yaml
Created July 20, 2020 07:18
Kubernetes Kind configuration with no authentication or authorisation
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatchesJSON6902:
- group: kubeadm.k8s.io
version: v1beta2
kind: ClusterConfiguration
patch: |
- op: add
@barakm
barakm / Cloud_Node_Monitor_Quickbuild_Configuration.xml
Created April 25, 2015 20:49
Quickbuild configuration export for a mist.io based cloud node monitor.
<?xml version="1.0" encoding="UTF-8"?>
<com.pmease.quickbuild.model.Configuration>
<id>26252</id>
<disabled>false</disabled>
<parent>22065</parent>
<name>CloudNodeMonitor</name>
<description>Creates an XML with entries for all of the running cloud nodes in R&amp;D Accounts, across supported clouds</description>
<buildCondition class="com.pmease.quickbuild.setting.configuration.buildcondition.AlwaysBuild"/>
<schedule class="com.pmease.quickbuild.taskschedule.schedule.PeriodicalSchedule">
@barakm
barakm / mist_setup_for_aws.py
Last active August 29, 2015 14:15
Mist backend setup for AWS
from mistclient import MistClient
client = MistClient(email="MY_MIST_EMAIL", password="MY_MIST_PASSWORD")
ec2_demo_access_key ="AWS_ACCESS_KEY"
ec2_demo_secret_key = "AWS_SECRET_KEY"
ec2_account_name = "AWS_ACCOUNT_NAME"
def create_ec2_backends():
# creates backends for all ec2 regions
for provider in client.supported_providers:
@barakm
barakm / mist_setup_for_hp.py
Last active August 29, 2015 14:15
mist.io HP Cloud setup
from mistclient import MistClient
client = MistClient(email="MY_MIST_EMAIL", password="MY_MIST_PASSWORD")
hp_username="HP_CLOUD_USERNAME"
hp_password="HP_CLOUD_PASSWORD"
hp_regions = [
["hpcloud:region-a.geo-1", "HP - US West"],
["hpcloud:region-b.geo-1", "HP - US East"]
]
@barakm
barakm / gist:7220556
Created October 29, 2013 18:58
Create an HttpClient that accepts all certificates and host names. Useful for working with self-signed certificates. Use only with HTTPS servers that you trust.
private DefaultHttpClient getSSLHttpClient(final URL url) throws RestClientException {
try {
final X509TrustManager trustManager = createTrustManager();
SSLContext ctx = SSLContext.getInstance("TLS");
ctx.init(null, new TrustManager[]{trustManager}, null);
SSLSocketFactory ssf = new SSLSocketFactory(ctx, createHostnameVerifier());
AbstractHttpClient base = new DefaultHttpClient();
ClientConnectionManager ccm = base.getConnectionManager();
SchemeRegistry sr = ccm.getSchemeRegistry();
sr.register(new Scheme(HTTPS, url.getPort(), ssf));