Friday, December 16, 2016

Orbiter 2016 - Delta Glider IV autopilot


ALT+1  PRO400SPEC01  Taxiing hold speed (maintain a speed of 10 m/s)
ALT+2  PRO400SPEC18  Aproach hold speed (maintain a speed of 180 m/s)
ALT+3  PRO400SPEC25  Flight hold speed (maintain a speed of 250 m/s)
ALT+4  PRO300SPEC0   Docking auto (Automatically dock your DGIV)
ALT+5  PRO110SPEC0   Atmospheric flight autopilot (heading, altitude &speed)
ALT+6  PRO903SPEC40  Earth ascent to low orbit. (normal take-off)
ALT+7  PR105SPEC40   Automatic reentry

PRO104SPEC40 Manual rentry (Hold attitude with selected AOA)
PRO105SPEC40 Auto reentry (keep a low temperature reentry profile)
PRO200SPEC7  Manual Hover
PRO200SPEC8  Auto Hover
PRO500SPEC0  Null relative speed in regard of a close object (in space only)
PRO904SPECnn Earth ascent autopilot with automatic hover take-off.
PRO905SPECnn Moon ascent autopilot with automatic hover take-off.
PRO906SPECnn Mars ascent autopilot with automatic hover take-off.

Launch Azimuth = arcsin (cos (desired_orbital_inclination) / cos (launch_ latitude))

KSC(28.591) to ISS (51.56) => 45.075°(PRO904SPEC45)

Merci beaucoup Dansteph.

Numpad thrusters (translation mode):

  • 0: hover +
  • .: hover -
  • 1: left
  • 2: up
  • 3: right
  • 4: (inactive)
  • 5: killrot
  • 6: forward
  • 7: (inactive)
  • 8: down
  • 9: retro



Wednesday, August 10, 2016


In the Spring Java framework, referencing autowired beans with session or request scope requires CGLIB proxies, e.g.:

@Scope(value = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)

This in turn requires that unit and integration tests (e.g. JUnit or Spock) use
@WebAppConfiguration in their class declarations.

Tuesday, February 16, 2016

Quick and dirty: one-line FTP server (Python)


sudo pip install pyftpdlib

python -m pyftpdlib -w #(deprecated) 

sudo python -m pyftpdlib.ftpserver

Friday, February 12, 2016

Fast port scanning with nmap


Use nmap to test for listening services on a range of ports

nmap -sS --reason -T4 -p32000-32100 10.10.10.10/32

Explanation of arguments

-sS: TCP SYN scan. Also known as half-open scan. It requires root privileges (see -sT if this is an issue). It is fast, enabling testing of large numbers of ports (assuming high network bandwidth and absence of rate-limiting firewalls). It is unobtrusive since it does not complete TCP connections: it sends a SYN packet and checks the response. It allows clear differentiation between listening (a SYN/ACK response), not listening (a RST/reset response) or filtered (no response after retries).

--reason: Shows details regarding why each port is reported in the given state

-T<0-5>: Timing template.  The respective, equivalent text flags are instructive: paranoid (0), sneaky (1), polite (2), normal (3), aggressive (4), insane (5). Higher is faster. The default is normal (3), but it is often too slow in practice for large port ranges. Higher values must be used cautiously, as they can either stress or crash target systems or easily trigger intrusion detection systems. I have found T4 to be practical for routine systems diagnostics work. T4 is the equivalent of --max-rtt-timeout 1250ms --min-rtt-timeout 100ms --initial-rtt-timeout 500ms --max-retries 6. When scanning many ports on a reliable network, I override maximum retries to accelerate the scan with --max-retries=0.

-p: Port range

Hosts: Target hosts, represented as IP addresses, with a given host mask. In the example, 10.10.10.10/32, a single host is requested. A mask shorter than 32 bits designates ranges, e.g. 10.10.10.0/24, includes 10.10.10.0 through 10.10.10.255

Friday, January 15, 2016

More jq magic for JSON wrangling


Count number of JSON elements in an embedded array

Data out of an Elasticsearch aggregation result set: 

{
  "aggregations": {
    "flightdestination": {
      "buckets": [
        {
          "sentiment": {
            "value": 2.1706734237483767
          },
          "doc_count": 6931,
          "key": "newark"
        },
        {
          "sentiment": {
            "value": 2.17875893247776
          },
          "doc_count": 6857,
          "key": "houston"

        },
...

curl -s 'http://10.60.35.34:9200/1$1_0/sentence/_search' -XGET --data "$(cat ~/query.json)" | jq '.aggregations.flightdestination.buckets | length'

Tuesday, December 15, 2015

Docker lessons from the front lines


  • Be careful when mapping host volumes: filesystem types matter greatly in Docker, and something as simple as mapping /tmp or /dev from the host can result in obscure errors, e.g. Error response from daemon: Cannot start container xxxxxxx : [8] System error: no such file or directory
  • Default log file locations for the Docker daemon vary by distribution, typically determined by the init system:
    • /var/log/upstart/docker.log (Debian/Ubuntu)
    • /var/log/docker.log (CentOS)
  • Start Docker with debug logging.
    • Directly from command line: 
      • sudo DOCKER_OPTS='--log-level=debug' service docker start
    • Also possible through settings in /etc/default/docker.conf

Thursday, December 03, 2015

Linux resource monitoring tools


Command line tools for monitoring system resource utilization:

  • top
  • htop (visual version of top)
  • iotop (disk I/O by process)
  • iftop (network I/O by host)

Tuesday, October 20, 2015

Run NPM behind a proxy


NPM does not obey the proxy configuration set in $http_proxy and $https_proxy as curl and other common tools. It is instead necessary to define NPM-specific settings as follows.
 
npm config set strict-ssl false
npm config set registry "http://registry.npmjs.org/"

# Adjust username, password and proxy endpoint as needed
npm set proxy $http_proxy
# Also for HTTPS: pay attention to protocol 
npm set https-proxy https://<yourproxy>

These last two commands simply write the specified values to their ultimate location: ~/.npmrc

If you need to specify credentials and/or a port, use:

username:password@yourproxy:port, e.g.
proxyuser:pwd123@proxy.mydomain.com:3128
 



Friday, September 04, 2015

NPM without sudo


In development environments, access to install NPM global packages under the standard /usr path if often restricted. Instead of using sudo for global package installation, which is rarely the desired solution in development, it is possible to instruct NPM to use a directory owned by the logon user as follows:

mkdir ~/npm
npm config set prefix ~/npm

After this, installing a package globally, such as:

npm install -g async

will result int the library files being placed under the configured location (~/npm in this example).

Tuesday, September 01, 2015

Awk: generate random sentences


cat /usr/share/dict/words | 
  grep -v "'" | 
  shuf | 
  awk -v wordCount=100 -v wordsPerSentence=5 '
    BEGIN {i=0} 
    (NR<wordCount) {
      if (i<wordsPerSentence) {
        a[i]=$0; 
        i++
      } else {
        for (j=0;j<length(a);j++) {
          printf ("%s ",a[j])
      }
      print
      i=0
    }
  }'