Skip to content

Instantly share code, notes, and snippets.

View sozercan's full-sized avatar
:shipit:
I may be slow to respond.

Sertaç Özercan sozercan

:shipit:
I may be slow to respond.
View GitHub Profile
@sozercan
sozercan / macos-sierra-commands.sh
Created July 7, 2016 21:13 — forked from ProfFrnswrth/macos-sierra-commands.sh
Updating to macOS Sierra Developer Preview 1 directly from Apple
## based on https://github.com/lioonline/OS-X-El-Capitan
## pkg file link - http://osxapps.itunes.apple.com/apple-assets-us-std-000001/Purple30/v4/cc/62/24/cc62243b-7ed7-74cd-d47e-374bc470ecdf/diu414781394017735583.pkg
# !!IMPORTANT!! Run this from folder where you have downloaded or copied diu414781394017735583.pkg file
#create a tmp folder
mkdir sierraRoot && cd sierraRoot
#create a folder structure to match apple server
sudo mkdir -p ./apple-assets-us-std-000001/Purple30/v4/cc/62/24/cc62243b-7ed7-74cd-d47e-374bc470ecdf/
@sozercan
sozercan / releaseFile
Created September 10, 2016 17:38
Release open file
#! /bin/bash
# This script will list all open processes for the given file and give you an option to quit them.
declare -a PROCS
s=$(fuser -f "$1")
PROCS=( $s )
if [ "${#PROCS[@]}" == 0 ] ; then
echo "File is not open."
else
@sozercan
sozercan / README.md
Created October 20, 2016 17:30 — forked from denvazh/README.md
Scheduled update for homebrew

Scheduled updates for homebrew

This two launchdaemon scripts provide scheduled updates and upgrade for homebrew packages.

It will run in the following way:

  • brew update every day at 12:10
  • brew upgrade every day at 12:20

How to install

@sozercan
sozercan / ffmpeg.sh
Created March 27, 2017 21:40
ffmpeg
ffmpeg -i hello-world_2.mp4 -vcodec libx264 -preset veryfast smaller.mp4
#!/bin/bash
nodes=$(kubectl get node -o name | grep -o 'k8s-agent-[0-9]*-[0-9]')
for node in $nodes; do
ssh -t -oStrictHostKeyChecking=no $node "echo 'Working on $node...' && curl -L -sf https://gist.githubusercontent.com/sozercan/e089f34fd148156facea27583c12e2e0/raw/bfe8bff079db695895935354ebef4c17dea25be9/autopart.sh | sudo bash"
done
@sozercan
sozercan / autopart.sh
Last active July 28, 2023 20:19 — forked from trentmswanson/autopart.sh
Linux bash script to partition and format all data disks in azure
#!/bin/bash
# An set of disks to ignore from partitioning and formatting
BLACKLIST="/dev/sda|/dev/sdb"
# Base directory to hold the data* files
DATA_BASE="/mnt"
usage() {
echo "Usage: $(basename $0) <new disk>"
}
hdiutil compact -puppetstrings -verbose <path_to.sparsebundle>
@sozercan
sozercan / create_encrypted_sparsebundle.sh
Created May 8, 2017 05:52
Create Encrypted Sparsebundle
#!/bin/bash
#
# 2010-11-08 - Garrett Honeycutt - code@garretthoneycutt.com
#
# Released under GPLv2
#
# Purpose: to create an encrypted sparsebundle
#
# Usage : create_encrypted_sparsebundle.sh <destination prefix> <size in GB>
# Example : create_encrypted_sparsebundle.sh ~/work 2
@sozercan
sozercan / autopart-vmss.sh
Created June 19, 2017 20:59
Azure VMSS auto partition
#!/bin/bash
ip="13.82.51.189"
ports=(50000 50003 50004)
for port in ${ports[@]}; do
ssh -t -oStrictHostKeyChecking=no $ip -p $port "echo 'Working on $port...' && curl -L -sf https://raw.githubusercontent.com/sozercan/acs-mount-managed-disk/master/autopart.sh | sudo bash"
done
#!/bin/bash
content=`cat /var/lib/dcos/mesos-slave-common | grep gpu -c`
if [ $content -gt 0 ]; then
apt-get update
apt-get install -y gcc
apt-get install -y make
apt-get install -qqy linux-headers-`uname -r`