Skip to content

Instantly share code, notes, and snippets.

View StudioEtrange's full-sized avatar
💫

StudioEtrange StudioEtrange

💫
View GitHub Profile
@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 drepper@gnu.org
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
#!/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};
@StudioEtrange
StudioEtrange / iterm2-solarized.md
Created November 1, 2017 13:23 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@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 / unix bash ownership user group.md
Last active January 31, 2018 14:28
Determine the user + group which has ownership of a binary
  • Determine the user + group which has ownership :
stat --format '%U:%G' "/bin/path"

ownership="$(stat --format '%U:%G' '/bin/path')"
  • Update ownership & right :
sudo lsof -i -n -P | grep TCP
@StudioEtrange
StudioEtrange / some docker root problem on a basic installation.md
Last active January 31, 2018 14:30
docker root problem on a basic installation
  • The user lauching alpine docker image is member of docker group. As he does not need sudo to use docker
sudo ls -al /root
drwx------  3 root root 4096 août   9  2015 .
drwxr-xr-x 25 root root 4096 févr. 11  2017 ..
-rw-r--r--  1 root root 3106 févr. 20  2014 .bashrc
-rw-r--r--  1 root root  140 févr. 20  2014 .profile
-rw-r--r-- 1 root root 36 janv. 5 2015 .smbcredentials
@StudioEtrange
StudioEtrange / gitlab expose web files with nginx.md
Last active January 31, 2018 14:35
gitlab expose web files (html, js, css) with nginx
server {
    listen 8000;
    index index.html index.htm;

# this map is defined in http section
# in /etc/nginx/nginx.conf
# map $uri $custom_content_type {
#                default "text/html";
# ~(.*\.html)$ "text/html";