From 0673b923c2774bbf18782f2ad7345a0fc0422c58 Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Fri, 9 Jun 2023 22:39:35 -0700 Subject: [PATCH] init --- .gitignore | 6 + 404.html | 6 + Gemfile | 33 +++ Gemfile.lock | 84 +++++++ _config.yml | 47 ++++ _layouts/default.html | 18 ++ _layouts/index.html | 9 + _layouts/post.html | 16 ++ _posts/2007-12-12-mel-notepad.md | 129 +++++++++++ _posts/2009-04-23-bash-imageslice.md | 55 +++++ _posts/2009-06-12-mel-sphere_intersect.md | 70 ++++++ .../2010-01-11-bash-rename_multiple_files.md | 9 + _posts/2010-02-07-bash-date_for_filename.md | 12 + ...010-05-15-bash-rewrite_multiple_slashes.md | 11 + _posts/2010-07-07-maya_render_bat.md | 209 ++++++++++++++++++ .../2010-07-11-bash-resize_multiple_images.md | 7 + _posts/2011-02-02-bash_profile_osx.md | 43 ++++ _posts/2011-03-11-bash_profile_linux.md | 12 + _posts/2011-04-16-ssh_keys.md.md | 15 ++ _posts/2011-04-27-windows_copy.md | 17 ++ _posts/2011-05-10-osx_hidden_files.md | 20 ++ _posts/2011-05-24-clmpr.md | 14 ++ _posts/2011-06-28-filebrowser.md | 9 + _posts/2011-07-07-bootable_iso.md | 24 ++ _posts/2011-08-11-terminal_emulator_on_win.md | 91 ++++++++ _posts/2011-09-19-mostused.md | 34 +++ _posts/2011-11-09-osx_command_line_audio.md | 47 ++++ _posts/2011-11-14-osx_print_json.md | 29 +++ _posts/2012-01-02-archlinux_install.md | 116 ++++++++++ _posts/2013-04-19-htmlwordcount.md | 31 +++ index.md | 5 + 31 files changed, 1228 insertions(+) create mode 100644 .gitignore create mode 100644 404.html create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 _config.yml create mode 100644 _layouts/default.html create mode 100644 _layouts/index.html create mode 100644 _layouts/post.html create mode 100644 _posts/2007-12-12-mel-notepad.md create mode 100644 _posts/2009-04-23-bash-imageslice.md create mode 100644 _posts/2009-06-12-mel-sphere_intersect.md create mode 100644 _posts/2010-01-11-bash-rename_multiple_files.md create mode 100644 _posts/2010-02-07-bash-date_for_filename.md create mode 100644 _posts/2010-05-15-bash-rewrite_multiple_slashes.md create mode 100644 _posts/2010-07-07-maya_render_bat.md create mode 100644 _posts/2010-07-11-bash-resize_multiple_images.md create mode 100644 _posts/2011-02-02-bash_profile_osx.md create mode 100644 _posts/2011-03-11-bash_profile_linux.md create mode 100644 _posts/2011-04-16-ssh_keys.md.md create mode 100644 _posts/2011-04-27-windows_copy.md create mode 100644 _posts/2011-05-10-osx_hidden_files.md create mode 100644 _posts/2011-05-24-clmpr.md create mode 100644 _posts/2011-06-28-filebrowser.md create mode 100644 _posts/2011-07-07-bootable_iso.md create mode 100644 _posts/2011-08-11-terminal_emulator_on_win.md create mode 100644 _posts/2011-09-19-mostused.md create mode 100644 _posts/2011-11-09-osx_command_line_audio.md create mode 100644 _posts/2011-11-14-osx_print_json.md create mode 100644 _posts/2012-01-02-archlinux_install.md create mode 100644 _posts/2013-04-19-htmlwordcount.md create mode 100644 index.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fdda7be --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +_site +.sass-cache +.jekyll-cache +.jekyll-metadata +vendor +.DS_Store diff --git a/404.html b/404.html new file mode 100644 index 0000000..301f6e4 --- /dev/null +++ b/404.html @@ -0,0 +1,6 @@ +--- +permalink: /404.html +layout: default +--- + +404 \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..ff2c342 --- /dev/null +++ b/Gemfile @@ -0,0 +1,33 @@ +source "https://rubygems.org" +# Hello! This is where you manage which Jekyll version is used to run. +# When you want to use a different version, change it below, save the +# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: +# +# bundle exec jekyll serve +# +# This will help ensure the proper Jekyll version is running. +# Happy Jekylling! +gem "jekyll", "~> 4.3.2" +# This is the default theme for new Jekyll sites. You may change this to anything you like. +gem "minima", "~> 2.5" +# If you want to use GitHub Pages, remove the "gem "jekyll"" above and +# uncomment the line below. To upgrade, run `bundle update github-pages`. +# gem "github-pages", group: :jekyll_plugins +# If you have any plugins, put them here! +group :jekyll_plugins do + gem "jekyll-feed", "~> 0.12" +end + +# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem +# and associated library. +platforms :mingw, :x64_mingw, :mswin, :jruby do + gem "tzinfo", ">= 1", "< 3" + gem "tzinfo-data" +end + +# Performance-booster for watching directories on Windows +gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] + +# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem +# do not have a Java counterpart. +gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby] diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..6eb43ce --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,84 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.4) + public_suffix (>= 2.0.2, < 6.0) + colorator (1.1.0) + concurrent-ruby (1.2.2) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + eventmachine (1.2.7) + ffi (1.15.5) + forwardable-extended (2.6.0) + google-protobuf (3.23.2-arm64-darwin) + http_parser.rb (0.8.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + jekyll (4.3.2) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 1.0) + jekyll-sass-converter (>= 2.0, < 4.0) + jekyll-watch (~> 2.0) + kramdown (~> 2.3, >= 2.3.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (>= 0.3.6, < 0.5) + pathutil (~> 0.9) + rouge (>= 3.0, < 5.0) + safe_yaml (~> 1.0) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) + jekyll-feed (0.17.0) + jekyll (>= 3.7, < 5.0) + jekyll-sass-converter (3.0.0) + sass-embedded (~> 1.54) + jekyll-seo-tag (2.8.0) + jekyll (>= 3.8, < 5.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.4) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.4.0) + minima (2.5.1) + jekyll (>= 3.5, < 5.0) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (5.0.1) + rb-fsevent (0.11.2) + rb-inotify (0.10.1) + ffi (~> 1.0) + rexml (3.2.5) + rouge (4.1.2) + safe_yaml (1.0.5) + sass-embedded (1.63.3-arm64-darwin) + google-protobuf (~> 3.23) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.4.2) + webrick (1.8.1) + +PLATFORMS + arm64-darwin-21 + +DEPENDENCIES + http_parser.rb (~> 0.6.0) + jekyll (~> 4.3.2) + jekyll-feed (~> 0.12) + minima (~> 2.5) + tzinfo (>= 1, < 3) + tzinfo-data + wdm (~> 0.1.1) + +BUNDLED WITH + 2.3.26 diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..b3d52e8 --- /dev/null +++ b/_config.yml @@ -0,0 +1,47 @@ +# Welcome to Jekyll! +# +# This config file is meant for settings that affect your whole blog, values +# which you are expected to set up once and rarely edit after that. If you find +# yourself editing this file very often, consider using Jekyll's data files +# feature for the data you need to update frequently. +# +# For technical reasons, this file is *NOT* reloaded automatically when you use +# 'bundle exec jekyll serve'. If you change this file, please restart the server process. +# +# If you need help with YAML syntax, here are some quick references for you: +# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml +# https://learnxinyminutes.com/docs/yaml/ +# +# Site settings +# These are used to personalize your new site. If you look in the HTML files, +# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. +# You can create any custom variable you would like, and they will be accessible +# in the templates via {{ site.myvariable }}. + +title: quilime.com +baseurl: "" # the subpath of your site, e.g. /blog +url: "https://quilime.com" # the base hostname & protocol for your site, e.g. http://example.com +permalink: /:categories/:title:output_ext +# Build settings +plugins: + - jekyll-feed + +# Exclude from processing. +# The following items will not be processed, by default. +# Any item listed under the `exclude:` key here will be automatically added to +# the internal "default list". +# +# Excluded items can be processed by explicitly listing the directories or +# their entries' file path in the `include:` list. +# +# exclude: +# - .sass-cache/ +# - .jekyll-cache/ +# - gemfiles/ +# - Gemfile +# - Gemfile.lock +# - node_modules/ +# - vendor/bundle/ +# - vendor/cache/ +# - vendor/gems/ +# - vendor/ruby/ diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 0000000..e5ed477 --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,18 @@ + + + + + {{ page.title }} + + + + + +
+ {{ content }} +
+ + + \ No newline at end of file diff --git a/_layouts/index.html b/_layouts/index.html new file mode 100644 index 0000000..cffb29e --- /dev/null +++ b/_layouts/index.html @@ -0,0 +1,9 @@ +--- +layout: default +--- + +{% for post in site.posts %} +
  • + {{ post.title }} +
  • +{% endfor %} diff --git a/_layouts/post.html b/_layouts/post.html new file mode 100644 index 0000000..b7b4859 --- /dev/null +++ b/_layouts/post.html @@ -0,0 +1,16 @@ +--- +layout: default +--- + +

    {{ page.title }}

    + +
    +{{content}} +
    + +tags + \ No newline at end of file diff --git a/_posts/2007-12-12-mel-notepad.md b/_posts/2007-12-12-mel-notepad.md new file mode 100644 index 0000000..4d4ba77 --- /dev/null +++ b/_posts/2007-12-12-mel-notepad.md @@ -0,0 +1,129 @@ +--- +date: 2007-12-12 +title: MEL Notepad +tags: mel maya +layout: post +--- + +mel notepad with various code snippets + + + +process selection list +
    string $select[] = `ls -sl`;
    +for ( $node in $select ) // process each
    +{
    +   /* ... */
    +}
    +
    + +
    + +if node exists +
    +string $node = "object";
    +if ( `objExists $node` )
    +{
    +   // The node exists
    +}
    +
    + +

    regexp

    + +Strip component +
    +string $node = "pCube1.f[2]";
    +string $no_component = `match "^[^\.]*" $node`;
    +// Result: "pCube1" //
    +
    + + + +
    +Extract component or attribute, with '.' +
    +string $node = "pCube1.f[2]";
    +string $component = `match "\\..*" $node`;
    +// Result: ".f[2]" //
    +
    +string $nodeAttr = "blinn1.color";
    +string $attrName = `match "\\..*" $nodeAttr`;
    +// Result: ".color" //
    +
    + +
    +Extract attribute name, without '.' + +
    +string $node = "pCube1.f[2]";
    +string $component = `substitute "^[^.]*\\." $node ""`;
    +// Result: "f[2]" //
    +
    +string $nodeAttr = "blinn1.color";
    +string $attrName = `substitute "^[^.]*\\." $nodeAttr ""`;
    +// Result: "color" //
    +
    + +
    +Extract parent UI control from full path +
    +string $uiControl = "OptionBoxWindow|formLayout52|formLayout55|button6";
    +string $uiParent = `substitute "|[^|]*$" $uiControl ""`;
    +// Result: OptionBoxWindow|formLayout52|formLayout55 //
    +
    + +
    +Strip trailing Line Break (\n), if any.

    This is useful when processing text input read from a file using `fgetline`. +
    +string $input = "line\n";
    +$string $line = `match "^[^(\r\n)]*" $input`;
    +// Result: "line" //
    +
    + +
    +Extract directory from path. +

    +Keep the trailing slash for ease of use. +
    +string $path = "C:/AW/Maya5.0/bin/maya.exe";
    +string $dir = `match "^.*/" $path`;
    +// Result: "C:/AW/Maya5.0/bin/"
    +
    + +
    +Extract file from path +
    +string $path = "C:/AW/Maya5.0/bin/maya.exe";
    +string $filepart = `match "[^/\\]*$" $path`;
    +// Result: "maya.exe"
    +
    + +
    +Strip numeric suffix +
    +
    +string $node = "pCube1|pCubeShape223";
    +string $noSuffix = `match ".*[^0-9]" $node`;
    +// Result: "pCube1|pCubeShape"
    +
    + +
    +Extract numeric suffix +
    +string $node = "pCube1|pCubeShape223";
    +string $suffix = `match "[0-9]+$" $node`;
    +// Result: "223" //
    +
    + +
    +Extract short name of DAG or control path +
    +string $dagPath = "pCube1|pCubeShape223";
    +string $shortName = `match "[^|]*$" $dagPath`;
    +// Result: pCubeShape223 //
    +
    + +

    other reference

    + diff --git a/_posts/2009-04-23-bash-imageslice.md b/_posts/2009-04-23-bash-imageslice.md new file mode 100644 index 0000000..5515ece --- /dev/null +++ b/_posts/2009-04-23-bash-imageslice.md @@ -0,0 +1,55 @@ +--- +title: Image Slice +date: 2009-04-23 +tags: bash script slice image imagemagick +lang: bash +layout: post +--- + +Shell script that slices a single image into any number of vertical and horizontal sections. + + + +
    #!/bin/bash
    +#@author  gabriel dunne <quilime.com>
    +
    +IMAGE=$1
    +IMAGE_W=$2
    +IMAGE_H=$3
    +ROWS=$4
    +COLS=$5
    +
    +if [ $# -eq 0 ]
    +then
    +	echo "usage: image width height rows cols"
    +	echo "example: ./slice.sh Sunset.jpg 800 600 16 16"
    +	exit
    +else
    +
    +	for (( x = 1; x <= COLS; x++ ))
    +	do
    +	    for (( y = 1 ; y <= ROWS; y++ ))
    +	    do
    +	    	let CROP_X = `expr $IMAGE_W-IMAGE_W/$x`
    +	    	let CROP_Y = `expr $IMAGE_H-IMAGE_H/$y`
    +	    	let CROP_W = `expr $IMAGE_W/$ROWS`
    +	    	let CROP_H = `expr $IMAGE_H/$COLS`
    +	        echo -n "crop ${CROP_W}x${CROP_H}+${CROP_X}+${CROP_Y} result: [${x},${y}]_$IMAGE"
    +	        echo ""
    +			convert $IMAGE -crop ${CROP_W}x${CROP_H}+${CROP_X}+${CROP_Y} [${x},${y}]_$IMAGE
    +	    done
    +	done
    +	
    +fi
    +
    + + + +##To Use +navigate to slice.sh in your terminal and do +
    chmod +x slice.sh
    +./slice.sh Sunset.jpg 800 600 16 16
    +replace **Sunset.jpg** with your image name. +params: **Image Height, Image Width, Vertical Divisions, Horizontal Divisions** + +
    diff --git a/_posts/2009-06-12-mel-sphere_intersect.md b/_posts/2009-06-12-mel-sphere_intersect.md new file mode 100644 index 0000000..dcb2e23 --- /dev/null +++ b/_posts/2009-06-12-mel-sphere_intersect.md @@ -0,0 +1,70 @@ +--- +date: 2009-06-12 +title: "Sphere Intersect in Maya/MEL" +tags: maya mel sphere intersection +lang: mel +layout: post +--- +

    +Function to return location of intersect with poly mesh and spherical object moving in the positive direction on the Y axis. +
    +

    + + + +

    +mel source +

    +
    global proc intersectSphereY()
    +{
    +	print(". . . . . go go go\n");
    +
    +	int $iter = 50;
    +	float $start[3] = {0, -0.5, 0};
    +	float $limit[3] = {0, 5.0, 0};
    +    	$mesh = "test_mesh";    
    +	$tmpCN = "cpom";
    +
    +    
    +	$obj = "rod1";
    +    	float $radius = 0.5;
    +    	float $curPos[3] = {0, 0, 0};
    +
    +	for ($i = 0; $i <= $iter; $i++)
    +	{    
    +       	$mesh = "test_mesh";
    +		$shape = `listRelatives -shapes $mesh`;
    +
    +		createNode -n $tmpCN closestPointOnMesh;
    +       	connectAttr -f ($shape[0] + ".outMesh") ($tmpCN + ".inMesh");
    +       	setAttr ($tmpCN + ".inPosition") $curPos[0] $curPos[1] $curPos[2];
    +        	
    +		$cpom = `getAttr ($tmpCN + ".position")`;
    +        	
    +        if ( pointDist($curPos, $cpom) <= $radius ) {
    +		   	return ". . bonk\n";
    +        }
    +
    +       	$curPos[1] = ($limit.y) / $iter * $i;
    +       	setAttr ($obj + ".translateY") $curPos[1];
    +
    +       	delete $tmpCN;
    +   	}
    +	return ". nope\n";
    +}
    +
    +global proc float pointDist(float $p1[], float $p2[])
    +{
    +    return sqrt( 
    +	(($p1[0] - $p2[0]) * ($p1[0] - $p2[0])) + 
    +	(($p1[1] - $p2[1]) * ($p1[1] - $p2[1])) + 
    +	(($p1[2] - $p2[2]) * ($p1[2] - $p2[2])));
    +}
    +
    +intersectSphereY;
    + + + + + + diff --git a/_posts/2010-01-11-bash-rename_multiple_files.md b/_posts/2010-01-11-bash-rename_multiple_files.md new file mode 100644 index 0000000..cb1e6e5 --- /dev/null +++ b/_posts/2010-01-11-bash-rename_multiple_files.md @@ -0,0 +1,9 @@ +--- +title: Rename Multiple Files via Shell +tags: bash terminal rename +date: 2010-01-11 +layout: post +--- +
    +ls | nl -nrz -w2 | while read a b; do mv "$b" filename.$a.png; done;
    +
    diff --git a/_posts/2010-02-07-bash-date_for_filename.md b/_posts/2010-02-07-bash-date_for_filename.md new file mode 100644 index 0000000..68a303f --- /dev/null +++ b/_posts/2010-02-07-bash-date_for_filename.md @@ -0,0 +1,12 @@ +--- +title: date for new filename +lang: bash +date: 2010-02-07 +layout: post +--- +
    #!/bin/bash
    +# Shell script to create file named after the current date
    +# YYYY-MM-DD format
    +
    +DATE=$(date +%Y"-"%m"-"%d)
    +echo -e "new file" > $DATE
    \ No newline at end of file diff --git a/_posts/2010-05-15-bash-rewrite_multiple_slashes.md b/_posts/2010-05-15-bash-rewrite_multiple_slashes.md new file mode 100644 index 0000000..8fb6aef --- /dev/null +++ b/_posts/2010-05-15-bash-rewrite_multiple_slashes.md @@ -0,0 +1,11 @@ +--- +date: 2010-05-15 +title: "Rewrite URL: Replace Double Slashes With Single Slash" +tags: htaccess apache +layout: post +--- + +
    +RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
    +RewriteRule . %1/%2 [R=301,L]
    +
    \ No newline at end of file diff --git a/_posts/2010-07-07-maya_render_bat.md b/_posts/2010-07-07-maya_render_bat.md new file mode 100644 index 0000000..249aea9 --- /dev/null +++ b/_posts/2010-07-07-maya_render_bat.md @@ -0,0 +1,209 @@ +--- +title: Maya render bat batch file +tags: maya render bat +date: 2010-07-07 +hidden: true +layout: post +--- +*.bat file structure + +
    +REM // .bat comment syntax
    +C:\Progra~1\Autodesk\Maya2010\bin\render -s 1 -e 30 -im output_image myscene.ma
    +C:\Progra~1\Autodesk\Maya2010\bin\render -s 1 -e 30 -im output_image2 anotherscene.ma
    +
    + +The path to render.exe must be the 8.3 character DOS version. +To execute the file, save as a *.bat and double click it in Explorer. + + + +
    +// Render Flags
    +usage: Render <options> <filename>
    +where <filename> is a Maya ASCII or a Maya Binary file.
    + 
    +
    +startFrame            -s   <float>     starting frame for an animation sequence
    +
    +endFrame              -e   <float>     end frame for an animation sequence
    +
    +byFrame               -b   <float>     by frame (or step)
    +                                       for an animation sequence
    +
    +startExtension        -se  <int>       starting number for the output image
    +                                       frame file name extensions
    +
    +byExtension           -be  <int>       by extension (or step) for the output
    +                                       image frame file name extension
    +
    +extensionPadding      -pad <int>       number of digits in the output image
    +                                       frame file name extension
    +
    +project               -proj <dir>      project directory to use
    +
    +renderDirectory       -rd  <path>      directory in which to store image file
    +
    +image                 -im  <filename>  image file output name (identical to -p)
    +
    +pix                   -p   <filename>  image file output name (identical to -im)
    +
    +mayaExtension         -me  <boolean>   append maya file name to image name
    +                                       if true
    +
    +mayaFormat            -mf  <boolean>   append image file format to image name
    +                                       if true
    +
    +cameraOverride        -cam <name>      all subsequent -im -p -ar -sa flags
    +                                       apply only to <camera_name>
    +                                       (specifying '-cam <camera_name>' enables
    +                                       rendering for that camera). If '-cam
    +                                       <camera_name>' is on the command line,
    +                                       then only the camera(s) specified on the
    +                                       command line will be rendered.
    +
    +gamma                 -g   <float>     gamma value
    +
    +ignoreFilmGate        -ifg <boolean>   use the film gate for rendering if false
    +
    +imageHeight           -ih  <int>       height of image in pixels
    +
    +imageWidth            -iw  <int>       width of image in pixels
    +
    +deviceAspectRatio     -ard <float>     device aspect ratio for the rendered image
    +
    +aspectRatio           -ar  <float>     aspect ratio for the film aperture
    +
    +maximumMemory         -mm  <int>       renderer maximum memory use
    +                                       (in Megabytes)
    +
    +motionBlur            -mb  <boolean>   motion blur on/off
    +
    +motionBlurByFrame     -mbf <float>     motion blur by frame
    +
    +shutterAngle          -sa  <float>     shutter angle for motion blur (1-360)
    +
    +motionBlur2D          -mb2d <boolean>  motion blur 2D on/off
    +
    +blurLength            -bll <float>     2D motion blur blur length
    +
    +blurSharpness         -bls <float>     2D motion blur blur sharpness
    +
    +smoothValue           -smv <int>       2D motoin blur smooth value
    +
    +smoothColor           -smc <boolean>   2D motion blur smooth color on/off
    +
    +keepMotionVector      -kmv <boolean>   keep motion vector for 2D motion blur on/off
    +
    +useFileCache          -uf  <boolean>   use the tessellation file cache
    +
    +optimizeInstances     -oi  <boolean>   dynamically detects similarly
    +                                       tessellated surfaces
    +
    +reuseTessellations    -rut <boolean>   reuse render geometry to
    +                                       generate depth maps
    +
    +useDisplacementBbox   -udb <boolean>   use the displacement bounding box scale to
    +                                       optimize displacement-map performance
    +
    +enableDepthMaps       -edm <boolean>   enable depth map usage
    +
    +enableRayTrace        -ert <boolean>   enable ray tracing
    +
    +reflections           -rfl <int>       maximum ray-tracing reflection level
    +
    +refractions           -rfr <int>       maximum ray-tracing refraction level
    +
    +renderLayers          -rl <boolean|name>  render each layer separately
    +
    +renderPasses          -rp <boolean|name>  render passes separately
    +
    +renderSubdirs         -rs <boolean>    render layer output placed in subdirectories
    +
    +shadowLevel           -sl  <int>       maximum ray-tracing shadow ray depth
    +
    +edgeAntiAliasing      -eaa <quality>   The anti-aliasing quality of EAS
    +                                       (Abuffer). One of highest high medium low
    +
    +useFilter             -ufil <boolean>  if true, use the multi-pixel filtering
    +                                       otherwise use single pixel filtering.
    +
    +pixelFilterType       -pft  <filter>   when useFilter is true, identifies one of the
    +                                       following filters: box, triangle
    +                                       gaussian, quadraticbspline, plugin
    +
    +shadingSamples        -ss  <int>       global number of shading samples
    +                                       per surface in a pixel
    +
    +maxShadingSamples     -mss <int>       maximum number of adaptive shading
    +                                       samples per surface in a pixel
    +
    +visibilitySamples     -mvs <int>       number of motion blur visibility samples
    +
    +maxVisibilitySamples  -mvm <int>       maximum number of motion blur
    +                                       visibility samples
    +
    +volumeSamples         -vs  <int>       global number of volume shading samples
    +
    +particleSamples       -pss <int>       number of particle visibility samples
    +
    +redThreshold          -rct <float>     red channel contrast threshold
    +
    +greenThreshold        -gct <float>     green channel contrast threshold
    +
    +blueThreshold         -bct <float>     blue channel contrast threshold
    +
    +coverageThreshold     -cct <float>     pixel coverage contrast threshold
    +                                       (default is 1.0/8.0)
    +
    +outputFormat          -of  <format>    output image file format. One of: si soft
    +                                       softimage, gif, rla wave wavefront, tiff
    +                                       tif, tiff16 tif16, sgi rgb, sgi16 rgb16
    +                                       alias als pix, iff tdi explore maya, jpeg
    +                                       jpg, eps, maya16 iff16, cineon cin fido,
    +                                       qtl quantel, tga targa, bmp
    +
    +shadowPass            -sp <boolean>    generate shadow depth maps only
    +
    +abortOnMissingTexture -amt             abort renderer when encountered missing texture
    +
    +dontReplaceRendering  -rep             do not replace the rendered image if it already exists
    +
    +verbose               -verbose <boolean> perform the render verbosely if on
    +
    +iprFile               -ipr             create an IPR file
    +
    +xResolution           -x   <int>       set X resolution of the final image
    +
    +yResolution           -y   <int>       set Y resolution of the final image
    +
    +xLeft                 -xl  <int>       set X sub-region left pixel boundary
    +                                       of the final image
    +
    +xRight                -xr  <int>       set X sub-region right pixel boundary
    +                                       of the final image
    +
    +yLow                  -yl  <int>       set Y sub-region low pixel boundary
    +                                       of the final image
    +
    +yHigh                 -yh  <int>       set Y sub-region high pixel boundary
    +                                       of the final image
    +
    +displayLayer          -l  <name>       one or more displayLayer names to render
    +
    +numberOfProcessors    -n  <int>        number of processors to use. 0 indicates
    +                                       use all available.
    +
    +tileWidth             -tw <int>        force the width of the tiles.  Valid valu
    +                                       are between 16 and 256.
    +
    +tileHeight            -th <int>        force the height of the tiles.  Valid values
    +                                       are between 16 and 256.
    +
    +                      -cont            allow renderer to continue when it hits errors
    +
    +                      -keepPreImage    keep the renderings prior to post-process around
    +
    +any boolean works: yes, true, or 1, as TRUE,and off, no, false, or 0 as FALSE. + +example: `Render -x 512 -y 512 -cam persp -im test -of sgi -mb on -sa 180 file.ma` diff --git a/_posts/2010-07-11-bash-resize_multiple_images.md b/_posts/2010-07-11-bash-resize_multiple_images.md new file mode 100644 index 0000000..3610d34 --- /dev/null +++ b/_posts/2010-07-11-bash-resize_multiple_images.md @@ -0,0 +1,7 @@ +--- +title: resize multiple images +date: 2010-07-11 +layout: post +--- +
    for k in $(ls *.JPG); do convert $k -resize 50% -quality 80 r_$k; done
    + diff --git a/_posts/2011-02-02-bash_profile_osx.md b/_posts/2011-02-02-bash_profile_osx.md new file mode 100644 index 0000000..55be6df --- /dev/null +++ b/_posts/2011-02-02-bash_profile_osx.md @@ -0,0 +1,43 @@ +--- +date: 2011-02-02 +title: osx bash profile +layout: post +--- + +
    +# color ls
    +export CLICOLOR=1
    +export TERM=xterm-color
    +export LSCOLORS=GxFxCxDxBxegedabagacad
    +
    +
    +function parse_git_branch {
    +  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
    +  echo "("${ref#refs/heads/}")"
    +}
    +
    +#Black       0;30     Dark Gray     1;30
    +#Blue        0;34     Light Blue    1;34
    +#Green       0;32     Light Green   1;32
    +#Cyan        0;36     Light Cyan    1;36
    +#Red         0;31     Light Red     1;31
    +#Purple      0;35     Light Purple  1;35
    +#Brown       0;33     Yellow        1;33
    +#Light Gray  0;37     White         1;37
    +
    +# colors
    +RED="\[\033[31m\]"
    +GREEN="\[\033[32m\]"
    +YELLOW="\[\033[33m\]"
    +BLUE="\[\033[0;34m\]"
    +BLUE_B="\[\033[1;34m\]"
    +WHITE_B="\[\033[1;37m\]"
    +NO_COLOR="\[\033[0m\]"
    +
    +# prompt with git repo
    +export PS1="$WHITE_B\u@\h $BLUE_B\w $RED\$(parse_git_branch) $NO_COLOR \n$BLUE_B\$ $NO_COLOR"
    +export PS2="$BLUE_B> $NO_COLOR";
    +
    +# aliases
    +alias ff="find . -type f -name "
    +
    \ No newline at end of file diff --git a/_posts/2011-03-11-bash_profile_linux.md b/_posts/2011-03-11-bash_profile_linux.md new file mode 100644 index 0000000..56a5f4b --- /dev/null +++ b/_posts/2011-03-11-bash_profile_linux.md @@ -0,0 +1,12 @@ +--- +title: linux bash profile +date: march 11 2011 +layout: post +--- +
    +alias ls='ls --color'
    +export CLICOLOR=1
    +export LSCOLORS=gxFxCxDxBxgggdabagacad
    +
    +export EDITOR='emacs'
    +
    diff --git a/_posts/2011-04-16-ssh_keys.md.md b/_posts/2011-04-16-ssh_keys.md.md new file mode 100644 index 0000000..8d4e020 --- /dev/null +++ b/_posts/2011-04-16-ssh_keys.md.md @@ -0,0 +1,15 @@ +--- +layout: post +title: "create ssh keys" +categories: c +date: 2011-04-16 +--- +
    +ssh-keygen -t rsa
    +// linux
    +ssh-copy-id [user@]host
    +// osx
    +cat ~/.ssh/id_rsa.pub | ssh user@machine "mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys"
    +eval `ssh-agent`
    +ssh-add
    +
    diff --git a/_posts/2011-04-27-windows_copy.md b/_posts/2011-04-27-windows_copy.md new file mode 100644 index 0000000..1679933 --- /dev/null +++ b/_posts/2011-04-27-windows_copy.md @@ -0,0 +1,17 @@ +--- +title: "Combine Files (Windows)" +date: Wed, april 27 2011 +tags: windows cmd console +layout: post +--- +
    +copy /b file1+ file2 output
    +
    +eg +
    +copy /b picture.jpg + archive.rar file.jpg
    +
    + +Open file.jpg with the default application, it will show the picture "picture.jpg". +Change the extension to "file.rar" or if you try to open "file.jpg" with an archiver you will get the contents of "archive.rar". + diff --git a/_posts/2011-05-10-osx_hidden_files.md b/_posts/2011-05-10-osx_hidden_files.md new file mode 100644 index 0000000..7730906 --- /dev/null +++ b/_posts/2011-05-10-osx_hidden_files.md @@ -0,0 +1,20 @@ +--- +title: "show hidden files (OSX Finder)" +date: "Tue May 10 21:03:45 PDT 2011" +tags: osx +layout: post +--- + +via Terminal + +show hidden files: +
    +defaults write com.apple.finder AppleShowAllFiles TRUE
    +killall Finder
    +
    + +hide hidden files: +
    +defaults write com.apple.finder AppleShowAllFiles FALSE
    +killall Finder
    +
    diff --git a/_posts/2011-05-24-clmpr.md b/_posts/2011-05-24-clmpr.md new file mode 100644 index 0000000..22423c0 --- /dev/null +++ b/_posts/2011-05-24-clmpr.md @@ -0,0 +1,14 @@ +--- +title: clmpr +date: may 24 2011 +tags: code web +gallery: full +layout: post +--- + +clmpr (clumper) is an open-source multi-user bookmarking engine, inspired by the original del.icio.us (RIP) + +demo: clmpr.com +source: http://github.com/quilime/clmpr + + \ No newline at end of file diff --git a/_posts/2011-06-28-filebrowser.md b/_posts/2011-06-28-filebrowser.md new file mode 100644 index 0000000..d80030d --- /dev/null +++ b/_posts/2011-06-28-filebrowser.md @@ -0,0 +1,9 @@ +--- +title: filebrowser +date: 2011-06-28 +layout: post +--- +File Browser PHP script on GitHub. + +demo: +media.quilime.com diff --git a/_posts/2011-07-07-bootable_iso.md b/_posts/2011-07-07-bootable_iso.md new file mode 100644 index 0000000..43df631 --- /dev/null +++ b/_posts/2011-07-07-bootable_iso.md @@ -0,0 +1,24 @@ +--- +title: "create bootable iso from unix/osx terminal" +date: july 7 2011 +layout: post +--- + +1. diskutil list
    +Determines the device node assigned to your flash media (e.g. /dev/disk2) + +2. diskutil unmountDisk /dev/disk#
    +Replace # with the disk number from the last command; in the previous example, # is 2) + +3. sudo dd if=/path/to/example.iso of=/dev/diskN bs=1m
    +Replace /path/to/example.iso with the path to the iso; for example: ./windows7.iso. After typing in your sudo password, the process will start invisibly. + +4. diskutil eject /dev/disk#
    +Remove your flash media device when the command completes. Done! + +Referenced from BurningIsoHowto + +Bonus tip! You want to see how far the `dd` copy is coming along? Run in another terminal instance:
    +$ sudo killall -INFO dd
    +The process info will display in the original terminal. + diff --git a/_posts/2011-08-11-terminal_emulator_on_win.md b/_posts/2011-08-11-terminal_emulator_on_win.md new file mode 100644 index 0000000..fb1bace --- /dev/null +++ b/_posts/2011-08-11-terminal_emulator_on_win.md @@ -0,0 +1,91 @@ +--- +title: "Terminal Emulator on Windows via Cygwin" +date: august 11 2011 +--- +How to install cygwin on windows: + +1. **Install Cygwin from setup.exe** + +2. **Install the following packages:** + + - xorg-server (required, the Cygwin X Server) + - xinit (required, scripts for starting the X server: xinit, startx, startwin (and a shortcut on the Start Menu to run it), startxdmcp.bat ) + - xorg-docs (optional, man pages) + - X-start-menu-icons (optional, adds shortcuts to X Clients and Server to the Start menu) + - mintty (windows-feel terminal) +
    + +3. **Optional Packages** + - openssh + - git, svn + - wget, curl + - rsync + - vim, emacs + - any additional fonts + +
    + + + + +3. **~/.XDefaults** +dark theme: +
    +! terminal colors ------------------------------------------------------------
    +! tangoesque scheme
    +*background: #111111
    +*foreground: #babdb6
    +! Black (not tango) + DarkGrey
    +*color0:  #000000
    +*color8:  #555753
    +! DarkRed + Red
    +*color1:  #ff6565
    +*color9:  #ff8d8d
    +! DarkGreen + Green
    +*color2:  #93d44f
    +*color10: #c8e7a8
    +! DarkYellow + Yellow
    +*color3:  #eab93d
    +*color11: #ffc123
    +! DarkBlue + Blue
    +*color4:  #204a87
    +*color12: #3465a4
    +! DarkMangenta + Mangenta
    +*color5:  #ce5c00
    +*color13: #f57900
    +!DarkCyan + Cyan (both not tango)
    +*color6:  #89b6e2
    +*color14: #46a4ff
    +! LightGrey + White
    +*color7:  #cccccc
    +*color15: #ffffff
    +
    +Some more themes on the Arch forums. +
    + + + +4. **~/.bashrc** +To enable color `ls` and human readable size format, add: +
    +alias ls='ls -h --color=tty'
    +
    +By default, the .bashrc in CygwinX has many options you can uncomment. +
    + +5. **~/.emacs** +Disable emacs temp (~) file pooping +
    +(setq make-backup-files nil)
    +
    +
    + + + +Result: + + + +Other emulators for Windows: +- Terminator/ + diff --git a/_posts/2011-09-19-mostused.md b/_posts/2011-09-19-mostused.md new file mode 100644 index 0000000..c1a5098 --- /dev/null +++ b/_posts/2011-09-19-mostused.md @@ -0,0 +1,34 @@ +--- +title: command history +date: "Mon Sep 19 19:39:51 PDT 2011" +layout: post +--- +
    history | awk {'print $2'} | sort | uniq -c | sort -k1 -rn | head
    + +example +
    +// brand new netbook
    +  24 ls
    +  14 cd
    +  12 defaults
    +   9 unzip
    +   8 ssh
    +   5 mv
    +   3 mkdir
    +   3 chmod
    +   3 cat
    +   2 unrar
    +
    +
    +// quilime.com
    + 173 git
    + 140 ls
    +  84 cd
    +  18 emacs
    +  15 cat
    +  13 mv
    +  12 rm
    +   5 ln
    +   4 mkdir
    +   4 ./scripts/content
    +
    diff --git a/_posts/2011-11-09-osx_command_line_audio.md b/_posts/2011-11-09-osx_command_line_audio.md new file mode 100644 index 0000000..dc52a62 --- /dev/null +++ b/_posts/2011-11-09-osx_command_line_audio.md @@ -0,0 +1,47 @@ +--- +title: "command line audio on OSX" +date: "Wed, Nov 9 2011 18:40:26, IST" +tags: audio osx cli +layout: post +--- + +Since there is no equivilent to /dev/dsp or /dev/audio on OSX, you need to install an alternative like sox. + +Install sox by either downloading the OSX binary from http://sox.sourceforge.net/ +or +install homebrew, and then install sox with brew install sox + +##Examples + +cat audio from /dev/urandom/ : +
    cat /dev/urandom | sox -traw -r44100 -b16 -u - -tcoreaudio
    + + +audio from an executable +
    +cat > test.c
    +main(t) {
    +  for( t = 0;;t++)
    +    putchar( t * ((( t >> 12 ) | (t >> 8)) & (63& (t >> 4 ))));
    +}
    +
    +[ctrl-c] +
    +gcc test.c -o test
    +./test | sox -traw -r8000 -b8 -u - -tcoreaudio
    +
    + + + +## references + +- http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html +- http://www.bemmu.com/music/index.html +- http://wurstcaptures.untergrund.net + + + +
    diff --git a/_posts/2011-11-14-osx_print_json.md b/_posts/2011-11-14-osx_print_json.md new file mode 100644 index 0000000..212ce48 --- /dev/null +++ b/_posts/2011-11-14-osx_print_json.md @@ -0,0 +1,29 @@ +--- +title: print formatted JSON, XML from osx command line +date: "mon, nov 14 2011" +tags: bash shell python json xml osx +layout: post +--- + +Working with various interfaces that output json or xml results in lots of situations where you have a single-line, unformatted output. Here's a quick way to format json, xml from the CLI. + +via the command line: + +format json +
    +cat unformatted.json | python -m json.tool
    +
    + +format json from clipboard +
    +pbpaste | python -m json.tool
    +
    + +format xml from clipboard +
    +pbpaste | xmllint --format -
    +
    +`xmllint` is part of libxml2 and installed by default on OSX. Be aware that xmllint cleans up XML as well as formatting it, ocassionally modifying the output. + +for all above examples, you can pipe back to the clipboard with | pbcopy at the end of the command, or output to a file with > output.json or > output.xml. + diff --git a/_posts/2012-01-02-archlinux_install.md b/_posts/2012-01-02-archlinux_install.md new file mode 100644 index 0000000..c678a15 --- /dev/null +++ b/_posts/2012-01-02-archlinux_install.md @@ -0,0 +1,116 @@ +--- +title: "DualBoot Archlinux/Windows7 Installation" +date: 2012-01-02 +tags: arch linux windows installation tutorial +layout: post +--- + +Documentation of the process of installing [archlinux](http://www.archlinux.org/) and Windows 7 in a dual-boot configuration. + +## System Specs + +- AMD X2 dual-core processor, running at 2.8 ghz, circa 2002 +- ASUS ATX motherboard +- 2 gigs of ram +- 100gb drive +- nvidia gtx 550 ti graphics card +- linksys wmp54g wireless pci network card +- 550w power supply + + + +## Installing Windows +Windows was installed from a USB stick using Microsoft's [Windows 7 USB/DVD tool](http://www.microsoftstore.com/store/msstore/html/pbPage.Help_Win7_usbdvd_dwnTool). It's required to create this key from a Windows 7 system. Boot with the USB drive, then install Windows on the drive in a single partition. Windows also creates a System Reserved partition for itself. Once installed, via Start Menu > Administrative Tools > Computer Management > Disk Manamagent, select 'Shrink Partition' on the main Windows parition to create another partition for Arch. The default value for the shrink is 50%, so for my setup the value for the new disk size was ~50GB, which was ideal. + +Note about this install. I have an old Linksys (Cysco) WMP54G Wireless PCI Card. Drivers from Linksys/Cysco's website didn't work, but following this [blog post](http://www.phishthis.com/2009/01/16/how-to-install-wmp54g-drivers-on-windows-7-beta-64-bit-or-vista-64-bit/), the generic RALink drivers worked great. + + + +## Installing Archlinux + +I downloading the Core Image via [torrent](http://www.archlinux.org/iso/2011.08.19/archlinux-2011.08.19-core-dual.iso.torrent) from [http://www.archlinux.org/download/](http://www.archlinux.org/download/). +This ISO includes all core packages so the system doesn't need to be online to install. + +Once downloaded, I followed the [notes](http://quilime.com/code/bootable_iso/) on how to create a bootable ISO onto another USB drive with yet another machine. There are also numerous free tools available to make a bootable ISO on Windows. After booting into Arch with the USB stick, boot into Arch, and type: + +
    /arch/setup
    + +The [installation](https://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide) article on the archwiki is an excellent resource. + + + +## Disk Partitions + +It's pretty straight forward until the drive partitions. My 100GB drive can only support 4 logical partitions, so the rest have to be Logical. Note: The numbers are out of order, because I used Logical partitions for everything except for the Windows partitions and /home. Logical partitions end up being counted last in the partition table, but I made my /home folder LAST so I could use the up the remaining space on the drive. You'll also need to set the /boot partition's 'bootable' flag to `true`. + +
    +• sda1
    +	Windows 7 System Reserved
    +• sda2
    +	Windows 7
    +• sda5
    +	/boot - 100MB is enough
    +• sda6
    +	/ - about 25GB is appropriate
    +• sda7
    +	swap - between 1024MB and 4096MB
    +• sda4
    +	/home - use rest of hard drive
    +
    + +Some of these, namely **boot**, **swap**, and **home**, are *optional*. + + + +## Select Packages + +At minimum, you'll need the core packages that are already selected. I also included certain key packages such as OpenSSH. Basically, include any packages you need for internet connectivity, as everything else will be updated from the net. + + + +## Configure System + +Configure system does multiple things, including setting the root password, network settings, and some other configuration tools. Here's a reference of where Arch installs all the base config files for the system. + +
    +/etc/rc.conf					system config
    +/etc/fstab						filesystem mountpoints
    +/etc/mkinitcpio.conf			initramfs config
    +/etc/modprobe.d/modprobe.conf	kernel modules
    +/etc/resolv.conf				dns servers
    +/etc/hosts						network hosts
    +/etc/locale.get 				glibc locals
    +/etc/pacman.conf				pacman.confg
    +/etc/pacman.d/mirrorlist		pacman mirror list
    +
    + +You should edit any of these files that are specific to your system. At minimum I enabled my network card in `rc.conf`. + +You'll also need to enable at least one mirror in pacman.d/mirrorlist if you plan to update the system or download new packages. + + + +## Bootloader + +Install Bootloader will install and help you configure the bootloader you selected in the Select Packages stage (GRUB, in my case). After double-checking your bootloader configuration, you'll be prompted for a disk to install the loader to. You should install GRUB to the MBR of the installation disk, in this case `sda1`. + + + +## Finalizing Installation + +Once installed, exit the installer, remove the USB, type `reboot` in the command line, and the system will reboot. You'll boot into a login screen, which you can login with via root. + +You can create [new users](https://wiki.archlinux.org/index.php/Users_and_Groups) interactively with `useradd`. + +You can install/update packages with Arch's package manager, [pacman](https://wiki.archlinux.org/index.php/Pacman). + +Before installing any packages, sync the package list with: + +
    pacman --sync --refresh
    + +To add a new package (vim, in this case), type: + +
    pacman -S vim
    + + +next: getting node and a webserver installed. diff --git a/_posts/2013-04-19-htmlwordcount.md b/_posts/2013-04-19-htmlwordcount.md new file mode 100644 index 0000000..1b69572 --- /dev/null +++ b/_posts/2013-04-19-htmlwordcount.md @@ -0,0 +1,31 @@ +--- +title: count words in html file with python +date: april 19 2013 +tags: python code +layout: post +--- +``` +#!/usr/bin/python + +import nltk +import string +from urllib import urlopen +from itertools import imap + +url = "http://google.com" +html = urlopen(url).read() +text = nltk.clean_html(html) +text_noPunc = text.translate(string.maketrans("",""), string.punctuation) +words = text_noPunc.split() +max_word_len = max(imap(len, words)) +vocabulary = nltk.probability.FreqDist(words) + +for word in vocabulary: + print word, + print ' ' * (max_word_len + 5 - word.__len__()), + print str(vocabulary[word]) +``` + +Using [NTLK](http://nltk.org) + +[Gist](https://gist.github.com/quilime/5423808) on Github. diff --git a/index.md b/index.md new file mode 100644 index 0000000..3525f8c --- /dev/null +++ b/index.md @@ -0,0 +1,5 @@ +--- +layout: index +--- + +quilime.com \ No newline at end of file -- 2.34.1