Another star!

July 7, 2016

A lot of people run into me in the Cisco Support Forums as I try to keep pretty active not only to keep my memory fresh on some stuff I don’t touch much but to also keep a pulse on what the world is working on. The forum allows other users to provide you with points based on how they find your answers useful. Just got to the next level based on points awarded, a lovely shade of blue.

image

The breakdown:

image

Using git to push and pull repositories.

February 17, 2016

I’ve been trying to get more proficient with git and figured the only way to do that is to get my hands dirty and write some simple app(s) and push them to a production server. There are my notes, mainly for me to help me remember how this stuff works.

The very first time you do a git init to initialize your repository.

git init

You do this every time you want to add new changes to your reposiotry.

git add .

To see the status of things which are going to be added, removed.

git status

Once you’re happy with what you want to commit, leave your future self a little love note.

git commit –m “Doing something”

You only do this the first time to setup your remote repository destination.

git remote add origin git@github.com:dmaciasSS/myrepo.git

Then you do this every time you want to push your commit.

git push –u origin master

Now, let’s say I want to pull my repository to a new host e.g. production. If you’re using Laravel make sure you’re setting up your environment name in your vhost file first.

sudo git clone https://github.com/dmaciasSS/myrepo.git locaton/in/my/server

Laravel specific commands.

chown -R :www-data app/storage

chmod –R 777 app/storage

‘composer install’

php artisan cache:clear

I’ve found for 5.1 you might have to do this the first time too.

mkdir storage/views

mkdir storage/sessions

chown –R :www-data app/storage

Now, once you’ve cloned your repository you need to updated it every time you want to pull down any new commits.

sudo git pull origin master

composer update

php artisan cache:clear

~david

Microsoft Azure and Laravel 5.1 from Scratch

February 16, 2016

While most people use AWS, I like to use Azure and there’s just not a lot of information relating Azure and Laravel, so figured this might be useful for others. This assumes a level of comfort with Linux and Azure.

  • Login: https://portal.azure.com/#
  • Click on Virtual machines (classic) and search for Ubuntu. My preference has always been Ubuntu server 14.04 LTS, select this.
  • Select deployment model: Resource Manager and click Create.
  • Give your VM some basic information: Name, User name, Authentication Type (SSH public key is my preference). Create a new resource group, I always use the same name as the VM and Location. I usually do the A1 Standard size.
  • Click ok to choose the defauls under Settings.
  • Click OK on summary and your VM will start deploying, this will take about 10-15 minutes to complete.
  • Once running, click the VM, Public Ip address/DNS name label, All Settings, Configuration, and give it a DNS name. I do this to not have to deal with IP addresses and use actual names.

At this point, I created a CustomScript Extension using this https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-script-lamp/ and http://tutsnare.com/how-to-install-laravel-on-ubuntu-lamp/ and http://tecadmin.net/install-laravel-framework-on-ubuntu/ This will install everything you need. The script is below. To run the script through the CLI you need to use this command: azure vm extension set -c "./public_config.json" <yourresourcegroup> <yourvm> CustomScriptForLinux Microsoft.OSTCExtensions 1.4
If you want to run the script manually, just SSH into your VM and go through every step below starting at "sudo apt-get -y".

  • SSH into your machine.
  • Instal composer: curl -sS https://getcomposer.org/installer | php
  • Move composer globally: sudo mv composer.phar /usr/local/bin/composer
  • Install Laravel: sudo composer create-project laravel/laravel /var/www/laravel 5.1.*
    • sudo mkdir laravel/app/storage
    • sudo chown -R www-data.www-data /var/www/laravel
    • sudo chmod -R 755 /var/www/laravel
    • sudo chmod -R 777 /var/www/laravel/app/storage
  • Create VirtualHost and use sample below: vim /etc/apache2/sites-available/yourhost.com.conf
  • Enable your site config: sudo a2ensite yourhost.com
  • Reload Apache: sudo service apache2 reload
  • Disable default site: sudo a2dissite 0000-default
  • Reload Apache: sudo service apache2 reload
  • Open VM firewall: sudo iptables -A INPUT -p tcp –dport 80 -j ACCEPT
  • Restart VM: sudo shutdown -r now
  • In Azure Portal Network Security Group find "inbound security rules" and add a rule for port 80.
  • Go to your http://yourhost.com Welcome!

Azure LAMP install script:
#!/bin/bash
# set up a silent install of MySQL
dbpass="YourPasswordHere"

export DEBIAN_FRONTEND=noninteractive
echo mysql-server-5.6 mysql-server/root_password password $dbpass | debconf-set-selections
echo mysql-server-5.6 mysql-server/root_password_again password $dbpass | debconf-set-selections

# install the LAMP stack
sudo apt-get -y install apache2 mysql-server php5 php5-mysql php5-curl

#install extensions
#installing json extension
sudo apt-get install php5-json
#installing unzip extension
sudo apt-get install unzip
#installing curl extension
sudo apt-get install curl
#installing openssl extension
sudo apt-get install openssl
#installing mcrypt extension
sudo apt-get install php5-mcrypt
#enable mcrypt extension
sudo php5enmod mcrypt
#installing git
sudo apt-get install -y git-core
#enable mod rewrite extension
sudo a2enmod rewrite

# write some PHP
echo \<center\>\<h1\>My Demo App\</h1\>\<br/\>\</center\> > /var/www/html/phpinfo.php
echo \<\?php phpinfo\(\)\; \?\> >> /var/www/html/phpinfo.php

# restart Apache
sudo apachectl restart

Yourhost.com.conf:
<VirtualHost *:80>
       
        ServerName laravel.example.com
        DocumentRoot /var/www/laravel/public

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/laravel>
                AllowOverride All
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

For posterity.

This is case sensative.
public_config.json:{"fileUris":["/scripts/Laravel.sh"]’>/scripts/Laravel.sh"]’>/scripts/Laravel.sh"]’>https://<yourstorage>/scripts/Laravel.sh"], "commandToExecute":"sh Laravel.sh" }

Cisco UCS C240 M3 WebBIOS

January 17, 2016

Recently had a hard time figuring out how to get to the RAID confirugation tool in a C240 M3. No matter how much I put in Control-R or Control-V or any other convination I always ended up in EFI Shell.

EFI Shell

Well, the WebBIOS is actually right behind the EFI Shell. Just type “exit” and enjoy. Killed me. Sad smile

~david

Use of undefined constant CURL_HTTP_VERSION_1_1 – assumed ‘CURL_HTTP_VERSION_1_1’

August 29, 2015

I was getting this problem even though I did have curl installed. However, I forgot to restart apache.

To install curl:

apt-get install php5-curl

To restart Apache2:

service apache2 restart

 

~david

Find UCCE agents and their assigned attributes and level

July 1, 2015

Maybe I should have checked CUIC to see if there was something, but I don’t remember something like this available. All I wanted was to see all my agents their attributes and levels.

SELECT [lab_awdb].[dbo].[Agent].EnterpriseName
      ,[lab_awdb].[dbo].[Attribute].EnterpriseName
      ,[AttributeValue]
  FROM [lab_awdb].[dbo].[Agent_Attribute]
JOIN [lab_awdb].[dbo].[Agent] ON [lab_awdb].[dbo].[Agent_Attribute].[SkillTargetID] = [lab_awdb].[dbo].[Agent].[SkillTargetID]
JOIN [lab_awdb].[dbo].[Attribute] ON [lab_awdb].[dbo].[Attribute].AttributeID = lab_awdb.dbo.Agent_Attribute.AttributeID

~david

X-Lite change the caller ID/Display Number

June 3, 2015

I had not used X-Lite for over a year and decided to load it up and realized that there’s an upgrade and older version of the software are no longer valid. So I upgraded and noticed that my Flowroute settings didn’t migrate correctly. I went to Flowroute got my credentials and moved them over, but noticed that my caller ID was not the caller ID I wanted. After playing around with it a bit I realized that I had to set my User ID to the caller ID I wanted displayed and moved my username/auth to “"Authorization name”. Now it’s working like it used to.

xlitesettings

~david

Using git to push and pull repositories.

March 18, 2015

I’ve been trying to get more proficient with git and figured the only way to do that is to get my hands dirty and write some simple app(s) and push them to a production server. There are my notes, mainly for me to help me remember how this stuff works.

The very first time you do a git init to initialize your repository.

git init

You do this every time you want to add new changes to your reposiotry.

git add .

To see the status of things which are going to be added, removed.

git status

Once you’re happy with what you want to commit, leave your future self a little love note.

git commit –m “Doing something”

You only do this the first time to setup your remote repository destination.

git remote add origin git@github.com:dmaciasSS/myrepo.git

Then you do this every time you want to push your commit.

git push –u origin master

Now, let’s say I want to pull my repository to a new host e.g. production. If you’re using Laravel make sure you’re setting up your environment name in your vhost file first.

sudo git clone https://github.com/dmaciasSS/myrepo.git locaton/in/my/server

Laravel specific commands.

chown -R :www-data app/storage

chmod –R 777 app/storage

‘composer install’

php artisan cache:clear

Now, once you’ve cloned your repository you need to updated it every time you want to pull down any new commits.

sudo git pull origin master

composer update

php artisan cache:clear

~david

Finesse Error: The device associated with that extension or dial number is invalid.

January 25, 2015

This is the first time I’ve used an 8945 phone as an agent phone and while the documentation states it’s supported, I kept getting the above error which made no sense to me as everything looked right. Checked out the jtapi logs and this is what it said:

16:48:24:420 PG1A-jgw1 Trace: MsgAddCallObserver:  Addr: 7778 Remote Addr: 0 InvID: 8380 CallDeliveryMode ID: 0.
16:48:24:420 PG1A-jgw1 Trace: Adding Call Observer to: 7778.
16:48:24:420 PG1A-jgw1 Trace: Address Name: 7778IP Addressing Mode:IP_ADDRESSING_MODE_IPV4.
16:48:24:420 PG1A-jgw1 Trace: AddCallObserver address validation failed – Address Name: 7778, error code: 154.
16:48:24:420 PG1A-jgw1 Trace:   MsgAddCallObserverResponse:  Addr: 7778 Succeeded: 0 InvID: 8380 Cause: 154.

Which then let me to this link. The problem was something I’ve never had to set in the UCM before. Join And Direct Transfer Policy.

image

Once that was changed the the phone recycled, everything worked. Go figure.

~david

Add Connection Profiles to Cisco AnyConnect Secure Mobility Client

August 19, 2014

I enjoy the new VPN client, it’s small and fast, however I hated that you can’t save profiles in the drop down list like you could in the traditional VPN client.

VPNNoProfile

This has been bothering for a long time and kept finding conflicting information on if this was possible or not. Finally got it to work.

VPNProfiles

This is for version 3.1x and Windows 7 let me know if this works for your version and OS.

  • Create a preferences.xml file in C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile\
  • Use this format

<?xml version="1.0" encoding="UTF-8"?>

<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/">
<ServerList>
     <HostEntry>
          <User>dclouduser</User>
          <SecondUser></SecondUser>
          <ClientCertificateThumbprint></ClientCertificateThumbprint>
          <ServerCertificateThumbprint></ServerCertificateThumbprint>
          <HostName>dCloud</HostName>
          <HostAddress>dcloud-rtp-anyconnect.cisco.com</HostAddress>
          <Domain></Domain>
          <Group>ssl_url</Group>
          <ProxyHost></ProxyHost>
          <ProxyPort></ProxyPort>
          <SDITokenType>none</SDITokenType>
          <ControllablePreferences>
          <LocalLanAccess>true</LocalLanAccess></ControllablePreferences>
     </HostEntry>

     <HostEntry>
          <User>dmacias</User>
          <SecondUser></SecondUser>
          <ClientCertificateThumbprint></ClientCertificateThumbprint>
          <ServerCertificateThumbprint></ServerCertificateThumbprint>
          <HostName>Speech-Soft</HostName>
          <HostAddress>vpn.dmacias.com</HostAddress>
          <Domain></Domain>
          <Group>ssl_url</Group>
          <ProxyHost></ProxyHost>
          <ProxyPort></ProxyPort>
          <SDITokenType>none</SDITokenType>
          <ControllablePreferences>
          <LocalLanAccess>true</LocalLanAccess></ControllablePreferences>
     </HostEntry>
</ServerList>

</AnyConnectProfile>

  • Save the file.
  • Restart the connectivity client.
  • Enjoy

~david

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org