Wednesday, June 14, 2023

Entrepreneurship: Startup - Where are you now?

Since 2019, I've had the privilege of working with entrepreneurs as a technology consultant through Dartmouth - Magnuson Center. During this time I met with many startup teams and found patterns on their stages. Here are my metaphorical categories that represent the different stages of startups.


1. Satellite level

    The satellite level, you hear a lot of shiny objects (exciting ideas), each idea has a magnetic pull on you. But everything is too far to grasp. Ideas flutter past, capturing your interest for a day or two. But soon, their luster fades away. At times, you find yourself drawn to an idea simply because of the person who shared it with you. The excitement is so strong that you can't wait to dive in the next morning. Unfortunately, before you even have a chance to fully comprehend the idea, its sparkle diminishes.

  What is evident here is your innate attraction to entrepreneurship. You have a strong desire to utilize your personal time in order to cultivate and establish your own entrepreneurial endeavor.

 Things to consider: When evaluating an idea, go beyond its novelty and feasibility, and prioritize understanding the underlying problem you are seeking to solve. Emphasizing the problem itself will yield greater benefits than immediately embracing the initial solution generated by your team.




   

2. Cloud level

3. Glider Plane level

4. Mountain top level

5. Tree top level

6. Ground level 

7. Tunnel level 



Tuesday, July 5, 2016

Mac TimeMachine Backup Maintenance

Original Source:

http://apple.stackexchange.com/questions/39287/how-can-i-manually-delete-old-backups-to-free-space-for-time-machine/55646


Short notes:

1. COMPUTER_NAME=$(/usr/sbin/scutil --get ComputerName)
2. OLDEST_BACKUP=$(/usr/bin/tmutil listbackups |/usr/bin/grep "$COMPUTER_NAME" |/usr/bin/head -n1);echo $OLDEST_BACKUP
3. sudo /usr/bin/tmutil delete "$OLDEST_BACKUP"


Checks: 


1. NBACKUPS=$(/usr/bin/tmutil listbackups | /usr/bin/grep "$COMPUTER_NAME" | /usr/bin/wc -l); echo $NBACKUPS
2. LATEST_BACKUP=$(/usr/bin/tmutil latestbackup); echo Latest backup: $LATEST_BACKUP




From the apple stackexchange:
COMPUTER_NAME=$(/usr/sbin/scutil --get ComputerName)
NBACKUPS=$(/usr/bin/tmutil listbackups | /usr/bin/grep "$COMPUTER_NAME" | /usr/bin/wc -l)
OLDEST_BACKUP=$(/usr/bin/tmutil listbackups | /usr/bin/grep "$COMPUTER_NAME" | /usr/bin/head -n1)
LATEST_BACKUP=$(/usr/bin/tmutil latestbackup)
echo Latest backup: $LATEST_BACKUP
if [[ -n "$LATEST_BACKUP" && "$LATEST_BACKUP" != "$OLDEST_BACKUP" ]] then
  echo -n "$NBACKUPS backups. Delete oldest: ${OLDEST_BACKUP##*/} [y/N]? "
  read answer
  case $answer in
    y*)
      echo Running: /usr/bin/sudo /usr/bin/tmutil delete "$OLDEST_BACKUP"
      /usr/bin/sudo time /usr/bin/tmutil delete "$OLDEST_BACKUP"
      ;;
    *)
      echo No change
      ;;
  esac
 else
   echo "No backup available for deletion"
 fi

Tuesday, April 19, 2016

Groovy LDAP access

Groovy script to access and modify LDAP or Active Directory using groovy ldap library.

Need following library:
groovy-ldap.jar

Class loading:
this.getClass().classLoader.rootLoader.addURL(new File("lib/groovy-ldap.jar").toURL()); import org.apache.directory.groovyldap.*;

Connecting LDAP:
LDAP = Class.forName("org.apache.directory.groovyldap.LDAP"); SearchScope = Class.forName("org.apache.directory.groovyldap.SearchScope"); host = "<ldap_host_addr>"; ad_user = "<ldap_priv_userid>"; ad_password = "<password>"; ldap = LDAP.newInstance(host, ad_user, ad_password); println "Connected to AD => $host";

Reading an entry:
search_str = "uid=<uid_info>*"; //* regex match entries = ldap.search(search_str, "<ldap_ou_path>", SearchScope.ONE); print "${entries.size} entries are found\n\n"; for (entry in entries) { print """ DN: ${entry.dn} Common name: ${entry.cn} uid: ${entry.uid} Object classes: ${entry.objectclass} """ }

Modify an entry:
//user dn is needed; it wont modify cn dn = "<dn_of_entry_to_be_modified>"; mods = [ ["REPLACE", [<field_name_1>: "<new_value_1>"]], ["REPLACE", [<field_name_2>: "<new_value_2>"]], ["ADD", [<new_field>: "<new_value>"]] ] ldap.modify(dn, mods); print "LDAP entry modified\n";


Groovy OIM Access

Groovy script to access Oracle Identity Management using OIM Client library.
Need following libraries:
spring.jar
oimclient.jar
wlfullclient.jar
authwl.conf file content:
xellerate{ weblogic.security.auth.login.UsernamePasswordLoginModule required debug=true; };

Class loading:
#!/usr/bin/env groovy this.getClass().classLoader.rootLoader.addURL(new File("lib/spring.jar").toURL()); this.getClass().classLoader.rootLoader.addURL(new File("lib/oimclient.jar").toURL()); this.getClass().classLoader.rootLoader.addURL(new File("lib/wlfullclient.jar").toURL()); import oracle.iam.platform.*; import oracle.iam.identity.usermgmt.api.*;

Connecting OIM:
String oimUrl = "<server_url>"; String oimAdmin = "<privileged_user>"; String oimPasswd = "<password>"; String authwlFileName = "authwl.conf"; String authwl = getClass().getClassLoader().getResource(authwlFileName).toString(); System.setProperty("java.security.auth.login.config", authwl); System.setProperty("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory"); System.setProperty("java.naming.provider.url", oimUrl); System.setProperty("OIM.AppServerType", "wls"); System.setProperty("APPSERVER_TYPE", "wls"); def OIMClient = Class.forName("oracle.iam.platform.OIMClient").newInstance(); Hashtable<String, String> env = new Hashtable<String, String>(); env.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory"); env.put("java.naming.provider.url", oimUrl); OIMClient.login(oimAdmin, oimPasswd.toCharArray(), env); println "Connected to OIM => ${oimUrl}\n";

Read an entry:
usrMgr = OIMClient.getService(Class.forName("oracle.iam.identity.usermgmt.api.UserManager")); //Parameters to be read from OIM. Add additional fields based on need usrAttrs = new HashSet<String>(); usrAttrs.add("Common Name"); usrAttrs.add("Display Name"); usrAttrs.add("Email"); usrAttrs.add("First Name"); usrAttrs.add("Initials"); usrAttrs.add("Last Name"); usrAttrs.add("User Login"); user = usrMgr.getDetails("User Login", "<user_login_unique_value>", usrAttrs); //Print usrAttrs.each { println "$it \t\t=> ${user.getAttribute(it)}"; }

Modify an entry:
usrMgr = OIMClient.getService(Class.forName("oracle.iam.identity.usermgmt.api.UserManager")); //collect entityid HashSet<String> retAttrs = new HashSet<String>(); user = usrMgr.getDetails("User Login", "<user_login>", retAttrs); entityId = user.getEntityId(); //create user entry using entityid updateUser = Class.forName("oracle.iam.identity.usermgmt.vo.User").newInstance(entityId); //update the user updateUser.setAttribute("<field_name>", "<new_value>"); //refer OIM form mappings for attribute name usrMgr.modify(updateUser); println "User modified";

Friday, October 23, 2015

YAML Loader - Ruby

Sample YAML Loader:


Assume your yaml file 'email_credential.yml' exists in same directory and in the format below:

email:
  smtp_server: smtp.gmail.com
  smtp_port: 587


Here is the simple snippet to load YAML and collect data:

begin
  yml = YAML.load_file("email_credentials.yml")
  
  email = yml['email']['smtp_server']
  eport = yml['email']['smtp_port']
  
rescue Exception => e
  puts "Email credential YAML loading issue \n" + e.to_s
end

Website Monitor - Ruby Script

Simple Ruby Script file to check the web site and post an email using gmail service.

This script contains 2 main parts

  1. Checking website - for response OK and content
  2. Email to admin on failure [using gmail]

Checking Website:

    url = URI.parse(web_url)
  net_conn = Net::HTTP.new(url.host, url.port)
  net_conn.use_ssl = url.scheme == "https"
  res = net_conn.get('/')

   We can check res.code == 200 and verify res.body includes the content we wanted to see.

Email [Using gmail]

  NOTE: Gmail needs TLS encryption; so enable it before start sending msg
   
    smtp = Net::SMTP.new("smtp.gmail.com", 587)
    smtp.enable_starttls #gmail needs this encryption
    smtp.start("DOMAIN_FILLER", <gmail_acc>, <gmail_pwd>, :logindo |s| 
      s.send_message(<msg>, <gmail_acc>, <to>)
    end  

  Sample GMAIL Msg format:
   msg = [
    "From: WebMonitor <from_addr>",
    "To: Admin <to_addr>",
    "Subject: <subject>",
    "",
    "Hi,",
    "!!MORE DETAILED MSG!!"
  ].join("\r\n");


Gist: https://gist.github.com/sivajankan/8278d75c39bc5a8260ae

The script can be added to crontab to do automated testing

Thursday, August 20, 2015

Selenium - IE remote browser setup

Setup Selenium -  IE remote browser


  1. Install Java. If you are setting up from a base level testing VM, you may need to first install Java.
  2. Download following files from https://code.google.com/p/selenium/downloads/list into your windows machine (This page mostly has latest versions. Pick them)
    • a. selenium-server-standalone-2.39.0.jar
    • b. IEDriverServer _Win32_2.39.0.zip (There is version for 64 bit; pick appropriate version)
  3. Place the jar file and extracted exe file from zip, into C:\SeleniumServer folder
  4. In Command Prompt and navigate to 'C:\SeleniumServer'
  5. Run the command to start the standalone selenium server
java -jar selenium-server-standalone-2.35.0.jar -Djava.util.logging.Level=OFF -Dwebdriver.ie.driver="C:\SeleniumServer\IEDriverServer.exe"