tag:blogger.com,1999:blog-21941120722063338192024-03-14T03:26:33.424+00:00My gap in the voidA few of my thoughts...Unknownnoreply@blogger.comBlogger60125tag:blogger.com,1999:blog-2194112072206333819.post-53940449673493544092023-04-17T14:34:00.001+00:002023-04-17T14:34:06.154+00:00Visual Studio Code keeps asking to sign in to sync settings...<p>Recently I had an issue where every time I started Visual Studio Code it would ask me to log in again to sync settings. It would work for the session, but after a restart of vscode it would appear to forget them.</p><p>Turns out this is apparently due to a full list of credentials.</p><p>This is referred to in the Troubleshooting keychain issues page: https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues</p><p>Below is the text from the article at this point:</p><h3 data-needslink="_windows" id="_windows" style="background-color: white; box-sizing: border-box; color: #242424; font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 2.2rem; font-weight: 100; line-height: 1.1; margin-bottom: 10px; margin-top: 20px;"><a class="hash-link" href="https://code.visualstudio.com/docs/editor/settings-sync#_windows" style="background-color: transparent; box-sizing: border-box; color: #242424; text-decoration-line: none;">Windows</a></h3><p style="background-color: white; box-sizing: border-box; color: #242424; font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; margin: 0px 0px 10px;">If the keychain throws the error "Not enough memory resources are available to process this command", open the Credential Manager application, click on Windows Credentials and go through the list to see if there are some you can delete. This error was first reported in <a class="external-link" href="https://github.com/microsoft/vscode/issues/130893" style="background-color: transparent; box-sizing: border-box; color: #0071bc; text-decoration-line: none;" target="_blank">issue #130893</a> and happens when you have too many credentials in your Credential Manager.</p><p style="background-color: white; box-sizing: border-box; color: #242424; font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; margin: 0px 0px 10px;">If you're not sure what credentials to delete, try deleting all of the vscode specific credentials which all start with <code style="background-color: #f9f2f4; border-radius: 4px; box-sizing: border-box; color: #c7254e; font-family: Menlo, Monaco, Consolas, "Courier New", monospace !important; font-size: 14.4px; padding: 2px 4px;">vscode</code>. Here is a PowerShell one-liner that does exactly that:</p><pre class="shiki" style="background-color: white; border-radius: 4px; border: 1px solid rgb(148, 148, 148); box-sizing: border-box; color: #333333; font-family: Menlo, Monaco, Consolas, "Courier New", monospace !important; font-size: 13px; line-height: 1.42857; margin-bottom: 1em; margin-top: 1em; overflow-wrap: break-word; overflow: auto; padding: 0.5em 0.7em; word-break: break-all;"><code style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: inherit; font-family: Menlo, Monaco, Consolas, "Courier New", monospace !important; font-size: inherit; padding: 0px; tab-size: 2; white-space: pre-wrap;"><span class="line" style="box-sizing: border-box;"><span style="box-sizing: border-box; color: black;">cmdkey /list | </span><span style="box-sizing: border-box; color: #795e26;">Select-String</span><span style="box-sizing: border-box; color: black;"> -Pattern </span><span style="box-sizing: border-box; color: #a31515;">"LegacyGeneric:target=(vscode.+)"</span><span style="box-sizing: border-box; color: black;"> | </span><span style="box-sizing: border-box; color: #795e26;">ForEach-Object</span><span style="box-sizing: border-box; color: black;"> { </span><span style="box-sizing: border-box; color: #795e26;">cmdkey.exe</span><span style="box-sizing: border-box; color: black;"> /delete </span><span style="box-sizing: border-box; color: #001080;">$_</span><span style="box-sizing: border-box; color: #795e26;">.Matches.Groups</span><span style="box-sizing: border-box; color: black;">[</span><span style="box-sizing: border-box; color: #098658;">1</span><span style="box-sizing: border-box; color: black;">].Value }</span></span></code></pre>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-26040382016179698732022-04-24T19:01:00.000+00:002022-04-24T19:01:05.539+00:00Azurite!<p>While Azurite is automatically installed with Visual Studio 2022, it's not always the latest version.</p><p>To keep in control of which version you're running, run it in <a href="https://hub.docker.com/_/microsoft-azure-storage-azurite">docker</a>! Then when Visual Studio tries to start it up, it'll see something's already running on the Azurite ports and use that one instead.</p><p>Run it with something like the following to persist any data:</p><p><span style="font-family: courier;">docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 -v c:/azurite:/data mcr.microsoft.com/azure-storage/azurite</span></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-15730021676821143922021-08-12T14:03:00.002+00:002021-08-12T14:03:26.881+00:00Graphical glitches in WPF apps caused by Nahimic service<p> This is a strange one - after upgrading to Windows 11 preview I expected to get a few problems and assumed this was one of them. </p><p>Apparently it affects various versions of Windows though and is caused by the "Nahimic service" which I believe came with Sonic Suite and is related to my new Asus motherboard.</p><p>After setting this service to disabled I no longer get the graphical glitches in applications such as Fork GIT client, Visual Studio Installer and Choco GUI.</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-69649921663040987792021-03-06T21:20:00.003+00:002021-03-06T21:20:23.815+00:00Upgrading Ubuntu on WSLI was looking for a way to install Ubuntu 20.10 over my 20.04 WSL Windows 10 installation.<br />Simply instruct the system to upgrade!<br /><br /><span style="font-family: courier; font-size: x-small;">sudo sed --in-place 's/Prompt=lts/Prompt=normal/' /etc/update-manager/release-upgrades<br /><br />sudo do-release-upgrade</span><div><br />This will update, install missing packages and remove obsolete ones.<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-41985886599597055022021-02-17T10:30:00.005+00:002021-02-17T10:31:56.084+00:00Making Microsoft Dataverse OData queries using Postman<p>Once you have registered your application and have your ClientId and ClientSecret you can use these to authenticate using oauth2 client credentials workflow.</p><p><b>Environment</b></p><p>Create an appropriate Postman environment with the following variables:</p><p>url - https://<yourcompanyname>.crm4.dynamics.com<br />clientid - <your clientid><br />clientsecret - <your clientsecret><br />version - 9.1<br />webapiurl - {{url}}/api/data/v{{version}}<br />tenantid - <guid><br />authurl - https://login.microsoftonline.com/{{tenantid}}/oauth2/v2.0/token<br /><br /></p><p><b>Collection Authorization</b></p><p>Setup Authorization for your Postman Collection so all the calls within will inherit it and use the token.</p><p></p><ul style="text-align: left;"><li>Set the Type to "OAuth 2.0"</li><li>Add auth data to "Request Headers"</li><li>Configure New Token</li><li>Token Name - "MyToken"</li><li>Grant Type - "Client Credentials"</li><li>Access Token URL - "{{authurl}}"</li><li>Client ID - "{{clientid}}"</li><li>Client Secret - "{{clientsecret}}"</li><li>Scope - "{{url}}/.default"</li><li>Client Authentication - "Send as Basic Auth header"</li></ul><div>Click "Get New Access Token".</div><div>You should then get a pop-up with the message "Authentication complete" and then you can see the response and choose to use the token.</div><div><br /></div><div>Then you should be able to create your requests which will use this token.</div><div>Example request to get 3 accounts</div><div>GET {{webapiurl}}/accounts?$top=3</div><div><br /></div><p></p><p>Here's how to form your OData requests<br /><a href="https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/query-data-web-api">https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/query-data-web-api</a></p><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-86677030503535523752020-10-21T13:35:00.010+00:002023-04-24T18:34:05.811+00:00Getting SSH agent passthrough working with VS code<p>(Updated 2023-04-24)</p><p>I had frustrations getting SSH agent passthrough working with VS code such that when I was remoted onto a linux box and working with git, I wasn't able to use the git functions inside code as the auth was failing.</p><p>Doing the following worked for me at an administrator powershell prompt on your own machine</p><p><span style="font-family: courier;">Set-Service ssh-agent -StartupType Automatic</span></p><p><span style="font-family: courier;">Start-Service ssh-agent</span></p><p>Once you've got pageant or similar loading your keys then this should all work. You might need to add entries similar to below into your local ssh config file to ForwardAgent yes:</p><p><span style="font-family: courier;">Host remotehostname<br /></span><span style="font-family: courier;"><span> </span>User yourusername<br /></span><span style="font-family: courier;"><span> </span>ForwardAgent yes</span></p><p>Also make sure that you've got your ssh identity loaded</p><p>Use the following to list identities</p><p>'ssh-add -l'</p><p>and the following to add your id_rsa key</p><p>'ssh-add ~/.ssh/id_rsa'</p><h3 style="text-align: left;">Troubleshooting</h3><p>"ssh -V" to get the version.</p><p>Try using "ssh -vT git@github.com" to test the forwarding.</p><p>Due to bugs in the version of openssh v8.6p1 shipped with Windows 11 22H2, I only got this to work using a more recent release <a href="https://github.com/PowerShell/Win32-OpenSSH/releases">https://github.com/PowerShell/Win32-OpenSSH/releases</a>. So if you have problems where once connected you can see the error "get_agent_identities: ssh_fetch_identitylist: communication with agent failed" when doing "ssh -vT git@github.com" to test the forwarding, try updating. I tested and worked with v9.2.2.0p1-Beta.</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-35545981730764082102020-06-10T16:41:00.002+00:002020-06-10T16:53:42.089+00:00Removing credentials from your git repoIt happens... Occasionally a file you REALLY didn't want in your git repo is in there and you don't spot it until several days/months/years later! Worst case is that it's some credentials.<div><br /></div><div>First thing you do is change any affected systems where credentials may have been inadvertently been exposed.</div><div><br /></div><div>Make a backup of your repo using something like</div><div><pre style="background-color: #f6f8fa; border-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 13.6px; line-height: 1.45; margin-bottom: 16px; margin-top: 10px; overflow-wrap: normal; overflow: auto; padding: 16px;"><code class="hljs language-shell" style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; color: #333333; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;">git clone --mirror <repo></code></pre></div><div>Then as per <a href="https://help.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository">https://help.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository</a> you can remove the offending file. Don't forget the if the path to your file is in a sub-folder to use the correct slash, most likely "/" even on Windows.</div><div><pre style="background-color: #f6f8fa; border-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 13.6px; line-height: 1.45; margin-bottom: 16px; margin-top: 10px; overflow-wrap: normal; overflow: auto; padding: 16px;"><code class="hljs language-shell" style="background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; color: #333333; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;">git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch <em style="box-sizing: border-box;">PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA</em>" \
--prune-empty --tag-name-filter cat -- --all</code></pre>Then you can push your repo up and overwrite what's there.<pre style="background-color: #f6f8fa; border-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 13.6px; line-height: 1.45; margin-bottom: 16px; margin-top: 10px; overflow-wrap: normal; overflow: auto; padding: 16px;">git push origin --force --all</pre>Other users may then have to do the following<pre style="background-color: #f6f8fa; border-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 13.6px; line-height: 1.45; margin-bottom: 16px; margin-top: 10px; overflow-wrap: normal; overflow: auto; padding: 16px;"><span style="color: #24292e; font-size: 13.6px;">git fetch
git reset origin/master --hard</span></pre></div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-54101570470128325642020-05-21T08:45:00.002+00:002020-06-10T16:37:37.614+00:00Windows Terminal 1.0 releasedThe first stable release of <a href="https://github.com/microsoft/terminal" target="_blank">Windows Terminal</a> 1.0 has been <a href="https://docs.microsoft.com/en-gb/windows/terminal/" target="_blank">released</a>.<div><br /></div><div>I've been using this for a while now and with version 1.0 it's finally moved to a stable release.</div><div><br /></div><div>So why/what's this about? There's plenty of articles online about this so do a search online to get more information but the main advantages/features are:</div><div><ul style="text-align: left;"><li>a customisable terminal at last</li><li>multiple tabs</li><li>works with various shells including cmd, wsl, powershell, cmd, bash etc </li><li>image backgrounds</li><li>high performance as it can use GPU driven rendering.</li></ul><div>Integrate posh-git and powerline fonts to give yourself a <a href="https://www.hanselman.com/blog/HowToMakeAPrettyPromptInWindowsTerminalWithPowerlineNerdFontsCascadiaCodeWSLAndOhmyposh.aspx">pretty prompt</a> as described by Scott Hanselman:</div></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-NnHyuIu-sFE/XuEMN9gb6QI/AAAAAAAD9P0/kwQP6htOIsA6tmwQSlY7Wn-JHuDQHhKZwCK4BGAsYHg/s999/terminal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="308" data-original-width="999" height="124" src="https://1.bp.blogspot.com/-NnHyuIu-sFE/XuEMN9gb6QI/AAAAAAAD9P0/kwQP6htOIsA6tmwQSlY7Wn-JHuDQHhKZwCK4BGAsYHg/w400-h124/terminal.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-27161046845256310472018-11-19T23:02:00.001+00:002018-11-19T23:02:09.122+00:00Ansible on Ubuntu 18.04 on WSL<div>
Installing Ansible on Ubuntu 18.04 on WSL.
</div>
<div>
There's a few hiccups in the install process and it's necessary to modify the way the drives are mounted.</div>
<div>
<br />
<pre>sudo apt update
sudo apt install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt update
sudo apt install ansible
</pre>
<br /></div>
<div>
Once WSL is up and running, create/modify the /etc/wsl.conf to include the following:</div>
<div>
<pre style="overflow-wrap: break-word; white-space: pre-wrap;"></pre>
<pre style="overflow-wrap: break-word; white-space: pre-wrap;">#Let’s enable extra metadata options by default
[automount]
options = "metadata,umask=22,fmask=11"
</pre>
<br />
This will ensure that the folders and files aren't just world writeable by default. The metadata flag allows writing separate linux permissions from the windows permissions, they can't be more permissive but you can restrict further to make various linux binaries happier about their execution environment.
<br />
See <a href="https://blogs.msdn.microsoft.com/commandline/2018/01/12/chmod-chown-wsl-improvements/">https://blogs.msdn.microsoft.com/commandline/2018/01/12/chmod-chown-wsl-improvements/</a> for more details.<br />
<br />
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-75034081144647256952018-08-07T08:10:00.001+00:002018-08-07T08:10:31.489+00:00Android 9 Pie is out - Even betterHaving used the beta for a while, I knew that Android 9 was a nice update to the OS. It's finally out, on certain devices anyway.<br />
<br />
Delivered over the air from today on Pixel devices.<br />
<br />
<a href="https://www.android.com/versions/pie-9-0/">https://www.android.com/versions/pie-9-0/</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-2588754682659236252018-07-25T17:11:00.001+00:002018-07-25T17:11:12.901+00:00Debugging multiple PHP projects with VS Code and LaragonLaragon is a great solution for developing PHP, and especially Laravel, projects on Windows.<br />
It bundles together Apache, PHP, MySql and automatic host resolution based on folder names.<br />
It's great...<br />
Until...<br />
You try and debug in VS Code using XDebug when multiple sites on your local machine are hit in quick succession resulting in multiple connections from apache being opened against port 9000 on your VS Code instance at the same time.<br />
<br />
This manifests itself in VS Code by not hitting any breakpoints and just showing "Request 1" and "Request 2", or similar, in the debug call stack.<br />
<br />
In my environment, I have a main project containing middleware that does a security check against a second project before hitting my main action in my controller. Both PHP instances fire off their XDebug connections on port 9000, as <span style="font-family: Courier New, Courier, monospace;">xdebug.remote_autostart=1</span> in the PHP ini file.<br />
<br />
Normally this is fine as only one project is practically running at once, but the middleware causes the two connections to open pretty much simultaneously and the PHP XDebug extension in VS Code simply can't handle this yet.<br />
<br />
There are a few solutions to this.<br />
<br />
If you only want to debug one project at a time, even it multiple sites get hit, then you can use the .htaccess file in the Laravel "public" folder, and add an entry to modify the XDebug configuration such that it does not auto start:<br />
<span style="font-family: Courier New, Courier, monospace;">php_value xdebug.remote_autostart = 1</span><br />
<br />
Alternatively you can allocate different listening ports per project, allowing you to have multiple instances of VS Code open, each listening on a different port and servicing the XDebug connections independently:<br />
<span style="font-family: Courier New, Courier, monospace;">php_value xdebug.remote_port = 9001</span><br />
Make sure of course that your VS Code launch.json's port matches the one you've modified in the .htaccess file.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-89324020360385443562017-07-24T13:13:00.002+00:002017-07-24T13:13:37.886+00:00Reformatting a php.ini file with Sublime Text 3 for use with AnsibleSo quite a specific post this...<br />
<br />
PHP .env files are of the format<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">KEY_A=true</span><br />
<span style="font-family: Courier New, Courier, monospace;">KEY_B="This Is Another Value"</span><br />
<br />
To set variables for use with a Jinja2 template they need to be something along the lines of<br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">key_a: true</span><br />
<span style="font-family: Courier New, Courier, monospace;">key_b: ThisIsAnotherValue</span><br />
<br />
In Sublime Text in the replace all (CTRL+H)<br />
Make sure that regex matching is on and not to preserve case.<br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Find What: (.+)=(.+)</span><br />
<span style="font-family: Courier New, Courier, monospace;">Replace With: \L$1\E: $2</span><br />
<br />
This will replace two groups of one or more characters. The first will be lowercased, the equals replaced with a colon and then the second group in its original case.<br />
<br />
Then the original .env file can have the following in the Jinja2 template<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">KEY_A={{key_a}}</span><br />
<span style="font-family: Courier New, Courier, monospace;">KEY_B={{key_b}}</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-80338110293092100642016-11-03T20:37:00.003+00:002016-11-03T20:37:35.094+00:00Useful Vagrant pluginsSome useful Vagrant plugins I've picked up along the way<br />
<br />
vagrant-hostmanager<br />
Updates your host file with entries<br />
<br />
vagrant-reload<br />
Allows you to reload the vm during provisioning<br />
<br />
vagrant-share<br />
Allows sharing access remotely to vms<br />
<br />
vagrant-vbguest<br />
For automatically updating the virtualbox plugins<br />
<br />
vagrant-winnfsd<br />
NFS for sharing foldersUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-87224392640898863972016-01-11T17:07:00.003+00:002016-01-11T17:07:39.741+00:00Vagrant not working after fresh Windows 10 x64 installAfter recently re-installing Windows 10 x64 I discovered that to get vagrant to download box images, it uses an embedded version of curl. This requires the <a href="https://www.microsoft.com/en-us/download/details.aspx?id=26999">Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package x86 version</a>.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-29923651215917170682015-12-16T16:24:00.001+00:002016-02-03T16:33:16.100+00:00Occasionally making phpunit work with PhpStorm and homesteadWhen using homestead on vagrant I find that I need to use ssh/sftp setup for the server and interpreter for it to get the path mappings correct.<br />
<br />
Settings I configure<br />
<br />
"Build, Exection, Deployment" -> "Deployment"<br />
Add an entry for the server and set its "Type" to be "SFTP".<br />
In the "Connection" tab, set the details according to the information obtained by running "vagrant ssh-config".<br />
Set the "Auth type" to "Key pair" and set the "Private key file" to be the location of the IdentityFile from the ssh-config.<br />
<br />
In the "Mappings" tab, make sure that the deployment path remote server location matches the local path.<br />
<br />
Set up the PHP interpreter by going to "PHP" and adding a remote Interpreter. Set the remote to be based on the "Deployment configuration", saves you setting up all the SSH information again.<br />
<br />
In "PHP" -> "PHPUnit" add a "Remote Interpreter" and pick the one you set up.<br />
Set the "custom autoloader" to be the location of your vendor/autoload.php and optionally set the location of you phpunit.xml in the "Test Runner" -> "Default configuration file"<br />
<br />
Make sure xdebug is configured by doing similar to "sudo nano /etc/php/7.0/fpm/conf.d/20-xdebug.ini<br />
<br />
<pre><span style="font-family: Courier New, Courier, monospace;">xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.scream=0
xdebug.cli_color=1
xdebug.show_local_vars=1</span></pre>
<br />
Restart the service for php by doing "sudo service php7.0-fpm restart" or similar.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-3543983091710174652015-10-13T12:48:00.004+00:002015-11-16T17:00:36.956+00:00Making node / npm / gulp / elixir work for Laravel using Homestead on Vagrant with Virtualbox on WindowsWow what a title. More of a note to myself this one.<br />
<br />
Problem: npm install or variants thereof cause errors, mainly related to long filenames when run inside a homestead virtualbox virtual machine on Windows.<br />
<br />
A simple fix is to create a symbolic link inside the vm for the node_modules path so that it doesn't reside inside the folder being shared with the Windows file-system.<br />
<br />
Modify the Vagrantfile or the scripts/homestead.rb file if using homestead to include the following as part of the config:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">config.vm.provider "virtualbox" do |v|</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">end</span><br />
<br />
Then you'll need to run the Git Bash shell as admin, otherwise it won't let you create the symbolic links. The important part here is actually that winnfsd.exe starts as admin so you could change the compatibility in the properties to start as admin.<br />
<br />
Start vagrant with a "vagrant up"<br />
<br />
Once you've done "vagrant ssh", create a node_modules directory in your home directory, or somewhere similar and add a symbolic link to it within your Laravel project:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">mkdir ~/node_modules</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">ln -sf ~/node_modules /home/vagrant/projectname</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: inherit;">Then you can use</span><br />
<span style="font-family: inherit;"><br /></span><span style="font-family: "courier new" , "courier" , monospace;">sudo npm install —no-bin-link</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">to install the node modules with. You might have to "sudo" depending on your configuration and whether you have further issues.</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-65579932752250410182015-03-04T21:27:00.003+00:002015-03-04T21:27:30.550+00:00Introducing ASP.NET 5Good post from Scott Guthrie on ASP.NET 5<br />
<br />
<a href="http://weblogs.asp.net/scottgu/introducing-asp-net-5">http://weblogs.asp.net/scottgu/introducing-asp-net-5</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-71432506586690726702015-01-29T00:51:00.000+00:002015-01-29T08:03:59.748+00:00New Windows 10 build 9933 coming?<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-mcdHuVxP_qU/VMmDtfGbquI/AAAAAAAAkPc/SJxrG-7brdc/s1600/build_9933_coming.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://4.bp.blogspot.com/-mcdHuVxP_qU/VMmDtfGbquI/AAAAAAAAkPc/SJxrG-7brdc/s1600/build_9933_coming.png" height="588" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">It looks like 9933 might be coming soon...</td></tr>
</tbody></table>
Although it failed to download with an error 0x80246017, it looks as though there is a new build coming in the fast fbl_awsome1501 branch...<br />
<br />
UPDATE:<br />
<blockquote class="twitter-tweet" lang="en">
<a href="https://twitter.com/bc3tech">@bc3tech</a> <a href="https://twitter.com/AnXboxDude">@AnXboxDude</a> <a href="https://twitter.com/bdsams">@bdsams</a> Yep, looks like this is on us - we're exposing some build offers that we shouldn't - sorry, only MSFT can get.<br />
— Gabriel Aul (@GabeAul) <a href="https://twitter.com/GabeAul/status/560268766043324416">January 28, 2015</a></blockquote>
<script async="" charset="utf-8" src="//platform.twitter.com/widgets.js"></script>
Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-2194112072206333819.post-59669494844049052152015-01-24T19:29:00.001+00:002015-01-24T19:38:28.268+00:00Windows 10 Pro Technical Preview Build 9926I didn't bother to blog about the last couple of Windows 10 Technical Preview builds. They'd been talked about a lot and hyped or criticised enough.<br />
<br />
I wanted to take a couple of minutes though to say just how much I'm enjoying using Windows 8, Windows 8.1 and Windows 10. There's nothing wrong with them. Granted, the default user experience for Windows 8 was annoying, but so so easily rectified with something like <a href="http://www.classicshell.net/">Classic Shell</a>. I didn't really understand all the complaints, if your house has a front door that's horrible, but basically really good other than that, excellent central heating, insulation, double glazing, then for goodness sake, just do a little redecoration and get over it!<br />
<br />
Technically it's all pretty darn good these days and new latest build is edging towards the solution that Microsoft were trying to implement as an answer to the single operating system to cover phones, tablets and desktops. The main complaints from the Windows world was the fact that the desktop experience really sucked when trying to compromise/enable user friendly interfaces for tablet users.<br />
<br />
It really didn't work for those hard core desktop users, such as myself, who are developers/big application users.<br />
<br />
I think that Microsoft have taken this on board with their continuum concept that allows us as users to chose to switch between the two experiences. This should work very well when using something like the Surface which doubles as a slightly chunky tablet and laptop.<br />
<br />
Hang in there, try it out, don't just dismiss things because they don't immediately look how you're used to. Give it a chance. Give Microsoft feedback. With all the open source direction for the development environments, the IDE and runtime, this is a great time to be a developer. Enjoy it and explore a bit.<br />
<br />
The latest build, 9926, is even better than the last few, which have been a bit buggy. I don't expect it to be perfect, so lets see how things go.<br />
<br />
Cortana on the desktop doesn't quite work outside the US without a bit of tweaking, but this is the same as the Windows 8.1 developer preview for Windows phone was.<br />
<br />
Generally a much improved interface I feel. The start bar search is much nicer and settings dialogs are a little more thought out and integrated. Time to learn where everything is again...<br />
<br />
So far so good though...Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-9890667145713070242014-11-07T09:39:00.005+00:002014-11-07T09:39:37.240+00:00Enabling SNMP on an ASUS RT-N66URecently I wanted to monitor an ASUS RT-N66U, a brilliant router with many feature, one of which did NOT appear to be SNMP.<br />
<br />
After some rooting around on the Internet (pun intended?), I discovered that it is actually quite easy to set up.<br />
<br />
For this you will need a small USB stick, I used an old tiny 4GB thumb drive.<br />
<br />
Ensure it's partitioned and formatted to ext2. If you're using Windows then <a href="http://www.easeus.com/partition-manager/">EaseUS Partition Master</a> can help, there's a free version for home use. Otherwise the <a href="http://gparted.org/">Gnome Partition Editor</a>, otherwise known as GParted, will work.<br />
<br />
Just pop the USB drive into the back of the router and go to the "USB application" page in the UI, it's one of the options under "General" on the left hand index.<br />
<br />
At the bottom of that page is the "Download Master" which you can then choose to install onto your USB.<br />
<br />
What this does is into install a package manager, along with various packages for the Download Master, but this gives you the ability to install other packages!<br />
<br />
Next, in the "Advanced Settings" -> "Adminstration" section, about half way down the page in the "Miscellaneous" section is the "Enable Telnet" option. Set this to "Yes" so you can log into the router via telnet.<br />
<br />
Telnet to the router and log in with your admin account.<br />
<br />
Execute the following:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">ipkg update </span><br />
<span style="font-family: Courier New, Courier, monospace;">ipkg install net-snmp</span><br />
<span style="font-family: Courier New, Courier, monospace;">app_set_enabled.sh net-snmp yes</span><br />
<br />
the config file, should you need to change it, is <span style="font-family: Courier New, Courier, monospace;">/opt/etc/snmpd.conf</span><br />
<br />
I found that after changing the file, to modify the community string for example, I had to execute <span style="font-family: Courier New, Courier, monospace;">S70net-snmp.1</span> in the <span style="font-family: Courier New, Courier, monospace;">/opt</span> directory which, if you look at its contents, shuts down any snmpd and starts it again.<br />
<blockquote class="tr_bq">
</blockquote>
Unknownnoreply@blogger.com37tag:blogger.com,1999:blog-2194112072206333819.post-77753411753233662742014-10-05T23:26:00.003+00:002014-10-05T23:26:39.141+00:00Installing VMware tools under Centos 7Make sure you've updated the OS as much as possible using<br />
<span style="font-family: Courier New, Courier, monospace;">sudo yum update</span><br />
<br />
# Do a reboot<br />
<span style="font-family: Courier New, Courier, monospace;">sudo reboot</span><br />
<br />
Then install the kernel-headers and developer packages as well as gcc<br />
<span style="font-family: 'Courier New', Courier, monospace;">sudo yum install kernel-headers kernel-devel gcc</span><br />
<br />
Then attach the VMware tools disk through the workstation/player interface and decompress the tgz.<br />
Then you can run the install script and follow the instructions there.<br />
<span style="font-family: 'Courier New', Courier, monospace;">sudo vmware-install.pl </span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-41296466627055093042014-10-03T15:50:00.003+00:002014-10-03T15:50:32.966+00:00Realtek HD Audio speakers and headphones with separate volumeSo what's this article about? Well..<br />
<br />
I recently updated my audio driver from the default built in Windows 8.1 device driver to use the Realtek audio driver and it also installed the Realtek HD Audio Manager. It's a nice bit of software that allows you configure all things audio.<br />
<br />
However, as soon as I installed it I noticed that, when I plugged my headphones in, the volume was deafening. This was because the volume slider in the system tray was being shared between headphones and speakers. Previously when I plugged the headphones in, it muted the speakers and switched over to my headphones at around 15% volume.<br />
<br />
Now when I plug my headphones it it's at 100% still, which is what the speakers were at, needless to say it's a bit of a shock every time.<br />
<br />
I found out however that there is a solution. If you start the Realtek HD Audio Manager, there's usually an icon in the system tray, you can go to "Device advanced settings" in the top right corner and choose "Make front and rear output devices playback two different audio streams simultaneously". <br />
<br />
Now plug your headphones in and you get a second tab appear in the tool, one which is the "Speakers" and in my case "HD Audio 2nd output" which was my headphones. I set the headphones as the default device by clicking the "Set Default Device" button just to the right of the volume slider in the tool. This means that when I unplug the headphones the system falls back to the only other device, the speakers, and remembers what volume it was on, i.e. 100%. <br />
<br />
Then when you plug the headphones in again, it recognises them and switches over to them being the default device and importantly remembers the volume setting that was last used. No more deafness!Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-2194112072206333819.post-16844625627148091542014-10-01T21:00:00.001+00:002014-10-02T13:50:54.763+00:00Windows 10Skipping a version seems to be all the rage. The next version of Windows is indeed destined to be Windows 10 apparently. Not Windows 9. That would be too logical.<br />
This is interesting in the recent light of the next version of PHP, after PHP 5.6, is to be PHP 7. There was a vote and it found in favour of PHP 7 over 6. It's possible some of the same decisions that drove that version skip could contribute to the Microsoft decision. I'm sure they'll be some official announcement about why the version skip happened, but I suspect branching of software versions meant that Version 9 was abandoned in favour of 10. Unusual for a company Microsoft's size though, after all they can call Windows whatever they like, Windows 2014 etc etc.<br />
It's interesting as well that while their operating systems are following an increasing numeric range, since Windows 7 at least, most of their other software follows a yearly indicator, Office, SQL Server, SharePoint.<br />
<br />
Anyway it's time to go and play with the technical preview...<br />
<br />
Liking it so far. At last the command prompt is getting some new features. The ability to just paste using the normal CTRL+V shortcut is long overdue and now being able to dynamically resize the window with text re-wrapping is nice to see.<br />
<br />
I like the minimal borders, doesn't seem to make it any harder to grab hold of, does remind me of some Linux window managers though. Although to be fair, there's not that many different ways of doing things. Does look a bit cleaner now.<br />
<br />
I feel Microsoft often do this with their interfaces, make it all swanky and then dial it back to actually make it do what you want, once they've found out what that is...<br />
<br />
It really feels like this is Windows 8.2 though, not 10. We'll see what the future brings.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-22346438503819658102014-06-21T17:23:00.002+00:002014-06-21T17:23:14.645+00:00New experimental collections - MultiDictionary<a href="http://social.msdn.microsoft.com/profile/immo%20landwerth%20%5Bmsft%5D/">Immo Landwerth</a> posted an interesting article <a href="http://blogs.msdn.com/b/dotnet/archive/2014/06/20/would-you-like-a-multidictionary.aspx">here </a>on the concept of a MultiDictionary. I know it's something I've implemented myself on many occasion and here is his contribution, available via <a href="https://www.nuget.org/packages/Microsoft.Experimental.Collections/">NuGet</a>.<br />
<br />
An excerpt from the article at <a href="http://blogs.msdn.com/b/dotnet/archive/2014/06/20/would-you-like-a-multidictionary.aspx">http://blogs.msdn.com/b/dotnet/archive/2014/06/20/would-you-like-a-multidictionary.aspx</a>:<br />
<blockquote class="tr_bq" style="color: #424242; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px; margin-top: 12px;">
What’s your favorite data structure? Mine is the dictionary; I love the near constant time operations, the huge number of use cases, the cleanliness! Although the dictionary has a wide variety of uses, there are times when I want to add multiple values per key and Dictionary just doesn’t quite cut it. In those situations the solution is simple: just build a<code style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px; white-space: nowrap;">Dictionary<tkey alue="" list="">></tkey></code>!</blockquote>
<blockquote class="tr_bq">
<span style="background-color: white; color: #424242; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;">The issue with the dictionary of list is nearly every call to the </span><code style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); color: #424242; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 24px; margin: 0px; padding: 0px; white-space: nowrap;">Dictionary</code><span style="background-color: white; color: #424242; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;"> has to be wrapped in logic to check the current state of the dictionary before adding/removing/indexing etc. I’m never satisfied with the idea of surrounding my dictionary calls with a series of </span><code style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); color: #424242; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 24px; margin: 0px; padding: 0px; white-space: nowrap;">if</code><span style="background-color: white; color: #424242; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;"> statements, so I end up coding an entirely new data structure to wrap my dictionary of lists. I’ve had to do this more times than I’m proud of, which is why I’m pleased to code up that data structure </span><em style="background-color: white; color: #424242; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;">just one last time</em><span style="background-color: white; color: #424242; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;">.</span></blockquote>
<pre style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #424242; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px;"><code style="background: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;">MultiDictionary<string int=""> myDictionary = new MultiDictionary<string int="">();
myDictionary.Add("key", 1);
myDictionary.Add("key", 2);
myDictionary.Add("key", 3);
//myDictionary["key"] now contains the values 1, 2, and 3</string></string></code></pre>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2194112072206333819.post-71040033028811748742014-04-04T09:04:00.001+00:002014-04-04T09:04:09.268+00:00Microsoft SQL Server Data Tools - Business Intelligence for Visual Studio 2013For those of you wanting to use Visual Studio 2013 to contain Business Intelligence projects in your solution, the wait is over; the SQL Server Data Tools Business Intelligence (SSDTBI) templates, otherwise known as BIDS tools are now available. This includes project support for Analysis Services (SSAS), Integration Services (SSIS) and Reporting Services (SSRS).<br />
<br />
<a href="http://www.microsoft.com/en-us/download/details.aspx?id=42313">Microsoft SQL Server Data Tools - Business Intelligence for Visual Studio 2013</a>Unknownnoreply@blogger.com0