Skip to content

Instantly share code, notes, and snippets.

View connectthefuture's full-sized avatar

justthefracts connectthefuture

  • Midwest usa
View GitHub Profile
@connectthefuture
connectthefuture / boot2docker-nfs.rb
Created July 28, 2020 03:59 — forked from mattes/boot2docker-nfs.rb
docker-machine/ boot2docker with NFS instead of vboxsf
#!/usr/bin/env ruby
# Usage
# $ docker-machine create my-machine123 -d virtualbox
# $ ruby <(curl -L https://git.io/vvvco) my-machine123
# https://gist.github.com/mattes/4d7f435d759ca2581347
require 'erb'
bootlocalsh = %Q(#/bin/bash
@connectthefuture
connectthefuture / wget_site.sh
Created June 20, 2020 16:47 — forked from LC43/wget_site.sh
download a site using wget
#!/bin/bash
function wget_site(){
## Remove protocol part of domain to add it to the allow list
# source : https://www.cyberciti.biz/faq/get-extract-domain-name-from-url-in-linux-unix-bash/
local url="$1"
local domain="$1"
domain="${domain#http://}"
domain="${domain#https://}"
domain="${domain#ftp://}"
domain="${domain#scp://}"
default vesamenu.c32
timeout 600
display boot.msg
.
.
.
# omit other than label section and text
label rescue
osx-10_11:~ vagrant$ /Library/Developer/CommandLineTools/usr/bin/clang -v
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.2.0
Thread model: posix
osx-10_11:~ vagrant$ echo | /Library/Developer/CommandLineTools/usr/bin/clang -v -E -x c -
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.2.0
Thread model: posix
"/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 253.9 -v -dwarf-column-info -resource-dir /Library/Developer/CommandLineTools/usr/bin/../lib/clang/7.0.2 -fdebug-compilation-dir /Users/vagrant -ferror-limit 19 -fmessage-length 116 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <[email protected]>
This program can be distributed under the terms of the GNU GPL.
See the file COPYING.
*/
/*
@connectthefuture
connectthefuture / pid2name.c
Created November 28, 2017 16:58 — forked from loderunner/pid2name.c
Retrieve process name from pid using sysctl (Darwin)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/sysctl.h>
int main(int argc, char** argv) {
int mib[3], argmax;
size_t syssize;
char *procargs, *cp, *thiscmd;
@connectthefuture
connectthefuture / mac-profiling.md
Created November 28, 2017 16:57 — forked from zchee/mac-profiling.md
Profiling an application in Mac OS X

Profiling an application in Mac OS X

Finding which process to profile

If your system is running slowly, perhaps a process is using too much CPU time and won't let other processes run smoothly. To find out which processes are taking up a lot of CPU time, you can use Apple's Activity Monitor.

The CPU pane shows how processes are affecting CPU (processor) activity:

@connectthefuture
connectthefuture / profile.py
Created November 28, 2017 16:56 — forked from zchee/profile.py
Simple little profiling decorator in python.
import cProfile
def profile_this(fn):
def profiled_fn(*args, **kwargs):
# name for profile dump
fpath = fn.__name__ + '.profile'
prof = cProfile.Profile()
ret = prof.runcall(fn, *args, **kwargs)
prof.dump_stats(fpath)
@connectthefuture
connectthefuture / sysctl.darwin.md
Created November 28, 2017 16:51 — forked from zchee/sysctl.darwin.md
sysctl(3) Darwin Kernel Version 15.2.0

from man page

> uname -asnrvmpio
Darwin zchee-darwin-amd64.local 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:43:59 PST 2015; root:xnu-3248.20.55~1/RELEASE_X86_64 x86_64 i386 MacBookPro11,3 Darwin

> sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.2
BuildVersion: 15C47a
@connectthefuture
connectthefuture / build-llvm.bash
Created November 28, 2017 16:48 — forked from zchee/build-llvm.bash
Build llvm for OS X
#!/bin/bash
set -e
# Building LLVM on OSX CMake setup script
#
# Required:
# - clang by Xcode6 or later
# - cmake
# - ninja
#