Skip to content

Instantly share code, notes, and snippets.

Avatar
🕶️

Nathan L Smith smith

🕶️
View GitHub Profile
View gist:24ab89d6c97548bed3f9907c551bf57b
# From running `shellcheck --exclude=SC1090,SC1091,SC2034,SC2039,SC2148,SC2153,SC2154 dotnet-core/plan.sh powershell/plan.sh`:
In dotnet-core/plan.sh line 38:
-exec patchelf --interpreter "$(pkg_path_for glibc)/lib/ld-linux-x86-64.so.2" --set-rpath $LD_RUN_PATH {} \;
^-- SC2086: Double quote to prevent globbing and word splitting.
In dotnet-core/plan.sh line 40:
-exec patchelf --set-rpath $LD_RUN_PATH {} \;
^-- SC2086: Double quote to prevent globbing and word splitting.
View gist:aaa8142379361020779aaa7a108c8835
[106][default:/hab/pkgs/smith/dotnet-core/1.0.0-preview2-003121/20160723182725/shared/Microsoft.NETCore.App/1.0.0:0]# ldd *.so
System.Globalization.Native.so:
linux-vdso.so.1 (0x00007fffe695b000)
libicuuc.so.50 => not found
libicui18n.so.50 => not found
libstdc++.so.6 => not found
libm.so.6 => /hab/pkgs/core/glibc/2.22/20160612063629/lib/libm.so.6 (0x00007fa84cb83000)
libgcc_s.so.1 => not found
libc.so.6 => /hab/pkgs/core/glibc/2.22/20160612063629/lib/libc.so.6 (0x00007fa84c7df000)
/hab/pkgs/core/glibc/2.22/20160612063629/lib64/ld-linux-x86-64.so.2 (0x0000564019dd1000)
@smith
smith / habitat-notes.md
Last active Aug 25, 2017
Habitat Notes
View habitat-notes.md

Habitat Notes

Things I'm learning while using Habitat, written down so I remember them.

Cache artifacts in a Mac studio

export HAB_DOCKER_OPTS="-v /Users/nathansmith/.hab/cache/artifacts /hab/studios/src/hab/cache/artifacts"

Find reverse dependencies for a package

View build.rb
require "excon"
require "platform-api"
require "pry"
app = "smith-fronty"
heroku = PlatformAPI.connect_oauth("abcdefg")
`rm -f #{ENV['HOME']}/app.tar.gz && cd #{ENV['HOME']}/Projects/railsconf_fronty && tar cfz #{ENV['HOME']}/app.tar.gz *`
source = heroku.source.create(app)
@smith
smith / iee754
Created Apr 8, 2016
ieee 754 lol
View iee754
nathansmith@opstop ~> pry
[1] pry(main)> 0.1 + 0.2
=> 0.30000000000000004
[2] pry(main)>
nathansmith@opstop ~> python
Python 2.7.4 (default, May 6 2013, 00:06:59)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 0.1 + 0.2
0.30000000000000004
@smith
smith / GravatarComponent.ts
Last active May 9, 2017
Gravatar Component for Angular 2
View GravatarComponent.ts
import {Component} from "angular2/core";
const md5 = require("blueimp-md5");
@Component({
selector: "gravatar",
inputs: ["defaultStyle", "email", "size"],
template: `
<img class="my-gravatar"
width="{{size || DEFAULT_SIZE}}" height="{{size || DEFAULT_SIZE}}"
src='{{gravatarUrl(defaultStyle, email, size)}}'>`
@smith
smith / load.rb
Last active Oct 16, 2015
Greenspun's tenth rule
View load.rb
# See https://github.com/coderanger/chef-dialects-testbed, https://github.com/chef/chef-rfc/blob/master/rfc036-dialects.md
require "edn"
require "json"
open("recipe.rb", "w") do |f|
EDN.read("(#{open('recipe.edn').read})").each do |resource|
type = resource.shift.to_s
name = resource.shift.to_s
properties = resource.shift || {}
@smith
smith / version-manifest.txt
Created Mar 25, 2015
Example Supermarket Version Manifest
View version-manifest.txt
supermarket 1.7.0-alpha.0
Component Installed Version Version GUID Overridden From
--------------------------------------------------------------------------------------------------------------
berkshelf master git:3d4b5971f86dd7927d198a1acdaf13c33e867179
bundler 1.7.3 1.5.3
bzip2 1.0.6 md5:00b516f4704d4a7cb50a1d97e6e8e15b
cacerts 2014.08.20 md5:c9f4f7f4d6a5ef6633e893577a09865e 2014.09.03
curl 7.36.0 md5:643a7030b27449e76413d501d4b8eb57
dep-selector-libgecode 1.0.2
View lc-notes.md
  1. get a vm 4:11 - 4:14
  2. configure a resource 4:14 - 4:23
  • Running the terminal in a different window is weird, especially since it's a browser window and not my terminal and I have to keep context-switching in between the two.
  • It tells me to create a file and edit its contents and save it, which assumes that I know how to do all of these things from a unix shell or a linux desktop. If you're running in the console you can do gedit hello.rb & which gives a nice editor. Maybe we should make this the default.
  • It says, "From your terminal window, run chef-apply to apply what you've written.", but below it says to run "chef-apply hello.rb". If you just run chef-apply, you get "TypeError: no implicit conversion of nil into String", which isn't very friendly. The commands should match and the error output should say something that makes sense.
  1. configure a package and a service 4:24 - 4:30
  • Maybe the desktop should just have the icons for the things we're using on it
@smith
smith / gem_make.out
Created May 21, 2014
Output of build of dep-selector-libgecode on CentOS 5.8
View gem_make.out
/opt/chef/embedded/bin/ruby extconf.rb
-> sh /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libgecode-1.0.0/ext/libgecode3/vendor/gecode-3.7.3/configure --prefix=/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libgecode-1.0.0/lib/dep-selector-libgecode/vendored-gecode --disable-doc-dot --disable-doc-search --disable-doc-tagfile --disable-doc-chm --disable-doc-docset --disable-qt --disable-examples --disable-flatzinc
checking for the host operating system... Linux
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++44 accepts -g... yes