Saturday, October 29, 2016

macOS Sierra: Software Update Using Command-line Tool

Command:

$ sudo softwareupdate --list
Password:


Result:

Software Update Tool
Copyright 2002-2015 Apple Inc.

Finding available software
No new software available.

MacOS Sierra: Installing wisp (Wisp Is Scala Plotting) Console-centric Plotting Library for Scala

Command:

$ git clone https://github.com/quantifind/wisp.git


Result:

Cloning into 'wisp'...
remote: Counting objects: 1470, done.
remote: Total 1470 (delta 0), reused 0 (delta 0), pack-reused 1470
Receiving objects: 100% (1470/1470), 423.22 KiB | 382.00 KiB/s, done.
Resolving deltas: 100% (521/521), done.


Command:

$ cd wisp
$ sbt 'project wisp' coonsole


Result:

[info] Loading project definition from /Users/USERNAME/wisp/project
[info] Set current project to default-e392df (in build file:/Users/USERNAME/wisp/)
[info] Set current project to Wisp (in build file:/Users/USERNAME/wisp/)
[error] Not a valid command: coonsole
[error] Not a valid project ID: coonsole
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: coonsole (similar: console, consoleQuick, console-quick)
[error] coonsole
[error]         ^
photino:wisp USERNAME$ sbt 'project wisp' console
[info] Loading project definition from /Users/USERNAME/wisp/project
[info] Set current project to default-e392df (in build file:/Users/USERNAME/wisp/)
[info] Set current project to Wisp (in build file:/Users/USERNAME/wisp/)
[info] Updating {file:/Users/USERNAME/wisp/}wisp...
[info] Resolving org.sonatype.oss#oss-parent;7 ...
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-library;2.11.6!scala-library.jar (9714ms)
[info] downloading http://repo1.maven.org/maven2/org/json4s/json4s-jackson_2.11/3.2.10/json4s-jackson_2.11-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-jackson_2.11;3.2.10!json4s-jackson_2.11.jar (516ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered-filter_2.11/0.8.3/unfiltered-filter_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered-filter_2.11;0.8.3!unfiltered-filter_2.11.jar (573ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered-jetty_2.11/0.8.3/unfiltered-jetty_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered-jetty_2.11;0.8.3!unfiltered-jetty_2.11.jar (541ms)
[info] downloading http://repo1.maven.org/maven2/com/quantifind/sumac_2.11/0.3.0/sumac_2.11-0.3.0.jar ...
[info] [SUCCESSFUL ] com.quantifind#sumac_2.11;0.3.0!sumac_2.11.jar (637ms)
[info] downloading http://repo1.maven.org/maven2/org/apache/commons/commons-math3/3.4.1/commons-math3-3.4.1.jar ...
[info] [SUCCESSFUL ] org.apache.commons#commons-math3;3.4.1!commons-math3.jar (1566ms)
[info] downloading http://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar ...
[info] [SUCCESSFUL ] commons-io#commons-io;2.4!commons-io.jar (560ms)
[info] downloading http://repo1.maven.org/maven2/org/json4s/json4s-core_2.11/3.2.10/json4s-core_2.11-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-core_2.11;3.2.10!json4s-core_2.11.jar (720ms)
[info] downloading http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.3.1/jackson-databind-2.3.1.jar ...
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-databind;2.3.1!jackson-databind.jar(bundle) (824ms)
[info] downloading http://repo1.maven.org/maven2/org/json4s/json4s-ast_2.11/3.2.10/json4s-ast_2.11-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-ast_2.11;3.2.10!json4s-ast_2.11.jar (517ms)
[info] downloading http://repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.6/paranamer-2.6.jar ...
[info] [SUCCESSFUL ] com.thoughtworks.paranamer#paranamer;2.6!paranamer.jar (503ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scalap/2.11.0/scalap-2.11.0.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scalap;2.11.0!scalap.jar (829ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.0/scala-compiler-2.11.0.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-compiler;2.11.0!scala-compiler.jar (5789ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.0/scala-reflect-2.11.0.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.0!scala-reflect.jar (2677ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.1/scala-xml_2.11-1.0.1.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.1!scala-xml_2.11.jar(bundle) (783ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.1/scala-parser-combinators_2.11-1.0.1.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-parser-combinators_2.11;1.0.1!scala-parser-combinators_2.11.jar(bundle) (645ms)
[info] downloading http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.3.0/jackson-annotations-2.3.0.jar ...
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-annotations;2.3.0!jackson-annotations.jar(bundle) (511ms)
[info] downloading http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.3.1/jackson-core-2.3.1.jar ...
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-core;2.3.1!jackson-core.jar(bundle) (558ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered_2.11/0.8.3/unfiltered_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered_2.11;0.8.3!unfiltered_2.11.jar (793ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered-util_2.11/0.8.3/unfiltered-util_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered-util_2.11;0.8.3!unfiltered-util_2.11.jar (511ms)
[info] downloading http://repo1.maven.org/maven2/commons-codec/commons-codec/1.4/commons-codec-1.4.jar ...
[info] [SUCCESSFUL ] commons-codec#commons-codec;1.4!commons-codec.jar (515ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-webapp/8.1.13.v20130916/jetty-webapp-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-webapp;8.1.13.v20130916!jetty-webapp.jar (531ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-xml/8.1.13.v20130916/jetty-xml-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-xml;8.1.13.v20130916!jetty-xml.jar (510ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-servlet/8.1.13.v20130916/jetty-servlet-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-servlet;8.1.13.v20130916!jetty-servlet.jar (532ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-util/8.1.13.v20130916/jetty-util-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-util;8.1.13.v20130916!jetty-util.jar (589ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-security/8.1.13.v20130916/jetty-security-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-security;8.1.13.v20130916!jetty-security.jar (527ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-server/8.1.13.v20130916/jetty-server-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-server;8.1.13.v20130916!jetty-server.jar (606ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/orbit/javax.servlet/3.0.0.v201112011016/javax.servlet-3.0.0.v201112011016.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty.orbit#javax.servlet;3.0.0.v201112011016!javax.servlet.jar(orbit) (567ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-continuation/8.1.13.v20130916/jetty-continuation-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-continuation;8.1.13.v20130916!jetty-continuation.jar (501ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-http/8.1.13.v20130916/jetty-http-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-http;8.1.13.v20130916!jetty-http.jar (530ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-io/8.1.13.v20130916/jetty-io-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-io;8.1.13.v20130916!jetty-io.jar (529ms)
[info] downloading http://repo1.maven.org/maven2/org/scalatest/scalatest_2.11/2.2.1/scalatest_2.11-2.2.1.jar ...
[info] [SUCCESSFUL ] org.scalatest#scalatest_2.11;2.2.1!scalatest_2.11.jar(bundle) (3044ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.2/scala-reflect-2.11.2.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.2!scala-reflect.jar (2710ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.2/scala-xml_2.11-1.0.2.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.2!scala-xml_2.11.jar(bundle) (945ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.6/scala-compiler-2.11.6.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-compiler;2.11.6!scala-compiler.jar (9882ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.6/scala-reflect-2.11.6.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.6!scala-reflect.jar (2726ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.3/scala-xml_2.11-1.0.3.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.3!scala-xml_2.11.jar(bundle) (792ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.3/scala-parser-combinators_2.11-1.0.3.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-parser-combinators_2.11;1.0.3!scala-parser-combinators_2.11.jar(bundle) (685ms)
[info] downloading http://repo1.maven.org/maven2/jline/jline/2.12.1/jline-2.12.1.jar ...
[info] [SUCCESSFUL ] jline#jline;2.12.1!jline.jar (575ms)
[info] Done updating.
[info] Compiling 14 Scala sources to /Users/USERNAME/wisp/core/target/scala-2.11/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.11.6. Compiling...
[info]   Compilation completed in 6.847 s
[warn] there were 9 feature warnings; re-run with -feature for details
[warn] there was one inliner warning; re-run with -Yinline-warnings for details
[warn] two warnings found
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_91).
Type in expressions to have them evaluated.
Type :help for more information.


Command:

scala> import com.quantifind.charts.Highcharts._


Result:

import com.quantifind.charts.Highcharts._


Command:

scala> line((1 to 10), (1 to 10))


Result:

serving resources from: file:/Users/USERNAME/wisp/index-1477712248460.html
2016-10-29 12:37:28.864:INFO:oejs.Server:jetty-8.1.13.v20130916
2016-10-29 12:37:28.899:INFO:oejs.AbstractConnector:Started SocketConnector@0.0.0.0:55135
Server started: http://192.168.0.3:55135/index-1477712248460.html
Output written to http://192.168.0.3:55135 (CMD + Click link in Mac OSX).
res0: com.quantifind.charts.highcharts.Highchart = Highchart(List(Series(Vector(DataPair(1,1,None,None), DataPair(2,2,None,None), DataPair(3,3,None,None), DataPair(4,4,None,None), DataPair(5,5,None,None), DataPair(6,6,None,None), DataPair(7,7,None,None), DataPair(8,8,None,None), DataPair(9,9,None,None), DataPair(10,10,None,None)),None,None,None,Some(line),None,None,None,None,series)),Some(Title(,None,None,None,None,None,None,None,title)),Some(Chart(Some(xy))),None,Some(Credits(None,,None,None,)),Some(Exporting(chart,None,None,None,None,None,None)),None,Some(PlotOptions(None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,plotOptions)),None,true,None,Some([Lcom.quantifind.charts.highcharts.Axis;@3a5792a6),Some([Lcom.quantifind.charts.hi...


Graphical output:

Wisp Is Scala Plotting Example on macOS Sierra




macOS Sierra: Scala: Installing sbt (Build automation tool for Scala)

Command:

$ brew install sbt


Result:

==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
pacparser

==> Using the sandbox
==> Downloading https://dl.bintray.com/sbt/native-packages/sbt/0.13.12/sbt-0.13.12.tgz
######################################################################## 100.0%
==> Caveats
You can use $SBT_OPTS to pass additional JVM options to SBT:
   SBT_OPTS="-XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"

This formula is now using the standard typesafe sbt launcher script.
Project specific options should be placed in .sbtopts in the root of your project.
Global settings should be placed in /usr/local/etc/sbtopts
==> Summary
🍺  /usr/local/Cellar/sbt/0.13.12: 6 files, 1.2M, built in 13 seconds

macOS Sierra: Installing Scala

Command:

$ brew install scala


Result:

==> Downloading https://homebrew.bintray.com/bottles/scala-2.11.8.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring scala-2.11.8.sierra.bottle.tar.gz
==> Caveats
To use with IntelliJ, set the Scala home to:
  /usr/local/opt/scala/idea

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/scala/2.11.8: 51 files, 30.9M


Command:

$ scala -version


Result:

Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL


Command:

$ scalac -version


Result:

Scala compiler version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL


Command:

$ fsc -version


Result:

Fast Scala compiler version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL

Anne The Happie Cat: How to Start Making Games (with No Experience)

Anne The Happie Cat

  • Chess
  • C++
  • Microsoft Visual Studio
  • SFML
  • Unity
  • C#
  • Data structure
  • Algorithm 
  • Game Developers Conference

macOS Sierra: C++: OpenGL Utility Toolkit (GLUT) Example

Command:

$ cat BasicGlut.cpp


Result:

#include<GLUT/GLUT.h>
#include<iostream>

void render(void);
void keyboard(unsigned char c, int x, int y);
void mouse(int button, int state, int x, int y);


int main(int argc, char** argv){
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(100, 100);
glutInitWindowSize(640, 480);
glutCreateWindow("Simple GLUT Application");

glutDisplayFunc(render);
glutKeyboardFunc(keyboard);
glutMouseFunc(mouse);
glutMainLoop();
return 0;
}

void keyboard(unsigned char c, int x, int y){
if (c == 27) { //esc
exit(0);
}
}


void mouse(int button, int state, int x, int y){
if (button == GLUT_RIGHT_BUTTON){
exit(0);
}
}

void render(void){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glBegin(GL_TRIANGLES);
glColor3f(1, 0, 0); //RGB
glVertex2f(-0.5, -0.5); //glVertex234fid
glColor3f(0, 1, 0);
glVertex2f(0.5, 0.0);
glColor3f(0, 0, 1);
glVertex2f(0.0, 0.5);
glEnd();

glutSwapBuffers();
}


Command:

$ g++ BasicGlut.cpp -o BasicGlut -framework OpenGL -framework GLUT


Result:

BasicGlut.cpp:10:2: warning: 'glutInit' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
        glutInit(&argc, argv);
        ^
/System/Library/Frameworks/GLUT.framework/Headers/GLUT.h:431:22: note: 'glutInit' has been explicitly marked deprecated here
extern void APIENTRY glutInit(int *argcp, char **argv) OPENGL_DEPRECATED(10_0, 10_9);
                     ^
BasicGlut.cpp:11:2: warning: 'glutInitDisplayMode' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
        glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
        ^
/System/Library/Frameworks/GLUT.framework/Headers/GLUT.h:432:22: note: 'glutInitDisplayMode' has been explicitly marked deprecated here
extern void APIENTRY glutInitDisplayMode(unsigned int mode) OPENGL_DEPRECATED(10_0, 10_9);
                     ^
BasicGlut.cpp:12:2: warning: 'glutInitWindowPosition' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
        glutInitWindowPosition(100, 100);
        ^
/System/Library/Frameworks/GLUT.framework/Headers/GLUT.h:436:22: note: 'glutInitWindowPosition' has been explicitly marked deprecated here
extern void APIENTRY glutInitWindowPosition(int x, int y) OPENGL_DEPRECATED(10_0, 10_9);
                     ^
BasicGlut.cpp:13:2: warning: 'glutInitWindowSize' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
        glutInitWindowSize(640, 480);
        ^
/System/Library/Frameworks/GLUT.framework/Headers/GLUT.h:437:22: note: 'glutInitWindowSize' has been explicitly marked deprecated here
extern void APIENTRY glutInitWindowSize(int width, int height) OPENGL_DEPRECATED(10_0, 10_9);
                     ^
BasicGlut.cpp:14:2: warning: 'glutCreateWindow' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
        glutCreateWindow("Simple GLUT Application");
        ^
/System/Library/Frameworks/GLUT.framework/Headers/GLUT.h:441:21: note: 'glutCreateWindow' has been explicitly marked deprecated here
extern int APIENTRY glutCreateWindow(const char *title) OPENGL_DEPRECATED(10_0, 10_9);
                    ^
BasicGlut.cpp:16:2: warning: 'glutDisplayFunc' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
        glutDisplayFunc(render);
        ^
/System/Library/Frameworks/GLUT.framework/Headers/GLUT.h:505:22: note: 'glutDisplayFunc' has been explicitly marked deprecated here
extern void APIENTRY glutDisplayFunc(void (*func)(void)) OPENGL_DEPRECATED(10_0, 10_9);
                     ^
BasicGlut.cpp:17:2: warning: 'glutKeyboardFunc' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
        glutKeyboardFunc(keyboard);
        ^
/System/Library/Frameworks/GLUT.framework/Headers/GLUT.h:507:22: note: 'glutKeyboardFunc' has been explicitly marked deprecated here
extern void APIENTRY glutKeyboardFunc(void (*func)(unsigned char key, int x, int y)) OPENGL_DEPRECATED(10_0, 10_9);
                     ^
BasicGlut.cpp:18:2: warning: 'glutMouseFunc' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
        glutMouseFunc(mouse);
        ^
/System/Library/Frameworks/GLUT.framework/Headers/GLUT.h:508:22: note: 'glutMouseFunc' has been explicitly marked deprecated here
extern void APIENTRY glutMouseFunc(void (*func)(int button, int state, int x, int y)) OPENGL_DEPRECATED(10_0, 10_9);
                     ^
BasicGlut.cpp:19:2: warning: 'glutMainLoop' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
        glutMainLoop();
        ^
/System/Library/Frameworks/GLUT.framework/Headers/GLUT.h:438:22: note: 'glutMainLoop' has been explicitly marked deprecated here
extern void APIENTRY glutMainLoop(void) OPENGL_DEPRECATED(10_0, 10_9);
                     ^
BasicGlut.cpp:48:2: warning: 'glutSwapBuffers' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
        glutSwapBuffers();
        ^
/System/Library/Frameworks/GLUT.framework/Headers/GLUT.h:448:22: note: 'glutSwapBuffers' has been explicitly marked deprecated here
extern void APIENTRY glutSwapBuffers(void) OPENGL_DEPRECATED(10_0, 10_9);
                     ^
10 warnings generated.


Command:

$ ./BasicGlut


Result:

OpenGL Utility Toolkit (GLUT) Example on macOS Sierra



Friday, October 28, 2016

macOS Sierra: Installing irssi (Internet Relay Chat Client)

Command:

$ brew install irssi


Result:

==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, homebrew/science).
==> Updated Formulae
apache-geode      elasticsearch     harfbuzz          libcec            libphonenumber    pandoc            pandoc-crossref   redis             vapoursynth
ccache            flatcc            keybase           libmagic          logstash          pandoc-citeproc   pwntools          tinc              youtube-dl

==> Downloading https://homebrew.bintray.com/bottles/irssi-0.8.20.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring irssi-0.8.20.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/irssi/0.8.20: 277 files, 3.6M


Command:

$ irssi

Linus Torvalds: DebConf 14

Linus Torvalds


  • Junio Hamano (濱野 純)

Thursday, October 27, 2016

macOS Sierra: Python Script Using Tor

Command:

$ /opt/local/bin/tor --hash-password "test"


Result:

16:3F088C0E24C9C9A460EAD2F1E2C15953A4FEECCB2FA2155C5458E778FC

Command:

$ cat /opt/local/etc/tor/torrc

## Configuration file for a typical Tor user
## Last updated 22 September 2015 for Tor 0.2.7.3-alpha.
## (may or may not work for much older or much newer versions of Tor.)
##
## Lines that begin with "## " try to explain what's going on. Lines
## that begin with just "#" are disabled commands: you can enable them
## by removing the "#" symbol.
##
## See 'man tor', or https://www.torproject.org/docs/tor-manual.html,
## for more options you can use in this file.
##
## Tor will look for this file in various places based on your platform:
## https://www.torproject.org/docs/faq#torrc

## Tor opens a SOCKS proxy on port 9050 by default -- even if you don't
## configure one below. Set "SOCKSPort 0" if you plan to run Tor only
## as a relay, and not make any local application connections yourself.
#SOCKSPort 9050 # Default: Bind to localhost:9050 for local connections.
#SOCKSPort 192.168.0.1:9100 # Bind to this address:port too.

## Entry policies to allow/deny SOCKS requests based on IP address.
## First entry that matches wins. If no SOCKSPolicy is set, we accept
## all (and only) requests that reach a SOCKSPort. Untrusted users who
## can access your SOCKSPort may be able to learn about the connections
## you make.
#SOCKSPolicy accept 192.168.0.0/16
#SOCKSPolicy accept6 FC00::/7
#SOCKSPolicy reject *

## Logs go to stdout at level "notice" unless redirected by something
## else, like one of the below lines. You can have as many Log lines as
## you want.
##
## We advise using "notice" in most cases, since anything more verbose
## may provide sensitive information to an attacker who obtains the logs.
##
## Send all messages of level 'notice' or higher to /opt/local/var/log/tor/notices.log
#Log notice file /opt/local/var/log/tor/notices.log
## Send every possible message to /opt/local/var/log/tor/debug.log
#Log debug file /opt/local/var/log/tor/debug.log
## Use the system log instead of Tor's logfiles
#Log notice syslog
## To send all messages to stderr:
#Log debug stderr

## Uncomment this to start the process in the background... or use
## --runasdaemon 1 on the command line. This is ignored on Windows;
## see the FAQ entry if you want Tor to run as an NT service.
#RunAsDaemon 1

## The directory for keeping all the keys/etc. By default, we store
## things in $HOME/.tor on Unix, and in Application Data\tor on Windows.
#DataDirectory /opt/local/var/lib/tor

## The port on which Tor will listen for local connections from Tor
## controller applications, as documented in control-spec.txt.
ControlPort 9051
## If you enable the controlport, be sure to enable one of these
## authentication methods, to prevent attackers from accessing it.
HashedControlPassword 16:3F088C0E24C9C9A460EAD2F1E2C15953A4FEECCB2FA2155C5458E778FC
CookieAuthentication 1

############### This section is just for location-hidden services ###

## Once you have configured a hidden service, you can look at the
## contents of the file ".../hidden_service/hostname" for the address
## to tell people.
##
## HiddenServicePort x y:z says to redirect requests on port x to the
## address y:z.

#HiddenServiceDir /opt/local/var/lib/tor/hidden_service/
#HiddenServicePort 80 127.0.0.1:80

#HiddenServiceDir /opt/local/var/lib/tor/other_hidden_service/
#HiddenServicePort 80 127.0.0.1:80
#HiddenServicePort 22 127.0.0.1:22

################ This section is just for relays #####################
#
## See https://www.torproject.org/docs/tor-doc-relay for details.

## Required: what port to advertise for incoming Tor connections.
#ORPort 9001
## If you want to listen on a port other than the one advertised in
## ORPort (e.g. to advertise 443 but bind to 9090), you can do it as
## follows.  You'll need to do ipchains or other port forwarding
## yourself to make this work.
#ORPort 443 NoListen
#ORPort 127.0.0.1:9090 NoAdvertise

## The IP address or full DNS name for incoming connections to your
## relay. Leave commented out and Tor will guess.
#Address noname.example.com

## If you have multiple network interfaces, you can specify one for
## outgoing traffic to use.
# OutboundBindAddress 10.0.0.5

## A handle for your relay, so people don't have to refer to it by key.
#Nickname ididnteditheconfig

## Define these to limit how much relayed traffic you will allow. Your
## own traffic is still unthrottled. Note that RelayBandwidthRate must
## be at least 20 kilobytes per second.
## Note that units for these config options are bytes (per second), not
## bits (per second), and that prefixes are binary prefixes, i.e. 2^10,
## 2^20, etc.
#RelayBandwidthRate 100 KBytes  # Throttle traffic to 100KB/s (800Kbps)
#RelayBandwidthBurst 200 KBytes # But allow bursts up to 200KB (1600Kb)

## Use these to restrict the maximum traffic per day, week, or month.
## Note that this threshold applies separately to sent and received bytes,
## not to their sum: setting "40 GB" may allow up to 80 GB total before
## hibernating.
##
## Set a maximum of 40 gigabytes each way per period.
#AccountingMax 40 GBytes
## Each period starts daily at midnight (AccountingMax is per day)
#AccountingStart day 00:00
## Each period starts on the 3rd of the month at 15:00 (AccountingMax
## is per month)
#AccountingStart month 3 15:00

## Administrative contact information for this relay or bridge. This line
## can be used to contact you if your relay or bridge is misconfigured or
## something else goes wrong. Note that we archive and publish all
## descriptors containing these lines and that Google indexes them, so
## spammers might also collect them. You may want to obscure the fact that
## it's an email address and/or generate a new address for this purpose.
#ContactInfo Random Person <nobody AT example dot com>
## You might also include your PGP or GPG fingerprint if you have one:
#ContactInfo 0xFFFFFFFF Random Person <nobody AT example dot com>

## Uncomment this to mirror directory information for others. Please do
## if you have enough bandwidth.
#DirPort 9030 # what port to advertise for directory connections
## If you want to listen on a port other than the one advertised in
## DirPort (e.g. to advertise 80 but bind to 9091), you can do it as
## follows.  below too. You'll need to do ipchains or other port
## forwarding yourself to make this work.
#DirPort 80 NoListen
#DirPort 127.0.0.1:9091 NoAdvertise
## Uncomment to return an arbitrary blob of html on your DirPort. Now you
## can explain what Tor is if anybody wonders why your IP address is
## contacting them. See contrib/tor-exit-notice.html in Tor's source
## distribution for a sample.
#DirPortFrontPage /opt/local/etc/tor/tor-exit-notice.html

## Uncomment this if you run more than one Tor relay, and add the identity
## key fingerprint of each Tor relay you control, even if they're on
## different networks. You declare it here so Tor clients can avoid
## using more than one of your relays in a single circuit. See
## https://www.torproject.org/docs/faq#MultipleRelays
## However, you should never include a bridge's fingerprint here, as it would
## break its concealability and potentially reveal its IP/TCP address.
#MyFamily $keyid,$keyid,...

## A comma-separated list of exit policies. They're considered first
## to last, and the first match wins.
##
## If you want to allow the same ports on IPv4 and IPv6, write your rules
## using accept/reject *. If you want to allow different ports on IPv4 and
## IPv6, write your IPv6 rules using accept6/reject6 *6, and your IPv4 rules
## using accept/reject *4.
##
## If you want to _replace_ the default exit policy, end this with either a
## reject *:* or an accept *:*. Otherwise, you're _augmenting_ (prepending to)
## the default exit policy. Leave commented to just use the default, which is
## described in the man page or at
## https://www.torproject.org/documentation.html
##
## Look at https://www.torproject.org/faq-abuse.html#TypicalAbuses
## for issues you might encounter if you use the default exit policy.
##
## If certain IPs and ports are blocked externally, e.g. by your firewall,
## you should update your exit policy to reflect this -- otherwise Tor
## users will be told that those destinations are down.
##
## For security, by default Tor rejects connections to private (local)
## networks, including to the configured primary public IPv4 and IPv6 addresses,
## and any public IPv4 and IPv6 addresses on any interface on the relay.
## See the man page entry for ExitPolicyRejectPrivate if you want to allow
## "exit enclaving".
##
#ExitPolicy accept *:6660-6667,reject *:* # allow irc ports on IPv4 and IPv6 but no more
#ExitPolicy accept *:119 # accept nntp ports on IPv4 and IPv6 as well as default exit policy
#ExitPolicy accept *4:119 # accept nntp ports on IPv4 only as well as default exit policy
#ExitPolicy accept6 *6:119 # accept nntp ports on IPv6 only as well as default exit policy
#ExitPolicy reject *:* # no exits allowed

## Bridge relays (or "bridges") are Tor relays that aren't listed in the
## main directory. Since there is no complete public list of them, even an
## ISP that filters connections to all the known Tor relays probably
## won't be able to block all the bridges. Also, websites won't treat you
## differently because they won't know you're running Tor. If you can
## be a real relay, please do; but if not, be a bridge!
#BridgeRelay 1
## By default, Tor will advertise your bridge to users through various
## mechanisms like https://bridges.torproject.org/. If you want to run
## a private bridge, for example because you'll give out your bridge
## address manually to your friends, uncomment this line:
#PublishServerDescriptor 0


Command:

$ /opt/local/bin/tor &


Result:

[1] 6463
Oct 27 15:00:19.225 [notice] Tor v0.2.8.9 running on Darwin with Libevent 2.0.22-stable, OpenSSL 1.0.2j and Zlib 1.2.8.
Oct 27 15:00:19.226 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Oct 27 15:00:19.226 [notice] Read configuration file "/opt/local/etc/tor/torrc".
Oct 27 15:00:19.229 [notice] Opening Socks listener on 127.0.0.1:9050
Oct 27 15:00:19.229 [notice] Opening Control listener on 127.0.0.1:9051
Oct 27 15:00:19.000 [notice] Parsing GEOIP IPv4 file /opt/local/share/tor/geoip.
Oct 27 15:00:19.000 [notice] Parsing GEOIP IPv6 file /opt/local/share/tor/geoip6.
Oct 27 15:00:19.000 [notice] Bootstrapped 0%: Starting
Oct 27 15:00:19.000 [notice] Bootstrapped 80%: Connecting to the Tor network
Oct 27 15:00:20.000 [notice] Bootstrapped 85%: Finishing handshake with first hop
Oct 27 15:00:21.000 [notice] Bootstrapped 90%: Establishing a Tor circuit
Oct 27 15:00:23.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Oct 27 15:00:23.000 [notice] Bootstrapped 100%: Done


Command:

$ cat tor.py


Result:

from stem.control import Controller

with Controller.from_port(port = 9051) as controller:
    controller.authenticate()

    bytes_read = controller.get_info("traffic/read")
    bytes_written = controller.get_info("traffic/written")

    print("My Tor relay has read %s bytes and written %s." % (bytes_read, bytes_written))


Command:

$ python tor.py


Result:

Oct 27 15:02:42.000 [notice] New control connection opened from 127.0.0.1.
My Tor relay has read 687342 bytes and written 42071.

macOS Sierra: Installing Tor (anonymity network) Browser without GUI

Command:

$ brew install Caskroom/cask/macports


Result:

==> brew cask install Caskroom/cask/macports
==> Downloading https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.12-Sierra.pkg
######################################################################## 100.0%
==> Verifying checksum for Cask macports
==> Running installer for macports; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
==> installer: Package name is MacPorts
==> installer: Installing at base path /
==> installer: The install was successful.
🍺  macports was successfully installed!


Command:

$ sudo /opt/local/bin/port install tor


Result:

Warning: The Xcode Command Line Tools don't appear to be installed; most ports will likely fail to build.
Warning: Install them by running `xcode-select --install'.
--->  Computing dependencies for tor
--->  Dependencies to be installed: libevent openssl zlib
--->  Fetching archive for zlib
--->  Attempting to fetch zlib-1.2.8_0.darwin_16.x86_64.tbz2 from https://packages.macports.org/zlib
--->  Attempting to fetch zlib-1.2.8_0.darwin_16.x86_64.tbz2.rmd160 from https://packages.macports.org/zlib
--->  Installing zlib @1.2.8_0
--->  Activating zlib @1.2.8_0
--->  Cleaning zlib
--->  Fetching archive for openssl
--->  Attempting to fetch openssl-1.0.2j_0.darwin_16.x86_64.tbz2 from https://packages.macports.org/openssl
--->  Attempting to fetch openssl-1.0.2j_0.darwin_16.x86_64.tbz2.rmd160 from https://packages.macports.org/openssl
--->  Installing openssl @1.0.2j_0
--->  Activating openssl @1.0.2j_0
--->  Cleaning openssl
--->  Fetching archive for libevent
--->  Attempting to fetch libevent-2.0.22_3.darwin_16.x86_64.tbz2 from https://packages.macports.org/libevent
--->  Attempting to fetch libevent-2.0.22_3.darwin_16.x86_64.tbz2.rmd160 from https://packages.macports.org/libevent
--->  Installing libevent @2.0.22_3
--->  Activating libevent @2.0.22_3
--->  Cleaning libevent
--->  Fetching archive for tor
--->  Attempting to fetch tor-0.2.8.9_0.darwin_16.x86_64.tbz2 from https://packages.macports.org/tor
--->  Attempting to fetch tor-0.2.8.9_0.darwin_16.x86_64.tbz2.rmd160 from https://packages.macports.org/tor
--->  Installing tor @0.2.8.9_0
--->  Activating tor @0.2.8.9_0
--->  Cleaning tor
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  No broken files found.


Command:

$ xcode-select --install


Result:

xcode-select: note: install requested for command line developer tools

macOS Sierra: Tor (anonymity network): Installing ARM (The anonymizing relay monitor): Incomplete

Command:

$ git clone https://git.torproject.org/nyx.git


Result:

Cloning into 'nyx'...
remote: Counting objects: 11674, done.
remote: Compressing objects: 100% (76/76), done.
remote: Total 11674 (delta 42), reused 0 (delta 0)
Receiving objects: 100% (11674/11674), 2.71 MiB | 446.00 KiB/s, done.
Resolving deltas: 100% (9078/9078), done.


Command:

$ cd nyx
$ python setup.py


Result (Error):

Traceback (most recent call last):
  File "setup.py", line 10, in <module>
    import nyx
  File "/Users/USERNAME/nyx/nyx/__init__.py", line 41, in <module>
    import stem
ImportError: No module named stem


Command:

$ sudo pip install stem
Password:


Result:

The directory '/Users/USERNAME/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/USERNAME/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting stem
  Downloading stem-1.4.0.tar.bz2 (1.6MB)
    100% |████████████████████████████████| 1.6MB 718kB/s
Installing collected packages: stem
  Running setup.py install for stem ... done
Successfully installed stem-1.4.0


Command:

$ python setup.py


Result (Error):

Traceback (most recent call last):
  File "setup.py", line 10, in <module>
    import nyx
  File "/Users/USERNAME/nyx/nyx/__init__.py", line 521, in <module>
    import nyx.panel.config
  File "/Users/USERNAME/nyx/nyx/panel/config.py", line 17, in <module>
    import stem.manual
ImportError: No module named manual


Command:

$ python


Result:

Python 2.7.12 (default, Oct 19 2016, 01:11:34)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.


Command:

>>> import sys
>>> sys.path


Result:

['', '/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages', '/usr/local/Cellar/matplotlib/1.5.1/libexec/lib/python2.7/site-packages', '/usr/local/Cellar/numpy/1.11.2/libexec/nose/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg', '/Library/Python/2.7/site-packages']


Command:

>>> quit()
$ ls -al /usr/local/lib/python2.7/site-packages/stem/


Result (Missing stem.manual):

total 1136
drwxr-xr-x  22 root  wheel     748 Oct 27 12:06 .
drwxr-xr-x  43 USERNAME  wheel    1462 Oct 27 12:06 ..
-rw-r--r--   1 root  wheel   25346 May 14  2015 __init__.py
-rw-r--r--   1 root  wheel   27294 Oct 27 12:06 __init__.pyc
-rw-r--r--   1 root  wheel   48656 May 14  2015 connection.py
-rw-r--r--   1 root  wheel   45507 Oct 27 12:06 connection.pyc
-rw-r--r--   1 root  wheel  128760 May 14  2015 control.py
-rw-r--r--   1 root  wheel  118390 Oct 27 12:06 control.pyc
drwxr-xr-x  24 root  wheel     816 Oct 27 12:06 descriptor
-rw-r--r--   1 root  wheel   34569 May 14  2015 exit_policy.py
-rw-r--r--   1 root  wheel   31176 Oct 27 12:06 exit_policy.pyc
drwxr-xr-x  13 root  wheel     442 Oct 27 12:06 interpreter
-rw-r--r--   1 root  wheel    3430 May 14  2015 prereq.py
-rw-r--r--   1 root  wheel    4029 Oct 27 12:06 prereq.pyc
-rw-r--r--   1 root  wheel    8996 May 14  2015 process.py
-rw-r--r--   1 root  wheel    7768 Oct 27 12:06 process.pyc
drwxr-xr-x  18 root  wheel     612 Oct 27 12:06 response
-rw-r--r--   1 root  wheel   21337 May 14  2015 socket.py
-rw-r--r--   1 root  wheel   19283 Oct 27 12:06 socket.pyc
drwxr-xr-x  29 root  wheel     986 Oct 27 12:06 util
-rw-r--r--   1 root  wheel   12810 May 14  2015 version.py
-rw-r--r--   1 root  wheel   14866 Oct 27 12:06 version.pyc

Wednesday, October 26, 2016

Richard Stallman: Talks About Ubuntu

CLISP: For loop Example

Command:

$ cat for_loop.lisp


Result:

(loop for x in '(hello world 123)
      do (print x))


Command:

$ clisp for_loop.lisp


Result:

HELLO
WORLD
123

CLISP: Command-line Argument Parsing Example

Command:

$ cat command_line_args_parsing.lisp


Result:

(print *args*)


Command:

$ clisp command_line_args_parsing.lisp Hello World 123


Result:

("Hello" "World" "123")