Skip to content

Instantly share code, notes, and snippets.

View alvaromuir's full-sized avatar

Álvaro Muir alvaromuir

View GitHub Profile
@alvaromuir
alvaromuir / buildxnu.sh
Created July 29, 2014 04:05
Build xnu (Darwin) kernel script
#!/usr/bin/env bash
#############################################
# Builds the latest xnu (Darwin) kernel #
# create a directory to do this in first!!! #
# it cleans the downloaded files after #
# ya homie, @alvaromuir #
#############################################
export PATH="/usr/local/bin:$PATH"
@alvaromuir
alvaromuir / install_all_nerdfonts_via_homebrew.sh
Created November 12, 2022 19:56
Installas ALL nerdfonts via Homebrew on MacOS
#!/bin/sh
# Nerd Fonts for your IDE
# https://www.nerdfonts.com/font-downloads
brew tap homebrew/cask-fonts
brew install --cask font-3270-nerd-font font-fira-mono-nerd-font font-inconsolata-go-nerd-font font-inconsolata-lgc-nerd-font \
font-inconsolata-nerd-font font-monofur-nerd-font font-overpass-nerd-font font-ubuntu-mono-nerd-font font-agave-nerd-font \
for i in $(prompt -l | sed '1d' | sed 's/ /\n/g')
do
echo $i:
echo $(prompt -p $i) "\n\n"
done
@alvaromuir
alvaromuir / tensorflow_gpu_macos.txt
Created December 13, 2017 11:58
TensorFlow GPU 1.2+ on MacOS Sierra
# Xcode 8, cudnn 6.1, cuda 8.0,
# bazel 0.5.4, tensorflow r1.3
# takes about 36 min on macbook pro 2.8Ghz, 8GB RAM
# edit *tensorflow/third_party/gpus/cuda/BUILD.tpl*
# [#comment out] linkopts = [“-lgomp”]
$ export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib
$ export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH\nexport PATH=$DYLD_LIBRARY_PATH:$PATH \
export flags="--config=cuda --config=opt"
$ export CUDA_HOME=/usr/local/cuda
@alvaromuir
alvaromuir / connstat
Created January 28, 2017 23:38
Get connection status of supplied domain
netstat -nat | grep `nslookup {DOMAIN} | awk '/Address/ ' | sed 's/^.*Address: //p' | tail -1` | awk '{print $6}' | sort | uniq -c | sort -n
PS1="\n\u@\h: \[\e[1;36m\]\w\n\[\e[1;32m\]=> \[\e[0m\]"
alias ls='ls -G'
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
export DOCKER_HOST=tcp://192.168.59.103:2376
#!/bin/python3
"""
returns possible combinatations in a list
"""
def combo(n,k):
import itertools
return list(itertools.combinations(list(range((n-(n-1)),(n+1))),k))
@alvaromuir
alvaromuir / rPackages.r
Last active January 15, 2016 01:49
R Setup packages
# $ brew install unixodbc on mac
install.packages("devtools")
devtools::install_github("selva86/InformationValue")
install.packages(c("RODBC","RPostgreSQL","RSQLite","RMySQL",
"xlsx","XLConnect","foreign",
"dplyr","tidyr","stringr","lubridate","reshape",
"ggplot2","ggvis","rgl","htmlwidgets","googleVis","RColorBrewer",
@alvaromuir
alvaromuir / gist:8492876
Created January 18, 2014 16:39
Social Web App idea #MLKDreamCode
Yelp meets kickstarter for social good.
People should be able to post information and images about things they want to change in their community.
Requires social login to ensure the word is spread
Gamaified by karma points.
Gains attention of local governing bodies, community members, neighbors
@alvaromuir
alvaromuir / obj-c_marcos
Created January 5, 2014 17:10
Some common Objective-C Macros
#define PI 3.141592654
#define TWO_PI 2.0 * PI
#define SQUARE(x) ((x)*(x))
#define CUBE(x) ((x)*(x)*(x))
#define IS_LEAP_YEAR(y) y % 4 == 0 && y % 100 != 0 || y % 400 == 0
#define IS_LOWER_CASE(x) ( ((x) >= 'a') && ((x) <= 'z'))
#define TO_UPPER(x) (IS_LOWER_CASE(x) ? (x) - 'a' + 'A': (x))
#define INCHES_PER_CENT 0.394
#define CENT_PER_INCH (1/INCHES_PER_CENT)