Tag: how-to

  • oh-my-zsh: Insecure completion-dependent directories detected

    In case you encounter this error on installing oh-my-zsh, do the chmod commands below. ?  ~ source ~/.zshrc                                                                                                   [oh-my-zsh] Insecure completion-dependent directories detected: drwxrwxr-x  16 Anton.Perez  admin  512 May  4 10:42 /usr/local/share [oh-my-zsh] For safety, we will not load completions from these directories until [oh-my-zsh] you fix their permissions and ownership and restart zsh. [oh-my-zsh] See the above list for…

  • How to add environment variables in Mac OS X

    ,

    Adding here for reference (tried this in Mac OS X Mojave): # To set an environment variable, enter the following command: launchctl setenv variable "value" # To find out if an environment variable is set, use the following command: launchctl getenv variable # To clear an environment variable, use the following command: launchctl unsetenv variable

  • Install sqlcmd on Mac OS X

    , ,

    In case you need to run SQL Server scripts from your Mac, do the following to install (NOTE: I use HomeBrew.): From the terminal, type: brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release ACCEPT_EULA=y brew install –no-sandbox msodbcsql mssql-tools You should see something like in the screenshot. Type “YES” if prompted and be on your way. Once done, type:…

  • Selenium: How to assert a WebElement that doesn’t exist

    ,

    Just in case you need to assert that a WebElement doesn’t exist, here’s a code snippet that you can use. Java public int isElementPresent(String xpath) {     return  driver.findElements(By.xpath(xpath)).size(); } Cucumber @Then("^I expect to see the link On the page$") public void iExpectToSeeTheLinkOnThePage() {     assertTrue(demoPage.isElementPresent() > 1); }

  • Git: Syncing fork repo against upstream repo

    ,

    In case you need to make sure your forked repo is up-to-date with the original repo (i.e. /git/original/HelloWorld vs /git/anton/HelloWorld), here’s what you need to do in your terminal: $ git remote -v $ git remote add upstream git@git.url.io:original/HelloWorld.git $ git remote -v $ git fetch upstream $ git checkout master $ git merge upstream/master $…

  • Java: One-liner check if you have the JCE Unlimited Strength Jurisdiction Policy

    ,

    In case you installed the the “stronger” Java Crytography Extension, you can check with: $JAVA_HOME/bin/jrunscript -e 'print (javax.crypto.Cipher.getMaxAllowedKeyLength("RC5") >= 256);'