Skip to content

Instantly share code, notes, and snippets.

View hayderimran7's full-sized avatar

Imran Hayder hayderimran7

View GitHub Profile

Apple's Swift team has an opening for a DevOps engineer! If you are interested, please email: swift-job-apply@group.apple.com

Job Summary

Are you excited about Swift? Imagine what you could do for software development as a member of the Swift team at Apple, where you will have an opportunity to make an impact on both the Swift open source community and on Apple's developer tools products!

As a DevOps quality engineer on the Swift team, you will help engineer solutions to enable better development processes and raise the bar on the quality of the Swift compiler, both as a component of Xcode, and as an open source project. This team architects and maintains a large continuous integration (Jenkins) and automation system, so experience with scaling an infrastructure and automation is highly desired. This role also requires stellar communication, collaboration, and organization skills. The successful candidate is also highly motivated and proactive, detail-oriented, and has a passion for seeking ever hig

@kflorence
kflorence / cart-mysql.sql
Last active October 26, 2017 17:54
sample mysql interview questions
drop table if exists customer;
create table customer(
id int auto_increment primary key,
first_name varchar(96) not null,
last_name varchar(96) not null,
address_id int not null
);
insert into customer (first_name, last_name, address_id) values ('john', 'doe', 1);
insert into customer (first_name, last_name, address_id) values ('jane', 'doe', 2);
@heyimalex
heyimalex / runtime-env-build.js
Created June 7, 2017 22:28
create-react-app build script with optional runtime env var injection
const fs = require("fs");
const crypto = require("crypto");
const spawnSync = require("child_process").spawnSync;
// Load the environment using the same code react-scripts uses.
process.env.NODE_ENV = "production";
const clientEnv = require("react-scripts/config/env")().raw;
const REACT_APP_RUNTIME = /^REACT_APP_RUNTIME_/i;
@mowings
mowings / masq.sh
Last active September 25, 2023 20:00
script to get xet xhyve working with all vpn interfaces
#!/bin/bash
interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) )
rulefile="rules.tmp"
echo "" > $rulefile
sudo pfctl -a com.apple/tun -F nat
for i in "${interfaces[@]}"
do
RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}"
echo $RULE >> $rulefile
done
@greyli
greyli / app.py
Last active February 25, 2024 03:04
Photo upload and manage with Flask and Flask-Uploads (Multiple file upload support!).
# -*- coding: utf-8 -*-
import os
import uuid
from flask import Flask, render_template, redirect, url_for, request
from flask_uploads import UploadSet, configure_uploads, IMAGES, patch_request_class
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileRequired, FileAllowed
from wtforms import SubmitField
@codesword
codesword / minikube.md
Last active October 31, 2019 21:27
Installing minikube using xhyve driver

###Install docker-machine-driver-xhyve docker-machine-driver-xhyve is a docker machine driver plugin for xhyve native OS X Hypervisor. xhyve is a lightweight OS X virtualization solution. In my opinion, it's a far better option than virtualbox for running minikube. ####Brew On MacOS sierra, download latest using

brew install docker-machine-driver-xhyve --HEAD
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active May 5, 2024 10:12
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@mfischer-zd
mfischer-zd / initialize_vault
Created June 8, 2016 13:47
Hashicorp Vault initialization script
#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
from prompt_toolkit import prompt
from prompt_toolkit.validation import Validator, ValidationError
from socket import getfqdn
import hvac
import sys
import os
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active May 6, 2024 20:49
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
import sys, marshal, functools, subprocess
child_script = """
import marshal, sys, types;
fn, args, kwargs = marshal.load(sys.stdin)
marshal.dump(
types.FunctionType(fn, globals())(*args, **kwargs),
sys.stdout)
"""