[Swift] expressions require OS X 10.10 / iOS 8 SDKs or later

xcodeThe successor to Objective-C, Swift was announced by Apple in 2014. Instead of waiting I decided to start learning this language in order to add it to my “bag of tricks” as one of my professors would say. Considering I do not always have a laptop with OSX nearby, my work laptop is Windows, I scoured the internet for a way to have a command-line interface to swift. Something similar to tclsh for TCL or irb for Ruby. What I found was this, but it left me a bit hopeless:

`--> sudo xcode-select -switch /Applications/Xcode.app
Password:

``--> lldb --repl

Welcome to Swift!  Type :help for assistance.
println("Hello There!")

error: Swift expressions require OS X 10.10 / iOS 8 SDKs or later.

I guess the above may work in a later version of OS X. But, apparently I need OS X 10.10 or iOS 8 SDKs or later to run swift for the command-line. As of now OS X 10.9 is the latest out and it is what I have, see:

`--> sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.9.5
BuildVersion:	13F34

And, I also have Xcode 6.0.1, see:

`--> xcodebuild -version
Xcode 6.0.1
Build version 6A317

However, it was not until I stumbled upon @swiftLDN twitters page that I learned out how to run swift from the command line. All I needed to do was:

``--> xcrun swift -sdk ios8
<unknown>:0: warning: no such SDK: 'ios8'
Welcome to Swift!  Type :help for assistance.
  1> println("Hello There!")
Hello There!
  2>  

The message about “no such SDK” can be ignored. Apparently, anything can serve as a placeholder after “-sdk”.

Do not get me wrong. Swift works fine in Xcode from the GUI front-end for the current version of OSX and Xcode I have. However, just issuing xcrun swift from the command-line will not cut it just yet.

I hope that help anyone out there.

Cheers!

Posted in General-Tech | Leave a comment

[Futaba] 14SG Transmitter Programming Tips

14SGI came across this very useful video the other day, Futaba 14SG Radio Programming Tips. It is extremely useful for anyone with a Futaba 8FG [Super] or 14SG transmitter. I initially thought the two dials (LD and RD) were useful for pitch and throttle curves, but it just got in the way if they were not properly centered. I find it best to disable them both:

 

Capture

 

Other useful tips include:

  • Disabling Pitch and Throttle Curve Points
  • Disabling Trims
  • Simplifying Exponential Setup

 

 

Posted in General-Tech, Rc | 2 Comments

[Panasonic] Another Television For the Holidays? I Think Not!

panasonic-coverOn October 5th 2011 we purchased our very first flat screen television. After weeks of researching and speaking with colleagues I decided to go with Panasonic. We purchased from the Electronics Expo a Viera 50″ G25 Plasma (TC-P50G25). The whole family was impressed. It was jammed packed with features like an SD Card slot, DLNA for streaming multimedia from our NAS w/ built-in Ethernet to handle all that “Jazz” w/ stunning picture quality. We could not have it any better, but as luck would have it – four months later we had a hairline fracture due to our kids toy hitting the set. Our four year additional warranty – void! To save your eyes on further reading, customer service was the worst!

1st-receipt

Called Panasonic and the store we purchased from (Electronics Expo) – no one would help!

A few months later, I figured – eh, why not? It was accidental damage, let’s just stick with Panasonic. But this time I decided to purchase from Amazon. We went with what was essentially a newer version of our previous set, a Viera TC-P50GT30. It was a bit thinner and I figured, eh why not get a screen proctor? So I did and purchased a TV Armor TV Screen Protector plexiglass. A good year went by and I felt really good about the purchase. A little less than two years and the darn thing would not turn on! However, we were greeted with the friendly “seven blinks of death”. Go figure! And this time I did not purchase the extended warranty – _all_types_of_expletives_here_ !! They don’t make televisions like they used to, eh? The older CRTs lasted decades.

This time around I am not in the mood to purchase another television and if it ends up happening it definitely will not be Panasonic.But, I think I may be able to save the day. Why? I picked up the Panasonic Plasma Technical Guide and Troubleshooting Flowchart and I am feeling lucky. On slide 48 of the pdf is the start of troubleshooting the 7 blinks failure. In short, the problem is either from a faulty SC, SU – SD (these are a pair) or SS board from what I have read and saw on you tube. I could be wrong.7-blinks

 

I did open up the set and located the boards that I think may be the problem as can be seen below:

su_ss_sc

 

 
The next step is to locate and purchase the necessary spare parts. Fingers crossed and I will post my findings good or bad. Say tuned!

Posted in General-Tech | 2 Comments

[RC Heli] How I got hooked on RC Helicopters

Devo 12S w/ case

Devo 12S w/ case

Devo 12S?, Mini-cp? Well, if you have been reading my blog for some time this is definitely a post out-of-the-norm, but I think you should no longer be surprised to see posts about rc helicopters here. I caught the “heli mania flu” while I had free time on paternity leave last month (thanks to my wife and grandparents!). The darn sickness will not go away – all I think about is developing the skills necessary to fly like this guy! It all started when my wife bought our five year old a 20$ cheap ccoaxial toy helicopter from the local store. After setting it up, testing it out and quickly mastering how to fly without crashing within a day or two I started reading about rc helicopters all over the net and watching all the YouTube video I could until I decided to buy one for myself.

This my friends is how I ended up with the “heli mania flu” and it will not go away! Well, not yet at least. 🙂 Since my addiction I have purchased:

It all added up to a pretty penny, but I will not complain – not all the money you spend will be for a good cause! I would not have bought the phoenix simulator with the dx5e, but it was said it would not work with the DEVO 12S without a special adapter which I also ordered. Well, my son how has in own 5-channel transmitter to practice. However, to my surprise the DEVO 12S worked fine with the Phoenix Simulator software without a single hiccup and without the special adapter I ordered. I was able to fly all model helicopters and planes.

I look forward to more posts on the DEVO12S since I am completely fascinated with it. I plan to post the setup up configuring Phoenix simulator with the DEVO 12S and how to update the firmware so it can fly with non-Walkera helicopters. I am still a noob at flying rc helicopters, but below are some really useful information that helped increase my knowledge about the hobby, though I still have much, much more to learn!

For now I will stick with the simulator until I master my orientations, circuits, lazy-8s and all the other basic maneuvers. Let’s just say the mini cp will now be used for dissection. Either the mini cp is just too fragile or I crashed it way too many times! 🙂

Check out this 11 year old, Tal Roglit, fly the Raptor G4 E720.

Posted in General-Tech | 1 Comment

[BSDA] Certification Holding Due to Expire in 2013

ImageWhen I took my BSDA certification exam back in August of 2008 it was on a whim. It was offered at Columbia University. I reviewed the exam objectives a few days before and passed the exam with flying colors! Since then, I have been using mainly Solaris 11 for hopes of passing the Solaris 11 Advanced Certification. So, I am sure I probably forgot a good portion of BSD Administration by now! It was on my mind recently that the BSDA exam would expire this year, but never gave it further thought. Coincidentally, the other day I received a pleasant surprise email from Dru Lavigne, the mother of BSD stating the my certification would expire after 2013.

In August and in Philadelphia, at the FOSSCON, the BSDA exam was offered, but I did not make it. However, I was surprised to learn that the BSDA can now be taken at select testing centers.

The BSD Certification has partnered with ISO Quality to offer the BSDA exam and will probably offer the BSDP once ready.

The fee for the exam is $150.00 US and can be paid for at the following link:

Unfortunately, once registered for the exam there is an additional fee to change the date. Be ware! Though, you have a year to book and take your exam once the fee has been paid.

Posted in *Nix | Tagged , , , , , , , | Leave a comment

[avconv] Convert WMV to MP4

I just came across a great tool for converting .wmv files to .mp4 and various other formats. I needed to perform this this conversion because either my Panasonic DLNA equipped TV could not playback .wmv files or was it the fault of my QNAP DLNA server? However, .mp4 encoded files play without issue. In the past the tool of choice was ffmpeg, but it is now deprecated and it is suggested to use avconv not and in the near future:

`--> ffmpeg
ffmpeg version 0.8.4-6:0.8.4-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Nov  6 2012 16:51:11 with gcc 4.7.2
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.

To check the available codecs on your system, the ‘-codecs’ option to avconv displays all supported codecs and whether it is possible to encode, decode and perform various other tasks as the legend shows. To the left of codec are the supported functions. For example:

`--> avconv -codecs | head -10 && avconv -loglevel quiet -codecs | egrep "(wmv)"
avconv version 0.8.4-6:0.8.4-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Nov  6 2012 16:51:11 with gcc 4.7.2
Codecs:
 D..... = Decoding supported
 .E.... = Encoding supported
 ..V... = Video codec
 ..A... = Audio codec
 ..S... = Subtitle codec
 ...S.. = Supports draw_horiz_band
 ....D. = Supports direct rendering method 1
 .....T = Supports weird frame truncation
 ------
 DEVSD  wmv1            Windows Media Video 7
 DEVSD  wmv2            Windows Media Video 8
 D V D  wmv3            Windows Media Video 9
 D V D  wmv3_vdpau      Windows Media Video 9 VDPAU
 D V D  wmv3image       Windows Media Video 9 Image

To convert our sample file: 1-25_681_webinar_2.wmv, 44MB in size, with the following characteristics:

`--> du -sh 1-25_681_webinar_2.wmv
44M     1-25_681_webinar_2.wmv

`--> avconv -i 1-25_681_webinar_2.wmv
avconv version 0.8.4-6:0.8.4-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Nov  6 2012 16:51:11 with gcc 4.7.2
[wmv3 @ 0xa50be0] Extra data: 8 bits left, value: 0
Input #0, asf, from '1-25_681_webinar_2.wmv':
  Metadata:
    title           : 1-25 681 webinar 2
    WMFSDKVersion   : 11.0.5721.5251
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 1
    VBR Peak        : 295
    Buffer Average  : 772
  Duration: 01:02:38.47, start: 0.000000, bitrate: 96 kb/s
    Stream #0.0(eng): Audio: wmav2, 44100 Hz, 1 channels, s16, 48 kb/s
    Stream #0.1(eng): Video: wmv3 (Main), yuv420p, 640x416, 37 kb/s, 15 tbr, 1k tbn, 1k tbc
At least one output file must be specified

to .mp4 we perform:

`--> sudo avconv -i 1-25_681_webinar_2.wmv -strict experimental 1-25_681_webinar_2.mp4

where the .wmv input file (-i) is encoded into .mp4 using the experimental ‘aac’ encoder (-stric experimental):

avconv version 0.8.4-6:0.8.4-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Nov  6 2012 16:51:11 with gcc 4.7.2
[wmv3 @ 0x1bd6be0] Extra data: 8 bits left, value: 0
Input #0, asf, from '1-25_681_webinar_2.wmv':
  Metadata:
    title           : 1-25 681 webinar 2
    WMFSDKVersion   : 11.0.5721.5251
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 1
    VBR Peak        : 295
    Buffer Average  : 772
  Duration: 01:02:38.47, start: 0.000000, bitrate: 96 kb/s
    Stream #0.0(eng): Audio: wmav2, 44100 Hz, 1 channels, s16, 48 kb/s
    Stream #0.1(eng): Video: wmv3 (Main), yuv420p, 640x416, 37 kb/s, 15 tbr, 1k tbn, 1k tbc
File '1-25_681_webinar_2.mp4' already exists. Overwrite ? [y/N] y
[buffer @ 0x1bd8860] w:640 h:416 pixfmt:yuv420p
[wmv3 @ 0x1bd6be0] Extra data: 8 bits left, value: 0
Output #0, mp4, to '1-25_681_webinar_2.mp4':
  Metadata:
    title           : 1-25 681 webinar 2
    WMFSDKVersion   : 11.0.5721.5251
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 1
    VBR Peak        : 295
    Buffer Average  : 772
    encoder         : Lavf53.21.0
    Stream #0.0(eng): Video: mpeg4, yuv420p, 640x416, q=2-31, 200 kb/s, 15 tbn, 15 tbc
    Stream #0.1(eng): Audio: aac, 44100 Hz, 1 channels, s16, 200 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (wmv3 -> mpeg4)
  Stream #0:0 -> #0:1 (wmav2 -> aac)
Press ctrl-c to stop encoding
frame=56377 fps=131 q=27.9 Lsize=  163756kB time=3758.47 bitrate= 356.9kbits/s
video:92153kB audio:69879kB global headers:0kB muxing overhead 1.064378%
178.31s user 8.23s system 43% cpu 7:12.13s total

I was surprised to see the resulting .mp4 was more than twice (160M) as large of the original!

`--> du -sh 1-25_681_webinar_2.*
160M    1-25_681_webinar_2.mp4
44M     1-25_681_webinar_2.wmv

Update: An anonymous commenter felt my pain and suggested I could have reduced the file size further by including the option “-tune film”. As of today and with the current version of avconv using ‘-tune film’ is no longer necessary. The resulting file size is smaller than in my initial post with this version of avconv:

avconv -version
avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
avconv 9.16-6:9.16-0ubuntu0.14.04.1
libavutil 52. 3. 0 / 52. 3. 0
libavcodec 54. 35. 0 / 54. 35. 0
libavformat 54. 20. 4 / 54. 20. 4
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 3. 3. 0 / 3. 3. 0
libavresample 1. 0. 1 / 1. 0. 1
libswscale 2. 1. 1 / 2. 1. 1
[/sourcecode]

Here are the file sizes of the same file with and then without the use of ‘-tune film’ (which by the way is not in the man page, but accepted as a valid argument):

With option “-tune film”

avconv -i 1-25_681_webinar_2.wmv -strict experimental -tune film 1-25_681_webinar_2.mp4

...output truncated...
[libx264 @ 0x7d6080] ref B L1: 94.5%  5.5%
[libx264 @ 0x7d6080] kb/s:40.87
504.36s user 6.57s system 331% cpu 2:34.02s total

File sizes after conversion with “-tune film”

du -h 1-25_681_webinar_2.*
83M     1-25_681_webinar_2.mp4
44M     1-25_681_webinar_2.wmv
\rm -f 1-25_681_webinar_2.mp4

WITHOUT option “-tune film”

avconv -i 1-25_681_webinar_2.wmv -strict experimental 1-25_681_webinar_2.mp4
..output truncated...
[libx264 @ 0x15b1fa0] kb/s:39.45
505.83s user 7.31s system 329% cpu 2:35.65s total

File sizes after conversion WITHOUT “-tune film”

du -h 1-25_681_webinar_2.*
83M     1-25_681_webinar_2.mp4
44M     1-25_681_webinar_2.wmv

Thanks to the anonymous commenter and those working on avconv.

Posted in *Nix | Tagged , , , , | 4 Comments

[QNAP] New NAS — TS-569L-US: Just Ordered!

ImageMy QNAP will be delivered this week, in time to start the new year (2013) off right! During my waiting period I started searching for the right memory module to upgrade from 1GB to a total (max) of 3GB. The exact type of memory to use for this QNAP NAS is not disclosed, but on the QNAP website they are selling 2GB for over $150.00 USD!! And, I am not buying that!

After searching the forums one member recommended Kingston KVR1333D3S8S9/2G, which could be found really cheap, for about $10-$30 dollars online. Another member suggested that the memory module inside their TS-269L is that made by ADATA. Based on the specs provided by QNAP on their website:2GB DDR3-1333 204Pin SO-DIMM RAM Module, I decided to purchase the following memory module from Amazon.com: ADATA Premier Series DDR3 1333Mhz 2 GB. The reviews are pretty fair and I will try my luck!

For the harddrives I am starting off with three (3) x 2TB Western Digital Red Drives, ordered right from Amazon! They will be used in a Raid-5 configuration for a total of 4TB, which should be enough for my need for now. I have been very luck for the past five (5) years without having to ever change a single drive in my Hammer N1200 and is still running fine now! **Knock on wood** :).

Posted in General-Tech | Leave a comment

[2012 in review] Site Stats

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

19,000 people fit into the new Barclays Center to see Jay-Z perform. This blog was viewed about 86,000 times in 2012. If it were a concert at the Barclays Center, it would take about 5 sold-out performances for that many people to see it.

Click here to see the complete report.

Posted in General-Tech | Leave a comment

[Puppet] Adding The Schema for Storing Node Definitions In LDAP

Puppet allows the storage of node information in LDAP. For this write-up I will detail how to configure an Oracle Directory Server to store node information that can later be used by a puppet server for the retrieval of node classification information. The use of LDAP eliminates the need of having to use the flat file node.pp for node definitions.

On the server acting as the “puppet master”, ruby ldap client libraries are required. In the example below our “puppet master” server has already been configured on a ubuntu linux server.

Ensure ruby client libraries are installed:

After verifying the absence of the ruby client libraries we install them below:

--> aptitude search ruby | grep -i ldap
...edited...
p   libldap-ruby1.8                 - OpenLDAP library binding for Ruby 1.8
...edited...

--> aptitude install libldap-ruby1.8
...edited...
Fetched 66.8 kB in 0s (109 kB/s)
Selecting previously deselected package libldap-ruby1.8.
(Reading database ... 63468 files and directories currently installed.)
Unpacking libldap-ruby1.8 (from .../libldap-ruby1.8_0.9.7-1.1_amd64.deb) ...
Setting up libldap-ruby1.8 (0.9.7-1.1) ...

`--> ruby -rldap -e "puts :installed"
installed

Update /etc/puppet/puppet.conf to use LDAP

Change your “/etc/puppet/puppet.conf” [master] section to use ldap for node lookups on the master server. For example, the following should be placed in the /etc/puppet/puppet.conf file underneath the section [master]:

[master]
node_terminus = ldap
ldapserver = odsee.goldcoast.com
ldapbase = ou=hosts,dc=goldcoast,dc=com

Were ‘node_terminus’ was originally using file, but will now use ldap. ‘ldapserver’ should point to a valid ldap server that can be accessed on port 389. ‘ldapbase’ is where the puppet master server will look for node information. We will populate this organizational unit (ou) later on. Once the changes have been saved restart the “puppet master”. The ‘nope.pp’ file should no longer be referenced by the master server. But before discarding the file entirely we need to configure LDAP to add the custom puppet schema for our node definitions.

Adding the Puppet Schema to LDAP Directory Server

Next we need to populate our LDAP server to contain the puppet.schema definitions. I recommend visiting the following url for the latest puppet schema:

https://github.com/puppetlabs/puppet/blob/master/ext/ldap/puppet.schema

Login into your directory server. Copy the contents of ‘puppet.schema’ to a temporary file, for example to: /tmp/98puppet.ldif.tmp. The file as is, as of this writing, cannot be imported into Oracle Directory Server Enterprise (ODSEE) without modification.

The original ‘puppet.schema’ looks like:

bash-3.00# cat > /tmp/98puppet.ldif.tmp
attributetype ( 1.3.6.1.4.1.34380.1.1.3.10 NAME 'puppetClass'
DESC 'Puppet Node Class'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )

attributetype ( 1.3.6.1.4.1.34380.1.1.3.9 NAME 'parentNode'
DESC 'Puppet Parent Node'
EQUALITY caseIgnoreIA5Match
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
        SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.34380.1.1.3.11 NAME 'environment'
DESC 'Puppet Node Environment'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )

attributetype ( 1.3.6.1.4.1.34380.1.1.3.12 NAME 'puppetVar'
DESC 'A variable setting for puppet'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )

objectclass ( 1.3.6.1.4.1.34380.1.1.1.2 NAME 'puppetClient' SUP top AUXILIARY
DESC 'Puppet Client objectclass'
MAY ( puppetclass $ parentnode $ environment $ puppetvar ))

It can be easily converted with the following script, located at:

http://directory.fedoraproject.org/wiki/Howto:OpenLDAPMigration.

in order to work with ODSEE. For example:

bash-3.00# cd /tmp/

bash-3.00# perl ldif2dsee.pl 98puppet.ldif.tmp > 98puppet.ldif

After Conversion, the puppet schema will look like:

bash-3.00# cat 98puppet.ldif

dn: cn=schema
attributeTypes: ( 1.3.6.1.4.1.34380.1.1.3.10 NAME 'puppetClass' DESC 'Puppet Node Class' EQUALITY cas
eIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'PUPPET')
attributeTypes: ( 1.3.6.1.4.1.34380.1.1.3.9 NAME 'parentNode' DESC 'Puppet Parent Node' EQUALITY case
IgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'PUPPET')
attributeTypes: ( 1.3.6.1.4.1.34380.1.1.3.11 NAME 'environment' DESC 'Puppet Node Environment' EQUALI
TY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'PUPPET')
attributeTypes: ( 1.3.6.1.4.1.34380.1.1.3.12 NAME 'puppetVar' DESC 'A variable setting for puppet' EQ
UALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'PUPPET')
objectClasses: ( 1.3.6.1.4.1.34380.1.1.1.2 NAME 'puppetClient' SUP top AUXILIARY DESC 'Puppet Client 
objectclass' MAY ( puppetClass $ parentNode $ environment $ puppetVar ) X-ORIGIN 'PUPPET')

Copy the resulting file, /tmp/98puppet.ldif, under the ODSEE schema/ path. This is usually under instance-path/config/schema/ :

bash-3.00# cp /tmp/98puppet.ldif /odsee/config/schema/

Restart the LDAP Instance

Before restarting the instance, tail the errors log file, instance-path/logs/errors in one window and in another restart the ldap instance ensuring there were no errors. For example, after restarting the instance:

bash-3.00# dsadm restart /odsee
Directory Server instance '/odsee' stopped

Note: Notice after the restart, the message says “… ‘/odsee’ stopped”. It should have said “… ‘/odsee’ restarted

The errors window should have displayed something similiar to:

[21/Jan/2012:22:25:43 -0500] - slapd shutting down - waiting for 0 threads to terminate
[21/Jan/2012:22:25:43 -0500] - libumem_dummy_thread started.
[21/Jan/2012:22:25:43 -0500] - Waiting for 6 database threads to stop
[21/Jan/2012:22:25:44 -0500] - All database threads now stopped
[21/Jan/2012:22:25:44 -0500] - slapd stopped.
[21/Jan/2012:22:25:47 -0500] - Sun-Directory-Server/11.1.1.3.0 B2010.0630.2254 (64-bit) starting up
[21/Jan/2012:22:25:49 -0500] - Listening on all interfaces port 389 for LDAP requests
[21/Jan/2012:22:25:49 -0500] - Listening on all interfaces port 636 for LDAPS requests
[21/Jan/2012:22:25:49 -0500] - slapd started. 
[21/Jan/2012:22:25:49 -0500] - INFO: 97 entries in the directory database.
...edited...

Verify The Puppet Schema is in LDAP

While still logged into the LDAP server, perform a basic search which should return the schema that was just imported.

bash-3.00# ldapsearch -T -b cn=schema "(objectclass=*)" | grep -i puppet

attributeTypes: ( 1.3.6.1.4.1.34380.1.1.3.11 NAME 'environment' DESC 'Puppet Node Environment' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'PUPPET' )
attributeTypes: ( 1.3.6.1.4.1.34380.1.1.3.10 NAME 'puppetClass' DESC 'Puppet Node Class' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'PUPPET' )
attributeTypes: ( 1.3.6.1.4.1.34380.1.1.3.9 NAME 'parentNode' DESC 'Puppet Parent Node' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'PUPPET' )
attributeTypes: ( 1.3.6.1.4.1.34380.1.1.3.12 NAME 'puppetVar' DESC 'A variable setting for puppet' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'PUPPET' )
objectClasses: ( 1.3.6.1.4.1.34380.1.1.1.2 NAME 'puppetClient' DESC 'Puppet Client objectclass' STRUCTURAL MAY ( puppetClass $ parentNode $ environment $ puppetVar ) X-ORIGIN 'PUPPET' )

Now you should be able to add node information within LDAP.

Add a base node to LDAP

I like to use the command line tool ldapvi for manipulating my ldap entries. I will not go into detail on how to configure ldapvi, but additional information may be found online. Let’s add a base node and assign the “base class” to it. We will place “cn=base”, under the “search base” ou=hosts,cn=goldcoast,dc=com:

--> ldapvi --add -o top -o device -o puppetClient -b cn=base,ou=hosts,cn=goldcoast,cn=com

After invocation, your default editor will open up with a screen similar to this:

# -*- coding: utf-8 -*- vim:encoding=utf-8:
# http://www.lichteblau.com/ldapvi/manual#syntax

### NOTE: objectclass is abstract: top
# structural object class: device
### WARNING: extra structural object class: puppetClient
add cn=base,ou=hosts,cn=goldcoast,cn=com
objectClass: top
objectClass: device
objectClass: puppetClient
cn:
#description:
#l:
#o:
#ou:
#owner:
#seeAlso:
#serialNumber:
puppetClass: base
#parentNode:
#environment:
#puppetVar:

My default editor is “vim” and I uncommented “puppetClass:” in order to use the “base” class for the “base node”. Once done, save and quit the file and you should be presented with authentication to commit the change to ldap — something similiar to:

...edited...
~
/tmp/ldapvi-usdGC1/data: 22 lines, 457 characters.
add: 1, rename: 0, modify: 0, delete: 0
Action? [yYqQvVebB*rsf+?] b

--- Login
Type M-h for help on key bindings.

Filter or DN: 
    Password: 

Cheers,
-swinful

Posted in *Nix | Leave a comment

[Solaris 11 Express] Configuring Samba via ZFS for use in ActiveDirectory

“Eh, I checked everywhere! I cannot find that smb.conf. Where could it have gone!?” And I thought he was lying when a colleague of mine mentioned this, trying to enable samba. Well, I checked and could not find any trace of the smb.conf file either. Although samba was enabled via ZFS and we could see the windows shares, we could not access them. Sure enabling samba via zfs was fairly simple and I enabled samba as follows. Considering tank is our dataset on a system called army) with the domain goldcoast.com I performed:

# zfs sharesmb=on tank

which should implicitly enable the SMF: svc:/network/smb/server:default

What was actually missing, since we are in an Active Directory environment was joining our Solaris host to the domain and mapping corresponding Windows users to Unix users — provided the Windows and Unix usernames are the same and in this case they were.

Join Solaris to the Active Directory domain:

# smbadm join -u administrator goldcoast.com

At his point the Windows shares were now accessible, but you may have noticed the file mappings were wrong. For example, on the Windows side of things if you created a new file the owner and group would appear differently on the Unix side, similiar to the below listing:

# ls -ltr
   -rwx------+ 1 2147540993 2147483653          0 May 10 16:24 New Text Document.txt                    

And with permissions like that, in a shared environment there are sure to be a lot of complaints.

To map all AD users that are part of domain goldcoast.com, considering the local unix accounts have the same name we performed:

# idmap add "winuser:*@goldcoast.com" unixuser:*

And samba is enabled. Try it, try to access the share from Windows using

Start -> Run: \\army\tank

If your Windows machine is connected to an ActiveDirectory Controller you should be prompted for a username/password dialog.


References:

  1. Solaris CIFS Permissions
  2. Oracle Solaris SMB and Windows Interoperability Administration Guide

Posted in *Nix | Leave a comment