Skip to content

Instantly share code, notes, and snippets.

@StudioEtrange
StudioEtrange / getopt.c
Last active August 29, 2015 14:22 — forked from ashelly/getopt.c
/* Getopt for GNU.
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to [email protected]
before changing it!
Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@StudioEtrange
StudioEtrange / uninstall_homebrew.sh
Last active August 29, 2015 14:27 — forked from mxcl/uninstall_homebrew.sh
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@StudioEtrange
StudioEtrange / Apple MacOS Finder show Hidden Files switch.md
Last active January 31, 2018 14:40
Apple MacOS -- Finder show Hidden Files switch
#!/bin/bash

val=$(defaults read com.apple.Finder AppleShowAllFiles)

if [ "$val" == "1" ]; then
	defaults write com.apple.Finder AppleShowAllFiles -string 0
	killall Finder
fi
@StudioEtrange
StudioEtrange / MacOS X El Capitan with Vagrant - MacOS X VM on Windows or Linux.md
Last active March 27, 2026 23:34
MacOS X El Capitan in a VM with Vagrant on Windows/Linux
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
#!/usr/bin/perl
use strict;
use warnings;
my $numArgs = $#ARGV + 1;
my @types = qw/nat mangle filter/;
if ($numArgs > 0) {@types = @ARGV;}
$SIG{INT} = sub{print "\e[?25h\e[u"; exit};
# from https://github.com/WonderBeat/docker-archive/blob/master/firehol.conf
# FireHOL config file with docker tunnel 
# 
#  eth0 (World) <-> FireHOL <->
#                               <-> Docker
#  tun0 (Internal VPN)      <->
#
version 5
server_ssh_ports="tcp/222"
sudo lsof -i -n -P | grep TCP
@StudioEtrange
StudioEtrange / treegen.sh
Created January 25, 2018 02:51 — forked from pravj/treegen.sh
bash script to generate tree structure of a directory
#!/usr/bin/env bash
# bash script to generate tree structure of a directory
# Pravendra Singh (@hackpravj)
pwd=$(pwd)
find $pwd -print | sed -e "s;$pwd;\.;g;s;[^/]*\/;|__;g;s;__|; |;g"
@StudioEtrange
StudioEtrange / github-pr-stat.sh
Created January 31, 2018 14:44
Will scan a github repo to compute some statistics on PR
#!/usr/bin/env bash
# Will scan a github repo to compute some statistics on PR
# requires curl and bc (presents on most unix like system)
# PARAMETERS ----------------------------
# Github repo to scan
GITHUB_REPO="status-im/status-react"